Skip to content

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

Merged
fmoletta merged 3 commits into
mainfrom
remove-asserts-frame-decoding
Apr 16, 2025
Merged

refactor(l1): remove usage of assert_eq in frame decoding (rlpx)#2456
fmoletta merged 3 commits into
mainfrom
remove-asserts-frame-decoding

Conversation

@fmoletta

Copy link
Copy Markdown
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

@github-actions

Copy link
Copy Markdown

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

@mpaulucci mpaulucci left a comment

Copy link
Copy Markdown
Collaborator

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
@fmoletta fmoletta deleted the remove-asserts-frame-decoding branch April 16, 2025 16:01
pedrobergamini pushed a commit to pedrobergamini/ethrex that referenced this pull request Aug 24, 2025
…ambdaclass#2456)

**Motivation**
Replaces `assert_eq` usage with proper errors in rlpx frame decoding
<!-- Why does this pull request exist? What are its goals? -->

**Description**
* Add error variant `RLPXError::InvalidMessageFrame`
* Remove usage of `assert_eq` in `RLPxCodec::decode` impl
<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 -->

Closes lambdaclass#1748
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