The protocol uses three different time units with no naming convention to distinguish them.
Auth.timestamp (auth.proto:20) is minutes since the project epoch 2024-01-01 UTC. Ping.timestamp (ping.proto:13), echoed back as Pong.timestamp (pong.proto:84), is milliseconds since the Unix epoch. Every other time field — Lease.ends, Property.ends, Property.metered, Property.expires, Peer.metered, Peer.expires, Pong.expires, and Pong.cutoff in pong.proto — is seconds since the Unix epoch.
A client computing the remaining free window as Pong.cutoff - Pong.timestamp gets a result in a meaningless mixed unit: seconds minus milliseconds. The error is silent in proto3 because both fields share the uint64 type and the comment is the only clue. The same trap applies to any comparison between the echoed round-trip timestamp and the cutoff or expires sentinel.
Rename the fields to embed their unit (e.g. timestamp_ms in Ping/Pong and timestamp_min in Auth) or normalise all time fields to a single unit and a single epoch. Either way, document the choice once in a top-level comment so implementors do not have to diff three files to find the unit.
The protocol uses three different time units with no naming convention to distinguish them.
Auth.timestamp(auth.proto:20) is minutes since the project epoch 2024-01-01 UTC.Ping.timestamp(ping.proto:13), echoed back asPong.timestamp(pong.proto:84), is milliseconds since the Unix epoch. Every other time field —Lease.ends,Property.ends,Property.metered,Property.expires,Peer.metered,Peer.expires,Pong.expires, andPong.cutoffin pong.proto — is seconds since the Unix epoch.A client computing the remaining free window as
Pong.cutoff - Pong.timestampgets a result in a meaningless mixed unit: seconds minus milliseconds. The error is silent in proto3 because both fields share theuint64type and the comment is the only clue. The same trap applies to any comparison between the echoed round-trip timestamp and the cutoff or expires sentinel.Rename the fields to embed their unit (e.g.
timestamp_msin Ping/Pong andtimestamp_minin Auth) or normalise all time fields to a single unit and a single epoch. Either way, document the choice once in a top-level comment so implementors do not have to diff three files to find the unit.