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

Snap: Extension Rlp value index is 1 #7923

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Snap: Extension Rlp value index is 1 #7923

merged 1 commit into from
Dec 17, 2024

Conversation

benaadams
Copy link
Member

Changes

  • We use 0 in one place and 1 in another; leading to over work

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)

Testing

Requires testing

  • No

@@ -17,6 +17,8 @@ namespace Nethermind.Synchronization.SnapSync
{
public static class SnapProviderHelper
{
private const int ExtensionRlpChildIndex = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldnt it always be 0?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ow, no, sometimes its 1 its 0. That can't be good.

Copy link
Member Author

Choose a reason for hiding this comment

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

Some methods add 1 if extension (converting 0 -> 1); is second element in rlp for extension (first being key); these methods doesn't add one

@benaadams benaadams merged commit 2429d7a into master Dec 17, 2024
79 checks passed
@benaadams benaadams deleted the snap branch December 17, 2024 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants