-
Notifications
You must be signed in to change notification settings - Fork 261
fix: bls bytes verification #1600
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
base: feat/3.0.0-phase-2
Are you sure you want to change the base?
Conversation
Hardhat Unit Tests Coverage SummaryDetailsDiff against masterResults for commit: a70087d Minimum allowed coverage is ♻️ This comment has been updated with latest results |
TheDZhon
left a comment
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.
👀
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.
Pull request overview
This PR fixes a critical security issue by ensuring that on-chain BLS verification matches the consensus layer (CL) BLS verification. It adds validation of compression flag bits in BLS public keys and signatures against user-provided Y components, preventing potential bypasses where invalid compressed representations could pass on-chain verification but fail CL verification.
Key changes:
- Adds compression flag validation logic to verify that compressed BLS components match their provided Y coordinates
- Introduces new error types for invalid compression flags and sign bits
- Adds comprehensive test coverage for various bit manipulation scenarios
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 19 comments.
| File | Description |
|---|---|
| contracts/common/lib/BLS.sol | Implements compression flag validation functions and integrates them into the deposit signature verification process |
| lib/pdg.ts | Adds test helper utilities to manipulate compression flags in BLS components and verify the validation logic |
| test/0.8.25/vaults/predepositGuarantee/predepositGuarantee.test.ts | Adds comprehensive test cases covering all compression flag manipulation scenarios (100 iterations each) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
test/0.8.25/vaults/predepositGuarantee/predepositGuarantee.test.ts
Outdated
Show resolved
Hide resolved
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.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
test/0.8.25/vaults/predepositGuarantee/predepositGuarantee.test.ts
Outdated
Show resolved
Hide resolved
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.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
…hardening Fix/bls bytes verification hardening
tamtamchik
left a comment
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.
👏
Context
Problem
Restores invariant where on-chain BLS check must be complete to CL BLS check
Solution
Verify compression flag bits in pubkey and signature againts user provided Y components