Repository navigation
docs: batch fix 30+ ADR issues, integrate separated discovery design - #85
Conversation
Replaces CacheAnnounce gossip with probe-based content discovery, resolving issue #25 (Bloom filter parameter problems) by eliminating Bloom filters and hash list broadcasts entirely. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Fix local demand tracking: use VecDeque<u64> timestamps instead of (count, last_seen) to support sliding window threshold - Fix network popularity tracking: store per-peer announcement timestamps - Clarify routing table removal vs probe cache distinction - Fix architecture.md path reference to adr/architecture.md - Reword privacy trade-off: popularity is a new gossiped signal, content availability is now probe-discoverable only - Note probe cache TTL overlap with slashing evidence window Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Plan covers updates to ADR 001, 005, 008, and architecture.md to replace CacheAnnounce with NodeAnnounce and probe fan-out content discovery. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Remove Bloom filters, hash lists, and gossip-derived routing tables. Add NodeAnnounce gossip, probe fan-out content discovery, probe cache, and dual-signal prefetching. Reframe DHT future work for scaling probe fan-out. Resolves #25. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Gossip now carries node metadata (NodeAnnounce) instead of content inventories. Content discovery handled via cdn/probe/v1 fan-out.
Replace CacheAnnounce with NodeAnnounce in system diagram and ADR summaries. Update cache miss flow to probe fan-out model. Update prefetching to dual-signal model. Update future work section.
Update routing table → peer table in ADR 003, 004, 005. Update CacheAnnounce → NodeAnnounce in ADR 003 gossip flooding. Update cache miss flowchart in architecture.md to probe fan-out. Update ADR 005 probe section to reference peer probing not routing table. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Design specs and implementation plans are working artifacts, not permanent repo content. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Fix stale "content availability broadcast via gossip" in ADR 003 - Fix "announced content" and "deprioritized in routing" in ADR 003 - Fix "content routing announces" in ADR 004 auto-ejection - Clarify "routing table" references in ADR 001 consequences - Clarify probe cache TTL = slashing window overlap in ADR 001 - Fix "observe probe traffic" in architecture.md future work - Update ADR 000 gossip description to NodeAnnounce - Add NodeAnnounce struct cross-reference in ADR 005 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Rename NodeAnnounce timestamp → timestamp_us for protocol consistency - Specify signature covers all fields via postcard serialization - Add gossip validation rules (signature + registry check) to ADR 001 - Store full signed ProbeResponse in probe cache for slashing evidence - Cross-reference ADR 001 validation from ADR 004 auto-ejection Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…ecture Clarify that the app server (key delivery, subscription auth) is a traditional web service operated by content providers, not part of the CDN protocol or crate structure. Add External Components section to architecture.md, update network diagram to show provider infrastructure, and detail the app server's API surface and scaling model in ADR 006. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…#58) - ADR 003: Add full NodeId-to-Ethereum binding section with EIP-712 typed data, on-chain registration via StakingRegistry.bindNodeId(), and ephemeral off-chain binding for clients - ADR 004: Add 100 TOKEN challenge bond for PoC (was N/A), preventing zero-cost griefing via fabricated slash claims - ADR 005: Reference challenge bond requirement in probe slashing section Closes #57, closes #58 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Reject probe-requires-channel option (bootstrap catch-22) - Clarify clock skew immunity in rate manipulation detection - Define channel expiry (maxChannelDuration: 90 days) and reclaimExpired - Specify nonce as on-chain per-client monotonic counter with pre-computation - Add Concurrent Streams subsection with rules, example, and isolation advice Closes #73, closes #72, closes #67, closes #66, closes #61 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…62) ADR 001: - Add registry unavailability fallback with retry and cached peer list - Document region hint limitations and PoC latency-based detection - Specify Bloom filter parameters (1% FPR, k=10, 14.4 bits/item) - Define unified node selection algorithm: rate × rtt × (1/reputation²) ADR 008: - Add 1-hour recency validation for gossip reputation reports - Fix bootstrap division-by-zero with max(1, ...) guard - Switch reporter weight from channel count to settled USDC value Closes #71, closes #70, closes #25, closes #6, closes #77, closes #63, closes #62 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Document dual-connection overhead and production optimization path - Add redirect loop prevention (max 3 hops, cycle detection) - Add Error Handling section with StreamError enum, retry semantics, timeouts - Define postcard schema evolution strategy (trailing Option<T> for non-breaking, new ALPN for breaking) - Update challenge bond references to reflect PoC implementation Closes #75, closes #69, closes #29, closes #24 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
) ADR 006: - Reduce offline lease TTL from 30 to 7 days with mandatory daily check-in - Add key rotation notification via iroh-gossip EpochRotated message - Use iroh QUIC stream for PoC epoch key delivery (not WebSocket/SSE) - Add key hierarchy: per-content epoch keys derived from server_secret ADR 009: - Define pause sunset as immutable constructor deadline with upgrade-only extension - Tighten safety bounds: slash 5-50%, dispute window 12h-72h, rate floor >= 1 ADR 003 (consistency): - Update dispute window safety bounds to match ADR 009 (12h-72h) Closes #76, closes #68, closes #26, closes #16, closes #78, closes #65 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…#81, #64, #60, #74) ADR 010: - Resolve slashing denomination: always in TOKEN stake, no cross-token conversion - Fix backward-compat contradiction: payment_token requires cdn/client/v2 - Clarify SafeERC20 rationale (USDT non-returning transfer pattern) ADR 011: - Add blacklist version sync recovery (delta, full re-sync, cache scan fallback) - Document self-reported region limitation with production mitigation path ADR 004: - Restrict PoC mint() to onlyOwner, document production removal - Define PoC slash counter reset: 30 days without incidents Closes #59, closes #84, closes #80, closes #81, closes #64, closes #60, closes #74 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
ADR 007: - Add Fee Accountability section: PoC trust-based, production escrow with heartbeats ADR 004: - Add production bootstrap modeling table (100/500/1000 nodes) - Document reflexive TOKEN price dependency risk architecture.md: - Add Gossip Bandwidth Budget section (~6 KB/s per node at PoC scale) - Add Privacy Surface section consolidating all privacy tradeoffs - Sync overview sections: unified selection score, 4 ALPNs, value-weighted reputation, tightened safety bounds, NodeId binding, challenge bonds Closes #17, closes #11, closes #45, closes #15 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Revert changes for blocked issues: - #24: Remove Schema Evolution Strategy section from ADR 005 - #11: Remove Gossip Bandwidth Budget section from architecture.md - #45: Remove Privacy Surface section from architecture.md Update #84 cross-reference to not depend on removed #24 section. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR updates the ADR set and adr/architecture.md to resolve a large batch of open documentation issues, mainly by tightening protocol/governance/payment specifications and synchronizing cross-ADR assumptions (selection scoring, slashing/challenge bonds, schema evolution, watchtowers, and privacy/bandwidth considerations).
Changes:
- Specify/align core protocol mechanics (unified node selection score, redirect loop prevention, retry/error semantics, and postcard schema evolution rules).
- Clarify economic/security mechanisms (challenge bonds, governance safety bounds, multi-token ALPN break, and slashing denomination).
- Expand operational/spec detail (watchtower fee accountability model, blacklist version resync recovery, gossip bandwidth budget, and privacy surface summary).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| adr/architecture.md | Sync high-level architecture narrative with updated ADR decisions (selection score, watchtower ALPN, challenge bonds, gossip/privacy analysis). |
| adr/001-network.md | Define unified node selection score and add registry-unavailability + Bloom filter parameter details. |
| adr/003-payments.md | Add concurrent-stream rules, on-chain nonce + channel expiry/reclaim semantics, and NodeId↔Ethereum binding spec. |
| adr/004-tokenomics.md | Update PoC mint restrictions, add PoC challenge bond, and extend bootstrap modeling notes. |
| adr/005-protocol.md | Add redirect loop prevention, error/retry semantics, and explicit schema evolution strategy for postcard/ALPN. |
| adr/006-e2e-encryption.md | Define key hierarchy + rotation notification, switch PoC key delivery transport, and tighten offline lease TTL/check-in policy. |
| adr/007-watchtower.md | Add fee accountability model (PoC trust-based vs production escrow + heartbeats). |
| adr/008-reputation.md | Switch reporter credibility to value-weighted settled USDC, add division-by-zero guard, and add report recency validation requirement. |
| adr/009-governance.md | Tighten safety bounds (slash %, dispute window, rate floor) and specify immutable multisig sunset/extension mechanism. |
| adr/010-multi-token.md | Clarify SafeERC20 rationale, resolve slashing denomination, and mark payment_token as requiring cdn/client/v2. |
| adr/011-content-takedown.md | Add blacklist version-sync recovery procedure and document PoC vs production region-verification posture. |
💡 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 updates several Architecture Decision Records to refine the network's economic, security, and protocol designs. Key additions include a unified node selection score, a value-weighted reputation system to prevent Sybil attacks, and detailed retry semantics. The payment model is updated with channel expiry and challenge bonds for slashing, while the encryption scheme now utilizes a key hierarchy and mandatory check-ins for offline leases. Feedback indicates a need to correct the stated false positive rate for Bloom filters to align with the specified parameters and suggests reconsidering the dependency on clock synchronization for reputation report validation.
- Fix slash 100% exceeding governance max 50%: production third offense now 50% (cumulative slashing triggers auto-ejection) - Fix rate floor: ADR 003 safety bounds now >= 1 base unit (was 0), matching ADR 009 - Fix channel expiry: ADR 010 references updated from 30 to 90 days - Fix dispute window: "24-hour" hardcoded references now say "default 24h, governable 12h-72h" - Update ADR 005 and architecture.md to reference unified selection score - Fix "Three ALPN" heading to "Four ALPN" (watchtower was added) - Disambiguate cdn/keys/v1 ALPN from cdn/keys/rotation/v1 gossip topic Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- ADR 005: Update mermaid diagram to reference unified selection score - ADR 003: Add ChannelExpiredReclaimed event for reclaimExpired - ADR 003: Add reclaimExpired to channel close lifecycle documentation Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- ADR 003: Reject bindNodeId if nodeId already bound to different address - ADR 003: Clarify nonce read-then-increment ordering for channelId - ADR 004: Fix challenge bond rationale (testnet token has no economic cost) - ADR 008: Add future-timestamp rejection + clock sync dependency note - ADR 001: Clamp reputation to min 0.1 in selection score (avoid div-by-zero) - ADR 001: Correct Bloom filter FPR from 1% to 0.1% (matches k=10, m=14.4) - ADR 009: Add Min deposit row to governance parameters table Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates several Architecture Decision Records (ADRs) to refine the network's economic and protocol specifications. Key changes include the introduction of a unified node selection score incorporating reputation, the addition of challenge bonds for slashing to prevent griefing, and the implementation of a key hierarchy for enhanced encryption security. It also refines payment channel lifecycles with expiry mechanisms, updates governance safety bounds, and establishes retry and redirect loop prevention logic. Feedback was provided regarding a duplicated lifecycle description in the payment ADR, which should be consolidated.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- ADR 003: Remove duplicate reclaimExpired lifecycle entry - ADR 005: Add error? field to StreamResponse wire format diagram - ADR 006: Fix key hierarchy opening sentence (limits client-key compromise blast radius, not server_secret compromise) - architecture.md: Link to ADR 001 for selection score instead of inlining formula without clamp Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Moves the detailed cdn/keys/v1 spec from PR #47 into this batch fix: - ADR 006: Full protocol messages (KeySessionOpen, EpochKeyUpdate, EnvelopeRequest/Response), app server as iroh Endpoint, dual-stream pattern, authentication model, concurrent session limiting - ADR 005: cdn/keys/v1 in ALPN table (five protocols), stream limits (10: 1 epoch + 9 envelopes), connection lifetime exception - architecture.md: cdn/keys/v1 in ALPN table, updated ADR 006 summary - CLAUDE.md: cdn/keys/v1 and cdn/watchtower/v1 in ALPN table Supersedes #47 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Remove Bloom filter spec from ADR 001 — PR #44 proposes a broader discovery redesign that may eliminate Bloom filters entirely. Leaving #25 for that PR to resolve. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
ADR 010 is a draft for a post-PoC feature with no deployed v1 to be backward-compatible with. Simplify: - Revert cdn/client/v1→v2 versioning back to just cdn/client/v1 - Replace 3-phase migration plan with simple contract replacement - Remove "old nodes"/"legacy"/"backward-compatible" framing Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
ADR 001: Network Topology and Peer Mesh
ADR 002: Content Addressing
ADR 003: Payment Model
ADR 004: Tokenomics & Staking
ADR 005: Wire Protocol
ADR 006: E2E Encryption
ADR 007: Watchtowers
ADR 008: Reputation System
ADR 010: Multi-Token Payment Support
ADR 011: Content Takedown
|
- Commit to 15s probe cache TTL (half the 30s slashing window) - Add NodeAnnounce replay prevention (timestamp freshness ±60s + monotonic check) - Increase probe timeout from 200ms to 500ms for inter-continental coverage - Add registry freshness check before paid pulls (new step 5) - Add probe rate limits (10 outbound fan-outs/s, 20 inbound/peer/s) - Try next cached provider before falling back to full fan-out Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Integrates the NodeAnnounce/probe fan-out redesign from PR #44 into the batch ADR fix branch, consolidating both PRs into one. Key changes from PR #44: - Replace CacheAnnounce with lightweight NodeAnnounce (~700 bytes) - On-demand probe fan-out for content discovery (no routing tables) - 15s probe cache TTL (half the 30s slashing evidence window) - 500ms probe timeout for inter-continental coverage - Gossip validation: signature, registry, timestamp freshness, monotonic - Registry check before paid pulls (content discovery step 5) - Probe rate limits: 10 outbound fan-outs/s, 20 inbound/peer/s - Cascading cached provider fallback before full fan-out - Prefetching via local demand + network popularity signals - App server as external component (WebSocket/SSE, not cdn/keys/v1) Conflict resolution preserved PR #85's additions: - Node Selection Algorithm with reputation weighting - Registry Unavailability with retry/fallback - Redirect loop prevention, StreamError enum, retry semantics - Challenge bond, channel expiry, NodeId-to-Ethereum binding - ADRs 007, 009, 010, 011 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Summary
Batch fix for 30+ open ADR issues across all ADRs + architecture.md + CLAUDE.md. Also integrates the separated discovery design from PR #44 (now closed), replacing CacheAnnounce with NodeAnnounce + probe fan-out.
Excluded from this PR
Separated Discovery Design (from PR #44)
CacheAnnouncewith lightweightNodeAnnounce(~700 bytes) — no Bloom filters, no hash listsWave 1 — Critical Foundations (#57, #58)
bindNodeId(), 1:1 enforcement, ephemeral client binding)Wave 2 — ADR 003 Payments (#73, #72, #67, #66, #61)
maxChannelDuration: 90 days, governable 7d–365d) withreclaimExpired+ChannelExpiredReclaimedeventWave 3a — Network + Reputation (#71, #70, #6, #77, #63, #62)
rate × rtt × 1/max(rep, 0.1)²with multiplier tablemax(1, ...)guardWave 3b — Protocol (#75, #69, #29)
StreamErrorenum,error?field in wire format, retry semantics, 10s timeoutsWave 3c — Encryption + Governance (#76, #68, #26, #16, #78, #65)
cdn/keys/rotation/v1topic)Wave 4 — Multi-token + Takedown + Tokenomics (#59, #84, #80, #81, #64, #60, #74)
mint()toonlyOwner, document production removalWave 5 — Cross-ADR Fixes + Architecture Sync (#17, #15)
Supersedes
Issues Closed
Closes #57, closes #58, closes #73, closes #72, closes #67, closes #66, closes #61, closes #71, closes #70, closes #6, closes #77, closes #63, closes #62, closes #75, closes #69, closes #29, closes #76, closes #68, closes #26, closes #16, closes #78, closes #65, closes #59, closes #84, closes #80, closes #81, closes #64, closes #60, closes #74, closes #17, closes #15
Test plan
CacheAnnounce,routing table, orcdn/keys/v1references remain[ADR XXX]links,#section-anchorlinksarchitecture.mdandCLAUDE.mdoverviews match ADR content🤖 Generated with Claude Code