Skip to content

feat(l1): pull new peers from discovery #3500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

MegaRedHand
Copy link
Collaborator

@MegaRedHand MegaRedHand commented Jul 4, 2025

Motivation

We aren't actively finding new nodes.

Description

This PR adds a new RLPxServer that actively initiates new connections and keeps a healthy eth-enabled peerbase. The idea is to have something like:

Screenshot 2025-07-04 at 20 02 34
  • The RLPxServer starts N workers that perform recursive lookups through discv4 (we need workers for this to not block the server).
  • P2P consumers (like the Syncer) call the server to get open peer connections.

@github-actions github-actions bot added the L1 Ethereum client label Jul 4, 2025
Copy link

github-actions bot commented Jul 4, 2025

Lines of code report

Total lines added: 317
Total lines removed: 35
Total lines changed: 352

Detailed view
+-----------------------------------------------+-------+------+
| File                                          | Lines | Diff |
+-----------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/discv4/lookup.rs | 385   | +68  |
+-----------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/discv4/server.rs | 819   | -26  |
+-----------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/network.rs       | 160   | +7   |
+-----------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx.rs          | 9     | +2   |
+-----------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/lookup.rs   | 79    | +79  |
+-----------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/p2p.rs      | 304   | +36  |
+-----------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/server.rs   | 125   | +125 |
+-----------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/admin/peers.rs   | 103   | -9   |
+-----------------------------------------------+-------+------+

@MegaRedHand MegaRedHand moved this to In Review in ethrex_l1 Jul 7, 2025
@MegaRedHand MegaRedHand moved this from In Review to In Progress in ethrex_l1 Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L1 Ethereum client
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant