fix(dht): let runtime re-bootstrap recover isolated and client-starved routing tables - #153
Open
Nic-dorman wants to merge 1 commit into
Open
fix(dht): let runtime re-bootstrap recover isolated and client-starved routing tables#153Nic-dorman wants to merge 1 commit into
Nic-dorman wants to merge 1 commit into
Conversation
Two dead ends in the routing-table repair path (V2-1036): - maybe_rebootstrap gave up when no peers were connected; only process startup re-dials the configured bootstrap peers, so a fully isolated node could never recover at runtime (WithAutonomi/ant-sdk#232: ~34h at rt=0, restart-only recovery). It now falls back to re-dialing the configured bootstrap peers before giving up. - bootstrap_from_peers skipped every gossiped-peer dial in client mode, but admission is connection-driven (handle_peer_connected), so a starved client rediscovered the same peers every cycle and stayed starved forever (observed: 98 cycles / 10h of 'discovered 10 peers' with the table pinned at 2). Starved clients now dial gossiped peers until the table clears the threshold; non-starved clients keep the skip. Also: the completion log reports post-repair table size, and maybe_rebootstrap + AUTO_REBOOTSTRAP_THRESHOLD are now public (manual recovery hook and health reporting). Regression tests cover both dead ends and were verified to fail against the previous behavior. ADR-018 records the decision. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 20, 2026
Member
|
Review verdict: APPROVE (code) at The recovery path is bounded by the existing cooldown, falls back to configured bootstrap peers only when isolated, and only adds client-mode gossip dials while the routing table is below the threshold. The two regression scenarios passed locally: Before merge: ADR-018 is still |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linear issue
V2-1036
Risk tier
Compatibility
AUTO_REBOOTSTRAP_THRESHOLDandDhtNetworkManager::maybe_rebootstrapbecome public.Semver impact
Test evidence
tests/client_rebootstrap.rscovers both dead ends (isolated-node fallback, client-mode starvation dials). Both tests were run against the unfixed code and fail there; they pass with the fix (0.97s).cargo testgreen locally (Windows, exit 0);cargo fmtand the strict clippy gate (-D warnings -D clippy::unwrap_used -D clippy::expect_used) clean.Auto re-bootstrap discovered 10 peers; and the downstream mainnet incident antd: /health reports ok when the node has no peers and cannot write (no peer-count or write-readiness signal) ant-sdk#232 (~34h at rt=0, restart-only recovery).New dependency
none
ADR
ADR-018: Runtime Re-bootstrap Must Be Able to Recover (added in this PR)
Mitigation / rollback
Revert the commit; the new behavior only activates below the re-bootstrap threshold after the 5-minute cooldown, so the blast radius is limited to nodes that are already degraded.
🤖 Generated with Claude Code