Skip to content
protobuf.com

Practice

Protobuf Practice

Edit the schema, wait for the descriptor checks, and continue when everything passes.

Progress

Exercise 3: Integer Types

3. Integer Types
Context
Integer choice affects wire size. int32/int64 waste bytes on negatives; sint32/sint64 ZigZag-encode them. Values that never go negative should be unsigned.
Task

Change ledger_balance to sint64, and change hardware_counter to uint32 or uint64.

schema.proto
Valid Schema
syntax = "proto3";

package practice;

message Metrics {
  int32 ledger_balance = 1;
  int32 hardware_counter = 2;
}
EVALUATION_CHECKS
ledger_balance uses 'sint64' for zigzag encoding efficiency.
hardware_counter uses unsigned integer type ('uint32' or 'uint64').

Exercise Incomplete

Please satisfy all checks above