Repository navigation
feat(l1): improved lookup interval - #5518
Merged
Merged
Conversation
Lines of code reportTotal lines added: Detailed view |
ElFantasma
requested review from
ManuelBilbao,
avilagaston9 and
ilitteri
as code owners
December 4, 2025 15:53
ilitteri
approved these changes
Dec 4, 2025
Contributor
|
LGTM, I'll test it at home and approve if able to sync. |
Oppen
approved these changes
Dec 12, 2025
Oppen
left a comment
Contributor
There was a problem hiding this comment.
Didn't complete the sync due to local network speed limits, but it downloaded all accounts and a significant number of storages, and peers were stable. Found 7 quickly and didn't lose any in an hour.
1 task
MysticRyuujin
pushed a commit
to MysticRyuujin/ethrex
that referenced
this pull request
Aug 24, 2026
…aclass#7163) **Motivation** `DiscoveryConfig::initial_lookup_interval` is dead data. lambdaclass#6511 (kademlia k-bucket routing table v2) replaced the configurable bound in `DiscoveryServer::get_lookup_interval` with its own constants, because each iterative lookup emits ~16 FindNode messages instead of 1 and needed a rescaled schedule: ```diff lookup_interval_function( peer_completion, - self.config.initial_lookup_interval, - super::LOOKUP_INTERVAL_MS, + ITERATIVE_LOOKUP_INITIAL_MS, // 500.0 + ITERATIVE_LOOKUP_INTERVAL_MS, // 10_000.0 ) ``` The field itself survived, still threaded from `--p2p.lookup-interval` through `P2PContext` and `start_network` into a `DiscoveryServer` that never reads it. The only live consumer of the flag is the RLPx initiator, so the help text was also misleading. While tracing it, a second problem turned up: `impl Default for Options` sets `lookup_interval: Default::default()`, which is `0.0` for `f64` rather than the `INITIAL_LOOKUP_INTERVAL_MS` that clap uses for the flag. `default_l1()`, `default_l2()` and the L2 node options all build on that impl, so they hand the RLPx initiator a 0ms lower bound. With no peers connected the easing curve returns `Duration::ZERO`, and `handle_look_for_peer` re-arms its timer with no delay at all. Present since lambdaclass#5518 added the flag. **Description** - Remove `initial_lookup_interval` from `DiscoveryConfig` and stop overriding it in `start_network`. `DiscoveryConfig`'s `Default` impl goes with it: both remaining fields are set explicitly at the single construction site, and clap already defaults them to `true`. - Reword `--p2p.lookup-interval`'s help to describe what it actually controls, and refresh the now-stale doc comments on `INITIAL_LOOKUP_INTERVAL_MS` / `LOOKUP_INTERVAL_MS` / `lookup_interval_function`. - Default `Options::lookup_interval` to `INITIAL_LOOKUP_INTERVAL_MS`. No behavior change for the discovery server, which was already running on its own constants. The second commit does change behavior for the dev/L2 paths that go through `Options::default()`, restoring the 100ms floor they were meant to have. **Checklist** - [ ] Updated `STORE_SCHEMA_VERSION` (crates/storage/lib.rs) if the PR includes breaking changes to the `Store` requiring a re-sync.
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.
Motivation
Node lookup interval is used to send
FindNodeandENRRequestmessages for discovery and to try initiate new RLPx connections and currently it uses only two values.Description
Closes #5149 (also addresses #5148, already closed)