-
Notifications
You must be signed in to change notification settings - Fork 1k
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: blob sidecar validation to ensure KZG commitment count matches #14752
base: develop
Are you sure you want to change the base?
Conversation
} | ||
|
||
// Check if we have all required blob sidecars | ||
if kzgCommitments > 0 && availableSidecars < kzgCommitments { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it make sense to check availableSidecars != kzgCommitments
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it make sense to check
availableSidecars != kzgCommitments
instead
Hey Terence, you're absolutely right, therefore I made an update @terencechain
This PR fails to build. Please fix |
What type of PR is this?
Bug fix
What does this PR do? Why is it needed?
This PR adds validation to ensure that the number of available blob sidecars matches the number of KZG commitments in the block before responding to BlobSidecarsByRange requests. This prevents Prysm nodes from serving an incorrect number of blob sidecars that don't match the block's KZG commitment count.
The changes include:
This fix ensures compliance with the P2P specification rule that states: "Clients MUST include all blob sidecars of each block from which they include blob sidecars."
Which issues(s) does this PR fix?
Fixes #14674
Other notes for review
The implementation adds minimal overhead as it only performs counting operations on existing data structures. The error handling follows existing patterns in the codebase.
Acknowledgements