Skip to content

refactor(l1): remove usage of assert_eq in frame decoding (rlpx) #2456

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

Merged
merged 3 commits into from
Apr 16, 2025

Conversation

fmoletta
Copy link
Contributor

Motivation
Replaces assert_eq usage with proper errors in rlpx frame decoding

Description

  • Add error variant RLPXError::InvalidMessageFrame
  • Remove usage of assert_eq in RLPxCodec::decode impl

Closes #1748

Copy link

Lines of code report

Total lines added: 10
Total lines removed: 0
Total lines changed: 10

Detailed view
+--------------------------------------------+-------+------+
| File                                       | Lines | Diff |
+--------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/error.rs | 76    | +2   |
+--------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/frame.rs | 202   | +8   |
+--------------------------------------------+-------+------+

@fmoletta fmoletta changed the title refactor: remove usage assert_eq in frame decoding (rlpx) refactor(l1): remove usage assert_eq in frame decoding (rlpx) Apr 14, 2025
@fmoletta fmoletta changed the title refactor(l1): remove usage assert_eq in frame decoding (rlpx) refactor(l1): remove usage of assert_eq in frame decoding (rlpx) Apr 14, 2025
@fmoletta fmoletta marked this pull request as ready for review April 14, 2025 21:51
@fmoletta fmoletta requested a review from a team as a code owner April 14, 2025 21:51
Copy link
Collaborator

@mpaulucci mpaulucci left a comment

Choose a reason for hiding this comment

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

nice!

@fmoletta fmoletta added this pull request to the merge queue Apr 16, 2025
Merged via the queue into main with commit cfec7f9 Apr 16, 2025
19 checks passed
@fmoletta fmoletta deleted the remove-asserts-frame-decoding branch April 16, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace assert_eq!() usage for actual errors in frame.rs
3 participants