Skip to content

ADR 022 — DHT bandwidth analysis, cold-start re-publish jitter, motivate batched STORE #629

Closed

Description

@alpergundogdu

Context

ADR 001 has a detailed gossip bandwidth analysis (§ Gossip Bandwidth Analysis, with a scaling table from 30 to >1000 nodes). ADR 022 has no equivalent for DHT — no per-RPC wire sizing, no aggregate throughput model, no scaling table. The DHT rate-limit numbers landed in #628 (20 / 100 / 1000 req/sec across three layers) are reasonable defaults but not derived from a throughput model, and implementers + operators have no sizing model to validate them against.

Adding this analysis also surfaces a spec gap (cold-start re-publish scheduling) and a meaningful protocol optimization (batched STORE) that's hard to justify without the numbers.

Scope

DHT bandwidth analysis section in ADR 022

Symmetric to ADR 001 § Gossip Bandwidth Analysis. Three pieces:

Per-RPC wire sizing. Hashes are 32B, NodeIds are 32B; with varint framing and QUIC stream overhead:

RPC Request Response Round-trip
FindValue ~100B ~500B typical / ~2.3 KB max ~600B typical
Store ~100B ~70B (ack) ~170B
FindNode ~100B ~700B ~800B

Steady-state per-node DHT bandwidth. Dominated by STORE re-publish; scales with cached blob count (C), not network size (N). With K+3=23 publish targets and 40-minute average re-publish cycle:

C (cached blobs) STORE bandwidth (per node, both directions) Notes
100 ~1.3 Kbps Light client
1,000 ~13 Kbps Typical node
10,000 ~130 Kbps Comparable to gossip at N=1000
100,000 ~1.3 Mbps Heavy caching node

FIND_VALUE traffic scales with the cache-miss rate and weakly with N (hop count grows as log N): at 1 miss/sec and N=500, ~75 Kbps.

Bootstrap surge. A restarting publisher with C=10,000 cached blobs needs 230,000 STOREs to fully populate DHT records. The natural spread mechanism is per-record jitter — each blob's re-publish is drawn from uniform(30 min, 50 min). With proper jitter at cold start, bootstrap rate matches steady state (~96 STOREs/sec). Without jitter at cold start, all 230k STOREs fire in one scheduler tick and saturate the per-peer rate limit.

Cold-start re-publish MUST in ADR 022 § Bootstrap

A specific implementation MUST: on cold start, each cached blob's first re-publish time is drawn from uniform(0, 50 min) (not the standard uniform(30, 50) since blobs have no previous publish to anchor from). Subsequent re-publishes use the standard jittered interval. Naive "re-publish everything on the next tick" is non-conforming.

Validate #628 rate limits against the analysis

At C=10k, N=500 steady state:

  • Per-peer inbound STORE: ~0.19/s average, ~2/s burst. Limit 20/s. 5×–10× headroom. ✓
  • Per-IP: same accounting. Limit 100/s. ✓
  • Global inbound: ~95/s STORE + ~10/s FIND_VALUE. Limit 1000/s. ✓

The numbers are conservative ceilings rather than steady-state targets, which is the right shape. Worth recording in the analysis so future tuning has a baseline.

Document the case for batched STORE (separate follow-up)

The bandwidth analysis motivates batching as a real optimization:

  • Bootstrap framing overhead. 230,000 STOREs × ~50B QUIC framing = ~11.5 MB pure framing per bootstrap. Batched at 256 hashes per RPC: 900 batches × ~50B = ~45 KB framing. ~256× reduction in framing-only cost.
  • Total bytes on wire at bootstrap. Unbatched: ~39 MB. Batched: ~22 MB. ~44% savings.
  • Steady-state. Modest framing savings (~10–20% at typical concentration), but the same shape — batching collapses publisher→receiver concentration into one RPC per scheduler tick instead of N.
  • What batching does NOT help with. FIND_VALUE (different hashes have different K-closest sets, no batching opportunity) and FIND_NODE (bandwidth already negligible). Rate-limit ceilings are unchanged if tokens are charged per-hash on batches.

A separate follow-up issue should specify BatchStoreRequest / BatchStoreAck wire types (≤256 hashes/batch, partial-accept ack semantics, per-hash token accounting). This issue and its PR establish the bandwidth analysis that justifies that work.

Out of scope

  • Batched STORE wire types and handler logic. Separate follow-up; design sketch documented inline but the implementation is bigger surface than this issue's scope.
  • FIND_VALUE batching. No useful batching opportunity (different hashes route differently).
  • Network-bandwidth limits per cached-blob count. This issue documents the model; setting operator-policy caps on C is out of scope.

Acceptance criteria

  1. ADR 022 has a new ### DHT Bandwidth Analysis section symmetric to ADR 001 § Gossip Bandwidth Analysis, with per-RPC wire sizing, a steady-state scaling table over C, and bootstrap surge analysis.
  2. ADR 022 § Bootstrap adds a MUST for cold-start per-record jitter (uniform(0, 50 min) for first re-publish after startup, standard jitter thereafter).
  3. The analysis validates the docs(adr): harden cdn/dht/v1 — per-publisher quota, DHT rate limit, lookup invariants, jitter, negative probe cache #628 rate-limit numbers against modeled steady-state load and records the headroom.
  4. The analysis identifies framing overhead at bootstrap as the load-bearing motivation for batched STORE and cross-references the follow-up issue.
  5. A follow-up issue for batched STORE is filed and linked (DHT: batch StoreRequest for bootstrap and dense re-publish #630).

References

Activity

  1. added
    design:adr
    kind:docs
    on May 21, 2026
  2. github-actions commented on May 21, 2026

    @github-actions

    🎯 Triage report

    This is a well-scoped ADR documentation task: add a DHT bandwidth analysis section to ADR 022 (symmetric to ADR 001 § Gossip Bandwidth Analysis), introduce a cold-start re-publish jitter MUST, and validate the rate-limit headroom from #628 against the derived model. The issue also frames the motivation for a batched STORE follow-up (#630 is already filed per AC 5). All acceptance criteria are enumerated and the numbers are pre-computed inline.

    📊 Assessment

    Dimension Value Reasoning
    Type Task Pure ADR documentation work — no Rust code changes required
    Labels ADR, documentation, technical, adr-review ADR edit with a normative MUST addition; adr-review signals it needs maintainer sign-off before merge
    Coding agent Suitable Requirements are fully specified: exact section name, table contents, jitter formula, rate-limit validation text, and cross-reference to #630 are all spelled out in the issue body

    🔗 Similar issues

    💡 Notes and suggestions

    Editing target: adr/022-content-discovery.md. The new section should be inserted after the existing rate-limiting section and before any appendix/references block. Mirror the heading level and table style used in adr/001-network.md § Gossip Bandwidth Analysis for consistency.

    Normative MUST to add (§ Bootstrap):

    On cold start, each cached blob's first re-publish time MUST be drawn from uniform(0, 50 min) rather than uniform(30, 50 min), because no previous publish timestamp exists to anchor from. Subsequent re-publishes use the standard jittered interval. Implementations that re-publish all blobs on the next scheduler tick are non-conforming.

    Rate-limit validation text to include (can be lifted directly from issue):

    • Per-peer inbound STORE at C=10k, N=500: ~0.19/s avg, ~2/s burst — limit 20/s gives 5–10× headroom ✓
    • Per-IP: same accounting — limit 100/s ✓
    • Global inbound: ~95/s STORE + ~10/s FIND_VALUE — limit 1000/s ✓

    Cross-consistency check before PR: run grep -rn 'cdn/dht/v1\|FIND_VALUE\|FindValue\|StoreRequest' adr/ to confirm ALPN and RPC names remain consistent across all ADRs after the edit.

    Sub-task checklist:

    Generated by Agentic Triage for issue #629 · ● 2.4M · ◷

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

design:adrkind:docs

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions