-
Notifications
You must be signed in to change notification settings - Fork 114
Feat: generate parameters for checkSignatures by referencing OperatorStateRetriever on-chain #461
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
d4fff29
feat: getNonSignerStakesAndSignature
rubydusa f1186b6
chore: add BN256G2
rubydusa 55ef0ed
refactor: BN256G2 ^0.4.24 -> ^0.8.27
rubydusa 595b824
fix: compute g2 apk
rubydusa b322318
test: inital test of getNonSignerStakesAndSignature
hudsonhrh d050b75
test: getNonSignerStakesAndSignature tests now use real G2 points
hudsonhrh cd0de93
test: added tests for diffferent revert scenariois
hudsonhrh 89aac24
fix: _makeG2Point comments
rubydusa f65636d
chore: use G2 coordinates from BN254
rubydusa 1bb0c3f
fix: compute quorum APKs by timestamp
rubydusa 22b355a
refactor: safe gaurd against invalid sigmas
rubydusa 22810cd
test: getNonSignerStakesAndSignature changing Quorum set
rubydusa 973e278
fix: convert blockNumber to uint32
rubydusa 2d7c073
chore: clarify operatorIds -> signingOperatorIds
rubydusa f310f09
Merge branch 'latest-dev' into on-chain-check-signatures
rubydusa 76ffef7
chore: delete non-sensical no signers test
rubydusa e758ffa
chore: add natspec to new functions in OperatorStateRetriever
rubydusa 021d32c
docs: fix capitalization of comments and natspec for getNonSignerStak…
bagelface a294309
revert comment changes
hudsonhrh e0bd81f
Update isOnCurve function as pure
c3e1ba1
docs: fix "getNonSignerStakesAndSignature" natspec comment
diterra-code 4f6b395
fix: formatting
cathschmidt beffb0b
fix: clean up
Astodialo 59a4b02
Merge branch 'dev' of https://github.com/Layr-Labs/eigenlayer-middlew…
rubydusa 463166c
fix: type in `_computeG1APK` natspec
rubydusa 0530e77
fix: incorrect curve equation in doc comment
rubydusa 2899e89
fix: typo
rubydusa 235a7d1
chore: add comment on g2 apk loop
rubydusa b07ad3a
Merge branch 'dev' into on-chain-check-signatures
RonTuretzky ff9b6b9
chore: explain `InvalidSigma()`
rubydusa dd8aaff
chore: add @dev comment about sigma
rubydusa 1e57364
fix: check for correctness of indices and pubkeys in tests
rubydusa 32c57d9
chore: forge fmt for CI
rubydusa 3cf04f3
refactor: moving lib
RonTuretzky 76a8c5c
chore: modularize bls operator state retriever
ypatil12 2230a52
chore: format
ypatil12 28c3384
chore: clenanup RPCs
ypatil12 bae50c0
chore: revert naming
ypatil12 84fb838
Merge pull request #460 from BreadchainCoop/on-chain-check-signatures
ypatil12 9907543
refactor: move `_isOnCurve` to a library
rubydusa e6adbaa
fix: check that operators' bitmaps interesect with quorum numbers
rubydusa 1cc5c63
chore: remove unecessary first for loop
rubydusa a4801d7
chore: `forge fmt`
rubydusa 2f11818
Merge pull request #469 from BreadchainCoop/on-chain-check-signatures
ypatil12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // SPDX-License-Identifier: BUSL-1.1 | ||
| pragma solidity ^0.8.12; | ||
|
|
||
| import {BN254} from "../libraries/BN254.sol"; | ||
|
|
||
| /** | ||
| * @title ECUtils | ||
| * @notice Library containing utility functions for elliptic curve operations | ||
| */ | ||
| library ECUtils { | ||
| /** | ||
| * @notice Checks if a point lies on the BN254 elliptic curve | ||
| * @dev The curve equation is y^2 = x^3 + 3 (mod p) | ||
| * @param p The point to check, in G1 | ||
| * @return true if the point lies on the curve, false otherwise | ||
| */ | ||
| function isOnCurve( | ||
| BN254.G1Point memory p | ||
| ) internal pure returns (bool) { | ||
| uint256 y2 = mulmod(p.Y, p.Y, BN254.FP_MODULUS); | ||
| uint256 x2 = mulmod(p.X, p.X, BN254.FP_MODULUS); | ||
| uint256 x3 = mulmod(p.X, x2, BN254.FP_MODULUS); | ||
| uint256 rhs = addmod(x3, 3, BN254.FP_MODULUS); | ||
| return y2 == rhs; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
should be part of the BN254.sol library? or was this done due to lack of audit?
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.
Lack of audit, didn't want to change BN254