refactor(pseudo-peer): direct trusted peer + DB hash resolution#122
Merged
sprites0 merged 3 commits intonode-builderfrom Mar 14, 2026
Merged
refactor(pseudo-peer): direct trusted peer + DB hash resolution#122sprites0 merged 3 commits intonode-builderfrom
sprites0 merged 3 commits intonode-builderfrom
Conversation
3 tasks
a8cdb97 to
98a03cc
Compare
d82bde9 to
80d08d2
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…iscovery Remove boot nodes and discovery (discv4/DNS) since the pseudo-peer always connects to a known local node. Use add_trusted_peer so the peer auto-reconnects and is never evicted after backoff failures. Set max_inbound to 0 since only one outbound connection is needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…kfill scanning Pass a DbBlockNumberFn closure from build_network into the pseudo-peer for direct hash→number lookups against the node's header DB. Remove ~200 lines of backfill/cache-warming code. The LRU cache remains as a fast-path to avoid DB roundtrips. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bfa0728 to
adc5606
Compare
Collaborator
Author
|
Finally! |
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.
Summary
1.
style: cargo fmt and clippy fixesFormatting and
collapsible_iflint fixes, no functional changes.2.
refactor: use direct trusted peer instead of boot node discoveryadd_trusted_peerinstead ofadd_peerso the peer auto-reconnects on disconnect and is never evicted after backoff failuresmax_inbound(0)since only one outbound connection is needed3.
refactor: resolve hash→number via node DB instead of backfill scanningDbBlockNumberFnclosure frombuild_networkinto the pseudo-peer for direct hash→number lookups against the node's header DBbackfill_cache_for_hash,warm_cache_around_blocks,try_block_range_for_hash,get_cached_block_hashes,fallback_to_official_rpc, watermarks, retry loop)This resolves #109
Test plan
🤖 Generated with Claude Code