Skip to content

dht: no full republish after a lagged event stream; no staker-set resync after an extended watcher outage #1561

Closed

Description

@thiras

Two untracked resilience gaps in the DHT layer, both explicitly deferred in code comments that cite no issue:

  1. Republish sweep after a lagged event stream — crates/node/src/dht/publish.rs:302: on broadcast::error::RecvError::Lagged, the republisher cannot run a full sweep because the cache exposes no hash-enumeration API (the comment says "filed for follow-up", but no such issue exists). Missed hashes stay undiscoverable until cold-start or an operator restart.
    • add a cache iter_hashes-style API and a full republish pass on Lagged
  2. Staker-set resync after an extended watcher outage — crates/node/src/dht/chain_staker_set.rs:73: "A getActiveNodes resync-on-extended-outage path is a follow-up." The cached active-staker set drifts silently; decdn_staker_set_watcher_resolve_failures_total surfaces the window but nothing closes it.
    • trigger a paged getActiveNodes re-enumeration when the watcher recovers after a gap

Activity

  1. added
    prio:medium
    rust
    on Aug 1, 2026
  2. github-actions commented on Aug 1, 2026

    @github-actions

    🎯 Triage report

    Two deferred resilience gaps in the DHT layer, each backed by a code comment that cites no tracking issue — this issue closes that gap. The gaps are independent but both relate to stale/undiscoverable state after an interruption: (1) hashes become undiscoverable after a Lagged broadcast event because the republisher has no way to enumerate all cached hashes, and (2) the active-staker set drifts silently after a chain-watcher outage because no resync path is triggered on recovery.

    📊 Assessment

    Dimension Value Reasoning
    Type Task Two follow-up implementation tasks explicitly deferred in code; not a bug in current design intent
    Labels technical, medium, rust (already applied) Accurate — Rust implementation work, medium urgency (correctness gap but not data loss)
    Coding agent Suitable Both sub-tasks have pinpointed file locations, clear API shapes to add, and defined trigger conditions; self-contained scope with no architectural decisions needed

    🔗 Similar issues

    No similar issues found.

    💡 Notes and suggestions

    Sub-task 1 — Cache iter_hashes + republish on Lagged (crates/node/src/dht/publish.rs:302)

    • Add an iterator/stream API to the cache layer (iter_hashes or equivalent) that enumerates all currently-held content hashes without requiring the caller to track them externally.
    • In the RecvError::Lagged arm, call a full republish sweep using that API instead of skipping.
    • Confirm the sweep is bounded (rate-limited or chunked) to avoid a thundering-herd on restart.
    • Test: simulate a lagged receiver, assert hashes remain discoverable in the DHT after recovery.

    Sub-task 2 — Staker-set resync after watcher gap (crates/node/src/dht/chain_staker_set.rs:73)

    • When the watcher recovers after a gap, trigger a paged getActiveNodes re-enumeration to rebuild the staker set from chain state.
    • The existing decdn_staker_set_watcher_resolve_failures_total metric already surfaces the gap window — use it (or the recovery event) as the trigger.
    • Consider a configurable outage threshold before triggering resync to avoid noisy short blips.
    • Test: mock an extended watcher outage, verify the staker set converges to chain truth after recovery.

    Suggested checklist:

    • Add iter_hashes (or equivalent) to the cache API
    • Handle RecvError::Lagged with a full republish sweep in publish.rs
    • Add resync-on-recovery path in chain_staker_set.rs
    • Unit/integration tests for both paths
    • Confirm no existing metric/alert gaps after the fixes

    Generated by Agentic Triage for #1561 · sonnet46 · 12.7 AIC · ⌖ 5.61 AIC · ⊞ 6K · ◷

    Add this agentic workflow to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
  3. moved this from Backlog to Ready in deCDNon Aug 20, 2026
  4. self-assigned this
    on Aug 24, 2026
  5. moved this from Ready to In progress in deCDNon Aug 24, 2026
  6. moved this from In progress to Done in deCDNon Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

prio:mediumrust

Type

Fields

Priority

High

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions