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

Fix eth message ID length bug #5666

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

emhane
Copy link
Member

@emhane emhane commented Dec 2, 2023

regardless of how many messages are used in an eth version, the message ID for receipts doesn't change. 17 values are needed to cover the eth message ID range 0x00 - 0x10. previously the number of messages used for a version has been used. this will result in bugs calculating offset when eth is preceded by another cap in the message id.

this pr is a product of #5577 and is a subtask of #791.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

Ah okay I understand this.

we we're previously assuming the total number of message ids determine the offset, but it's how many message ids does the capability need instead.

since Receipts is the highest (supported by all versions) its Receipts.id + 1

nice find.

only doc nit

crates/net/eth-wire/src/types/message.rs Show resolved Hide resolved
@mattsse mattsse added the C-bug An unexpected or incorrect behavior label Dec 4, 2023
@emhane
Copy link
Member Author

emhane commented Dec 4, 2023

Ah okay I understand this.

we we're previously assuming the total number of message ids determine the offset, but it's how many message ids does the capability need instead.

since Receipts is the highest (supported by all versions) its Receipts.id + 1

nice find.

only doc nit

thanks @mattsse :)

@mattsse mattsse enabled auto-merge December 4, 2023 15:52
@mattsse mattsse added this pull request to the merge queue Dec 4, 2023
Merged via the queue into paradigmxyz:main with commit f15e878 Dec 4, 2023
@emhane emhane deleted the const-eth-message-offset branch December 4, 2023 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants