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: Centralize code encoding for P2P Messages #1034

Open
fkrause98 opened this issue Oct 31, 2024 · 0 comments
Open

(refactor) L1: Centralize code encoding for P2P Messages #1034

fkrause98 opened this issue Oct 31, 2024 · 0 comments

Comments

@fkrause98
Copy link
Contributor

fkrause98 commented Oct 31, 2024

When sending a P2P message to another node, a simple but easily missable step is that besides encoding the data for the message itself,
you need to also encode the code assigned to the message. For example, the P2P message "getAccountRange", has code 0x21, which needs to be encoded alongside the data it sends. Currently, this code encoding is done a bit 'manually', like in this example.
It would be better to have a centralized way (a function plus a match, maybe) to add said codes when encoding the messages, or maybe add it to the RLPxEncode trait itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants