Skip to content

Conversation

@Mechanix97
Copy link
Contributor

@Mechanix97 Mechanix97 commented May 23, 2025

Motivation

The protocol capability offset was hardcoded within the msg code.

Description

In order to decouple the msg code from the protocol offset, a const was created with the len of the protocol.

geth reference

Closes #2902

@Mechanix97 Mechanix97 self-assigned this May 23, 2025
@Mechanix97 Mechanix97 added p2p Issues related to p2p network L1 Ethereum client labels May 23, 2025
@github-actions
Copy link

Lines of code report

Total lines added: 22
Total lines removed: 0
Total lines changed: 22

Detailed view
+----------------------------------------------+-------+------+
| File                                         | Lines | Diff |
+----------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/rlpx/message.rs | 190   | +22  |
+----------------------------------------------+-------+------+

@Mechanix97 Mechanix97 marked this pull request as ready for review May 23, 2025 15:46
@Mechanix97 Mechanix97 requested a review from a team as a code owner May 23, 2025 15:46
Copy link
Contributor

@cdiielsi cdiielsi left a comment

Choose a reason for hiding this comment

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

LGTM!

@Mechanix97 Mechanix97 enabled auto-merge May 23, 2025 16:08
@Mechanix97 Mechanix97 added this pull request to the merge queue May 23, 2025
Merged via the queue into main with commit 1cad47e May 23, 2025
20 checks passed
@Mechanix97 Mechanix97 deleted the feat/add-code-offset-by-capability branch May 23, 2025 16:21
pedrobergamini pushed a commit to pedrobergamini/ethrex that referenced this pull request Aug 24, 2025
**Motivation**

<!-- Why does this pull request exist? What are its goals? -->

The protocol capability offset was hardcoded within the msg code. 

**Description**

In order to decouple the msg code from the protocol offset, a const was
created with the len of the protocol.
<!-- A clear and concise general description of the changes this PR
introduces -->

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

[geth
reference](https://github.com/ethereum/go-ethereum/blob/20ad4f500e7fafab93f6d94fa171a5c0309de6ce/cmd/devp2p/internal/ethtest/protocol.go#L62)

Closes lambdaclass#2902
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client p2p Issues related to p2p network

Projects

None yet

Development

Successfully merging this pull request may close these issues.

L1: add capability offset constant to P2P messages

4 participants