Skip to content
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

refactor(l1): improve error handling in RLPx modules #1017

Merged
merged 20 commits into from
Nov 8, 2024

Conversation

ElFantasma
Copy link
Contributor

@ElFantasma ElFantasma commented Oct 30, 2024

Motivation

Current code is full of potential panics and unwrap()s

Description

Functions in RLPx modules should now return Result<_, RLPxError>s and prevent panicking.

Closes #845
Fixes commented test from #843

@ElFantasma ElFantasma linked an issue Oct 30, 2024 that may be closed by this pull request
@ElFantasma ElFantasma marked this pull request as ready for review November 6, 2024 15:14
@ElFantasma ElFantasma requested a review from a team as a code owner November 6, 2024 15:14
Copy link
Contributor

@fkrause98 fkrause98 left a comment

Choose a reason for hiding this comment

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

Looks good, but let's use the get method where we can, since accessing with brackets can panic.

crates/networking/p2p/rlpx/connection.rs Outdated Show resolved Hide resolved
crates/networking/p2p/rlpx/connection.rs Outdated Show resolved Hide resolved
crates/networking/p2p/rlpx/connection.rs Outdated Show resolved Hide resolved
crates/networking/p2p/rlpx/frame.rs Show resolved Hide resolved
crates/networking/p2p/rlpx/handshake.rs Show resolved Hide resolved
crates/networking/p2p/rlpx/message.rs Show resolved Hide resolved
@ElFantasma ElFantasma added this pull request to the merge queue Nov 8, 2024
Merged via the queue into main with commit 1e1fde0 Nov 8, 2024
14 checks passed
@ElFantasma ElFantasma deleted the 845-improve-error-handling-in-rlpx-modules branch November 8, 2024 13:49
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.

Improve error handling in RLPx modules
2 participants