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

In get_custody_groups, don't skip 0 value #4070

Merged
merged 1 commit into from
Dec 29, 2024

Conversation

jtraglia
Copy link
Member

This PR does the following:

  • If there's an overflow, don't skip the zero value.
    • Previously this would set it to zero THEN increment.
    • Instead we should set to zero OR increment.
  • Use more strict type annotations for explicit clarity.
  • Remove unnecessary uint256 cast.
  • When there's an overflow, cast zero to uint256 not NodeID.

Thanks to @tersec for pointing this out on Discord.

is it intentional that https://github.com/ethereum/consensus-specs/blob/dev/specs/fulu/das-core.md#get_custody_groups in the name of "Overflow prevention" skips the zero NodeID? That's not just overflow protection, that's conceptually, the NodeID sequence it iterates through is 115792089237316195423570985008687907853269984665640564039457584007913129639934, 115792089237316195423570985008687907853269984665640564039457584007913129639935, not 0, 1, 2, ...

@jtraglia jtraglia added the Fulu label Dec 28, 2024
Copy link
Member

@ppopth ppopth left a comment

Choose a reason for hiding this comment

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

LGTM

@jtraglia jtraglia merged commit 8696fbf into ethereum:dev Dec 29, 2024
23 checks passed
@jtraglia jtraglia deleted the allow-zero-id branch December 29, 2024 14:03
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.

2 participants