Repository navigation
docs(adr): add ADR 029 peer-table eviction policy - #443
Conversation
Closes #401. Codifies the existing TTL-based peer-table eviction (default 600 s on last_seen_us, sweep every 30 s) and resolves the four open policy questions from the issue: no hard size cap (the staking registry bounds growth via gossip validation rule 2), age-based expiry, offline handling, and active eviction on NodeDeregistered / NodeAutoEjected events. Reputation is explicitly excluded from the eviction decision — selection-time only. Adds an optional gossip.max_peer_entries safety ceiling that surfaces overflow via the existing decdn_gossip_messages_rejected_total{reason=table_full} counter. Cross-references: ADR 001 peer-table and Registry cache paragraphs; ADR 011 origin-blacklisting bullet; both indexes in architecture.md; the pandoc reading-order build in adr/README.md. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds ADR 029 to formally specify the peer-table eviction policy (TTL-based, registry-driven removals, no default size cap, reputation excluded), and wires it into the ADR corpus via reading order and cross-references.
Changes:
- Introduces ADR 029 documenting current TTL eviction behavior and defining future registry-event-driven removals and optional
gossip.max_peer_entries. - Updates ADR reading order / indices to include ADR 029.
- Cross-references ADR 029 from ADR 001 (peer table + registry cache) and ADR 011 (origin blacklisting implications).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
CLAUDE.md |
Bumps the “next ADR number” note to 030 after adding ADR 029. |
adr/README.md |
Inserts ADR 029 into the pandoc reading-order build list. |
adr/architecture.md |
Adds ADR 029 to Chapter 1 reading order and the numeric ADR index. |
adr/029-peer-table-eviction-policy.md |
New ADR defining peer-table eviction policy, rationale, and observability expectations. |
adr/011-content-takedown.md |
Cross-references ADR 029 for peer-table removal on NodeAutoEjected. |
adr/001-network.md |
Cross-references ADR 029 for peer-table lifecycle and registry-cache-driven peer-table removal. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request introduces ADR 029, which establishes the Peer-Table Eviction Policy. The policy specifies that peer table entries are evicted based on a 600-second TTL and through active removal triggered by registry deregistration or origin blacklisting. It also clarifies that reputation scores do not influence eviction and that the table has no default hard size cap, as growth is naturally limited by the staking registry. Related ADRs and documentation have been updated to reflect these changes. I have no feedback to provide.
Bot review on #443 noted that ADR 029 referenced metric updates to appendix-observability.md without actually amending the appendix. Add the new label value and counters there now so the observability spec stays self-consistent in a single PR: - decdn_gossip_messages_rejected_total: add reason=table_full - decdn_peer_table_evicted_ttl_total: new counter (TTL sweeper) - decdn_peer_table_evicted_registry_total: new counter, labeled by reason={deregistered,ejected} ADR 029 §2 prose tightened from "extending the label set in" to "label registered in" since the appendix now lists it. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Reviewer flagged that the two new gossip-metrics rows in appendix-observability.md §2.6 used "[ADR 029 §1]" / "[ADR 029 §3]" link text without section-anchor URLs, inconsistent with the existing "[ADR 026 §8](…#8-slashing-and-burn)" precedent elsewhere in the appendix. Add the matching anchors so the §-style references resolve. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Apply two stale-prone-phrasing suggestions from the latest review: - §2: "label registered in" → "per". "Registered in" implies a one-time act and would lie if the label were ever removed from the appendix; "per" simply frames the appendix as authoritative. - §6: "§2 adds the new label value reason=table_full" → "§2 specifies when the reason=table_full label value fires". Once the appendix records the label, "adds" reads as a stale change-log entry rather than a present-tense pointer. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Summary
last_seen_us, 30 s sweep), no hard size cap by default with an optionalgossip.max_peer_entriessafety ceiling, active eviction onNodeDeregistered/NodeAutoEjected, and explicit exclusion of reputation from the eviction decision.crates/gossip/src/peer_table.rsalready does and specifies the additional peer-table-removal step the registry-cache subscriber from ADR 019 § Step 3.3 must perform once implemented.adr/README.md. Next-ADR counter inCLAUDE.mdbumped 029 → 030.Test plan
pre-commit run --all-filespasses (markdownlint, cargo fmt/clippy/doc/deny — no Rust changed)grep -rn "ADR 029\|029-peer-table" adr/confirms inbound links from001-network.md,011-content-takedown.md,architecture.md,README.mdDEFAULT_PEER_TTL_SEC,resolve_gossip> 0check,ttl_sweeper_task,evict_expired)ejectNode → NodeAutoEjected, ADR 008 0.1 reputation floor, ADR 019 phase 3 / step 4.3, ADR 001 reputation 100× table)🤖 Generated with Claude Code