Skip to content

Conversation

cdiielsi
Copy link
Contributor

@cdiielsi cdiielsi commented Oct 6, 2025

Motivation

Stop panicking when decoding a message with a wrong version of capabilities eth68 and eth69.

Description

This pr has the decode method for both capabilities throw error in case the eth version of the message is wrong.
The only instance where this can happen is if the other peer isn't respecting the negotiated capabilities. This happens as seen in issue #4760. Here we can see the eth version negotiated can only be either 68 or 69.

Closes #4760

@github-actions github-actions bot added the L1 Ethereum client label Oct 6, 2025
Copy link

github-actions bot commented Oct 6, 2025

Lines of code report

Total lines added: 16
Total lines removed: 0
Total lines changed: 16

Detailed view
+--------------------------------------------------------+-------+------+
| File                                                   | Lines | Diff |
+--------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/connection/server.rs | 860   | +3   |
+--------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/eth/eth68/status.rs  | 112   | +5   |
+--------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/eth/eth69/status.rs  | 112   | +5   |
+--------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/p2p.rs               | 317   | +3   |
+--------------------------------------------------------+-------+------+

@cdiielsi cdiielsi marked this pull request as ready for review October 7, 2025 20:47
@cdiielsi cdiielsi requested a review from a team as a code owner October 7, 2025 20:47
@ethrex-project-sync ethrex-project-sync bot moved this to In Review in ethrex_l1 Oct 7, 2025
Copy link
Collaborator

@MegaRedHand MegaRedHand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mpaulucci mpaulucci changed the title refactor(l1): throw error on wrong version of eth capaability refactor(l1): throw error on wrong version of eth capability Oct 8, 2025
@fmoletta fmoletta added this pull request to the merge queue Oct 8, 2025
Merged via the queue into main with commit 568405c Oct 8, 2025
38 checks passed
@fmoletta fmoletta deleted the propagate_err_for_eth_unsuported_version branch October 8, 2025 18:52
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l1 Oct 8, 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.

Avoid panic when eth version is unsupported

4 participants