Skip to content

chore(l1): drop unwraps from p2p crate #3051

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 20 commits into from
Jun 12, 2025
Merged

chore(l1): drop unwraps from p2p crate #3051

merged 20 commits into from
Jun 12, 2025

Conversation

cdiielsi
Copy link
Contributor

@cdiielsi cdiielsi commented Jun 5, 2025

Motivation

Dissallow unwraps on l1.

Description

This pr drops unwraps on crate p2p in networking. Test's unwraps remain. Resolves partially #2879

@cdiielsi cdiielsi requested a review from a team as a code owner June 5, 2025 13:29
Copy link

github-actions bot commented Jun 5, 2025

Lines of code report

Total lines added: 61
Total lines removed: 4
Total lines changed: 65

Detailed view
+------------------------------------------------------+-------+------+
| File                                                 | Lines | Diff |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/kademlia.rs             | 609   | -4   |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/error.rs           | 89    | +9   |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/frame.rs           | 207   | +5   |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/handshake.rs       | 447   | +15  |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/utils.rs           | 100   | +13  |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync.rs                 | 575   | +8   |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync/state_sync.rs      | 242   | +3   |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync/storage_fetcher.rs | 204   | +6   |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync/trie_rebuild.rs    | 259   | +2   |
+------------------------------------------------------+-------+------+

@cdiielsi cdiielsi marked this pull request as draft June 5, 2025 14:42
@cdiielsi cdiielsi marked this pull request as ready for review June 5, 2025 15:47
Co-authored-by: Marcos Nicolau <76252340+MarcosNicolau@users.noreply.github.com>
Copy link
Contributor

@ilitteri ilitteri left a comment

Choose a reason for hiding this comment

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

I highlighted all the potential refactoring opportunities in comments. In future PRs I suggest you to review your own code once you made it work, and figure out if there isn't a refactoring opportunity.

Copy link
Contributor

@SDartayet SDartayet left a comment

Choose a reason for hiding this comment

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

Great work! I just have some doubts about the errors used in some cases

@mpaulucci mpaulucci changed the title feat(l1): drop unwraps from p2p crate chore(l1): drop unwraps from p2p crate Jun 10, 2025
@cdiielsi cdiielsi added this pull request to the merge queue Jun 12, 2025
Merged via the queue into main with commit 0af7738 Jun 12, 2025
33 of 34 checks passed
@cdiielsi cdiielsi deleted the drop-unwraps-p2p branch June 12, 2025 18: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.

6 participants