Skip to content

docs(pong): document zero-value contract for Property.ends, Peer.expires, Pong.expires#40

Open
VasilevNStas wants to merge 1 commit into
APN-Network:masterfrom
VasilevNStas:8-docs/zero-value-contracts
Open

docs(pong): document zero-value contract for Property.ends, Peer.expires, Pong.expires#40
VasilevNStas wants to merge 1 commit into
APN-Network:masterfrom
VasilevNStas:8-docs/zero-value-contracts

Conversation

@VasilevNStas

@VasilevNStas VasilevNStas commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Description

Documents the zero-value contract for three uint64 timestamp fields in pong.proto. No wire changes.

Problem

Lease.ends (line 16) explicitly documents that ends == 0 means "free tier", but Property.ends, Peer.expires and Pong.expires (all uint64) say nothing about zero.

A client evaluating expires < now to decide on migration will always find 0 < now == true for any unpopulated field — making a perfectly live Node/Peer look permanently decommissioned and a country slot appear expired at Unix epoch.

Changes

Field Zero means
Property.ends no purchase record available (not yet loaded from Hub)
Peer.expires no decommission scheduled; client MUST NOT treat as "already expired"
Pong.expires no decommission scheduled; client MUST NOT treat as "already expired"

Closes #8

@VasilevNStas

Copy link
Copy Markdown
Contributor Author

@davvd plz review

@davvd

davvd commented Jul 4, 2026

Copy link
Copy Markdown
Member

@VasilevNStas we have merge conflicts here, please resolve them and we'll merge

…res, Pong.expires

Lease.ends already documents that 0 means free tier, but the
three sibling timestamp fields shared the same uint64 type
without a zero-value contract. A client evaluating expires < now
would see 0 < now == true for any unpopulated field and treat a
perfectly live Node/Peer/slot as permanently expired/deleted.

Add 'Zero means ...' to each field comment so implementers know
the sentinel is safe to test for.
@VasilevNStas
VasilevNStas force-pushed the 8-docs/zero-value-contracts branch from 6dd87f5 to c172350 Compare July 4, 2026 18:07
@VasilevNStas

Copy link
Copy Markdown
Contributor Author

@davvd conflicts resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants