Skip to content

Conversation

@ElFantasma
Copy link
Contributor

Motivation
Currently we don't limit the amount of connected peers, but we have an internal constant for that

Description
Avoid new connections if the amount of connected peers matches the target

Closes #4862

@ElFantasma ElFantasma requested a review from a team as a code owner October 14, 2025 20:01
@ElFantasma ElFantasma changed the title Match the amount of peers to target feat(l1): match the amount of peers to target Oct 14, 2025
@github-actions github-actions bot added the L1 Ethereum client label Oct 14, 2025
@github-actions
Copy link

github-actions bot commented Oct 14, 2025

Lines of code report

Total lines added: 29
Total lines removed: 16
Total lines changed: 45

Detailed view
+--------------------------------------------------------+-------+------+
| File                                                   | Lines | Diff |
+--------------------------------------------------------+-------+------+
| ethrex/cmd/ethrex/cli.rs                               | 536   | +12  |
+--------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/discv4/peer_table.rs      | 907   | -8   |
+--------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/discv4/server.rs          | 480   | -7   |
+--------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/metrics.rs                | 588   | +6   |
+--------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/peer_handler.rs           | 1750  | -1   |
+--------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/connection/server.rs | 975   | +5   |
+--------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/error.rs             | 117   | +2   |
+--------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/initiator.rs         | 101   | +4   |
+--------------------------------------------------------+-------+------+

@github-project-automation github-project-automation bot moved this to In Review in ethrex_l1 Oct 15, 2025
@ElFantasma ElFantasma added this pull request to the merge queue Oct 15, 2025
Merged via the queue into main with commit 59ed6ca Oct 15, 2025
31 checks passed
@ElFantasma ElFantasma deleted the match_target_peers branch October 15, 2025 15:28
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l1 Oct 15, 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: Done

Development

Successfully merging this pull request may close these issues.

Prevent ethrex from connecting to more than our targeted peers

4 participants