Skip to content

Pong.expires, Peer.expires, and Property.ends lack a zero-value contract unlike Lease.ends #8

Description

@bibonix

The `Lease` message in `pong.proto` (line 16) explicitly documents that `ends == 0` means "free tier", making the zero value safe to test as a sentinel. `Pong.expires` (line 105), `Peer.expires` (line 74), and `Property.ends` (line 27) carry the same `uint64` type but say nothing about what zero means.

A client evaluating `expires < now` to decide whether to migrate to a different Node will find `0 < now` is always true, so any Node or Peer whose `expires` was never populated will look permanently decommissioned. The same applies to `Property.ends`: a client checking whether a country slot is still valid would see a zero as a slot that expired at Unix epoch, hiding a perfectly live slot from the UI. In proto3, missing or default-valued fields arrive as zero, so this is not a hypothetical edge case — it happens whenever a server omits the field.

The fix is to add a sentence to each field comment stating the zero-value contract, following the pattern `Lease.ends` already establishes. For example: "Zero means no decommission is scheduled" for `expires`, and "Zero means the slot has no purchase record" for `Property.ends`. No wire change is required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions