Skip to content

fix(p2p): avoid 32-bit overflow in attestation pool block position key#22412

Open
spypsy wants to merge 1 commit intomerge-train/spartanfrom
spy/a-760-attestation-pool-bit-shift-overflow
Open

fix(p2p): avoid 32-bit overflow in attestation pool block position key#22412
spypsy wants to merge 1 commit intomerge-train/spartanfrom
spy/a-760-attestation-pool-bit-shift-overflow

Conversation

@spypsy
Copy link
Copy Markdown
Member

@spypsy spypsy commented Apr 8, 2026

Summary

  • Replace bit-shift (<<) with multiplication in AttestationPool.getBlockPositionKey to prevent 32-bit signed integer overflow on large slot numbers. JavaScript's << converts operands to signed 32-bit ints, which overflows after slot ~2^21. Using multiplication keeps values in float64 range (safe up to 2^53).

Fixes A-760

Replace bit-shift with multiplication in getBlockPositionKey to prevent
32-bit signed integer overflow on large slot numbers.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant