The gauges field in Pong (pong.proto:146) is declared as map<string, int64>. Every value the comment documents is non-negative: load (percent × 100, range 0–10000), clients (connected client count), version (a build counter that mirrors Welcome.minor, itself a uint32), brothers (peer set size), stalls (write-back-pressure count), and rtt (round-trip time in milliseconds). No gauge key is documented as carrying a signed value.
Using int64 admits negative values that have no defined protocol meaning. A receiver that encounters a negative load or rtt has no contract to consult: the field type accepts it, the comment says nothing about it. The version gauge is the sharpest inconsistency: it is said to match Welcome.minor, which is uint32. A gauges["version"] value of -1 satisfies the wire type but cannot equal any valid Welcome.minor.
Change map<string, int64> to map<string, uint64> at pong.proto:146. This rules out semantically impossible negative values and brings the type into line with the rest of the numeric fields in pong.proto, all of which use uint64.
The
gaugesfield inPong(pong.proto:146) is declared asmap<string, int64>. Every value the comment documents is non-negative:load(percent × 100, range 0–10000),clients(connected client count),version(a build counter that mirrorsWelcome.minor, itself auint32),brothers(peer set size),stalls(write-back-pressure count), andrtt(round-trip time in milliseconds). No gauge key is documented as carrying a signed value.Using
int64admits negative values that have no defined protocol meaning. A receiver that encounters a negativeloadorrtthas no contract to consult: the field type accepts it, the comment says nothing about it. Theversiongauge is the sharpest inconsistency: it is said to matchWelcome.minor, which isuint32. Agauges["version"]value of-1satisfies the wire type but cannot equal any validWelcome.minor.Change
map<string, int64>tomap<string, uint64>atpong.proto:146. This rules out semantically impossible negative values and brings the type into line with the rest of the numeric fields inpong.proto, all of which useuint64.