Skip to content
protobuf.kmcd.dev

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
Numeric types affect both meaning and wire size. Plain `int32` and `int64` are inefficient for negative values. `sint32` and `sint64` use ZigZag encoding for signed values. Counts that cannot be negative should use unsigned types.
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