You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fixes(m2-mainnet): combined pr for all m2-mainnet fixs (#162)
* update: change core submodule branch
* fix: make commit hook executable again (#160)
Co-authored-by: steven <[email protected]>
* ci: add ci to run on PRs to m2-mainnet-fixes (#159)
Co-authored-by: steven <[email protected]>
* refactor: update minWithdrawalDelayBLocks variable (#152)
* refactor: minWithdrawalDelayBLocks from core
* fix: core contracts commit and tests
* feat: add avs directory to service manager
* fix: rebase off updated bls sig checker; update integration tests
* Add AVS Directory Support to Service Manager (#156)
* update: change core submodule branch
* feat: add avs directory to service manager
* fix: rebase off updated bls sig checker; update integration tests
* fix: core contracts commit and tests
* feat: add avs directory to service manager
* fix: rebase off updated bls sig checker; update integration tests
* fix: conflicts
---------
Co-authored-by: 8sunyuan <[email protected]>
* fix: submodule commit
* fix: rebase changes
* Add AVS Directory Support to Service Manager (#156)
* update: change core submodule branch
* feat: add avs directory to service manager
* fix: rebase off updated bls sig checker; update integration tests
* fix: core contracts commit and tests
* feat: add avs directory to service manager
* fix: rebase off updated bls sig checker; update integration tests
* fix: conflicts
---------
Co-authored-by: 8sunyuan <[email protected]>
* fix: submodule commit
* fix: rebase changes
* Add AVS Directory Support to Service Manager (#156)
* update: change core submodule branch
* feat: add avs directory to service manager
* fix: rebase off updated bls sig checker; update integration tests
* fix: core contracts commit and tests
* feat: add avs directory to service manager
* fix: rebase off updated bls sig checker; update integration tests
* fix: conflicts
---------
Co-authored-by: 8sunyuan <[email protected]>
* fix: submodule commit
* docs: AVSRegistry -> AVSDirectory
---------
Co-authored-by: Yash Patil <[email protected]>
* fix: churner (#157)
* fix: submodule (#164)
* test: fix flaky tests by removing bogosort (#163)
* test: fix flaky tests by removing bogosort
* test: fix flaky test by rejecting empty addr inputs
* chore: storage gaps and nits (#155)
* chore: add storage gaps to BLSSignatureChecker and ServiceManagerBase
* chore: ServiceManagerBase to abstract and create mock
* chore: use onlyInitializing in Base and initializer in mock
* chore: add storage gaps to BLSSignatureChecker and ServiceManagerBase
* chore: ServiceManagerBase to abstract and create mock
* chore: use onlyInitializing in Base and initializer in mock
* fix: core submodules
---------
Co-authored-by: steven <[email protected]>
* chore: eigenlayer-contracts (#168)
* test/refactor: gas scenarios for updateOperators (#170)
* test: gas scenarios for updateOperators
* refactor: using one call for operatorShares
* test: updateOperators 200 operators
* test: gas scenarios for updateOperators
* refactor: using one call for operatorShares
* test: updateOperators 200 operators
* fix: comments
* chore: less restrictive license for library code (#177)
MIT instead of BSL-MIT mix
* docs: update README to point at deployment info (#178)
* feat: minor gas optimization (#183)
slightly less memory ops in `orderedBytesArrayToBitmap` fnc
* fix: include missing fields in TYPEHASH defintion (#182)
* fix: include missing fields in TYPEHASH defintion
the `salt` and `expiry` fields were missing from the `OPERATOR_CHURN_APPROVAL_TYPEHASH` def
* fix: correct definition of OperatorKickParam inside of typehash def
* docs: fix grammer and inaccurate naming (#179)
* fix: prevent use of current block as reference block number (#181)
* chore: clean up loops to iterate downward and remove unneeded checks (#180)
* chore: clean up loops to iterate downward and remove unneeded checks
* docs: clarifying comments around quorum existence checks
* docs: clarify usage of msgHash (#184)
---------
Co-authored-by: Yash Patil <[email protected]>
Co-authored-by: steven <[email protected]>
Co-authored-by: Michael Sun <[email protected]>
Co-authored-by: quaq <[email protected]>
Co-authored-by: Alex <[email protected]>
Co-authored-by: ChaoticWalrus <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+2-27Lines changed: 2 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,12 @@
5
5
6
6
EigenLayer is a set of smart contracts deployed on Ethereum that enable restaking of assets to secure new services called AVSs (actively validated services). The core contracts that enable these features can be found in the [`eigenlayer-contracts` repo][core-repo].
7
7
8
-
This repo contains smart contracts used to create an AVS that interacts with the EigenLayer core contracts.
8
+
This repo contains smart contracts used to create an AVS that interacts with the EigenLayer core contracts. Because these contracts are meant to be used by any AVS, there is no single deployment. However, you can see EigenDA's deployment info on our [docs site](https://docs.eigenlayer.xyz/eigenda/deployed-contracts).
9
9
10
10
## Getting Started
11
11
12
12
*[Documentation](#documentation)
13
13
*[Building and Running Tests](#building-and-running-tests)
14
-
*[Deployments](#deployments)
15
14
16
15
## Documentation
17
16
@@ -39,28 +38,4 @@ foundryup
39
38
40
39
forge build
41
40
forge test
42
-
```
43
-
44
-
## Deployments
45
-
46
-
The contracts in this repo are meant to be deployed by each AVS that wants to use them. The addresses listed below refer to EigenDA's deployment, and are included as an example.
47
-
48
-
### Current Mainnet Deployment
49
-
50
-
No contracts have been deployed to mainnet yet.
51
-
52
-
### Current Testnet Deployment
53
-
54
-
The current testnet deployment is from our M2 beta release, which is a slightly older version of this repo. You can view the deployed contract addresses below, or check out the [`v0.1.0`](https://github.com/Layr-Labs/eigenlayer-middleware/tree/v0.1.0-m2-goerli) branch in "Releases".
Copy file name to clipboardExpand all lines: docs/BLSSignatureChecker.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,7 @@ struct QuorumStakeTotals {
62
62
The goal of this method is to allow an AVS to validate a BLS signature formed from the aggregate pubkey ("apk") of Operators registered in one or more quorums at some `referenceBlockNumber`.
63
63
64
64
Some notes on method parameters:
65
+
*`msgHash` is the hash being signed by the apk. Note that the caller is responsible for ensuring `msgHash` is a hash! If someone can provide arbitrary input, it may be possible to tamper with signature verification.
65
66
*`referenceBlockNumber` is the reason each registry contract keeps historical states: so that lookups can be performed on each registry's info at a particular block. This is important because Operators may sign some data on behalf of an AVS, then deregister from one or more of the AVS's quorums. Historical states allow signature validation to be performed against a "fixed point" in AVS/quorum history.
66
67
*`quorumNumbers` is used to perform signature validation across one *or more* quorums. Also, Operators may be registered for more than one quorum - and for each quorum an Operator is registered for, that Operator's pubkey is included in that quorum's apk within the `BLSApkRegistry`. This means that, when calculating an apk across multiple `quorumNumbers`, Operators registered for more than one of these quorums will have their pubkey included more than once in the total apk.
67
68
*`params` contains both a signature from all signing Operators, as well as several fields that identify registered, non-signing Operators. While non-signing Operators haven't contributed to the signature, but need to be accounted for because, as Operators registered for one or more signing quorums, their public keys are included in that quorum's apk. Essentially, in order to validate the signature, nonsigners' public keys need to be subtracted out from the total apk to derive the apk that actually signed the message.
@@ -87,11 +88,11 @@ This method performs the following steps. Note that each step involves lookups o
87
88
* Input validation:
88
89
* Quorum-related fields MUST have equal lengths: `quorumNumbers`, `params.quorumApks`, `params.quorumApkIndices`, `params.totalStakeIndices`, `params.nonSignerStakeIndices`
89
90
* Nonsigner-related fields MUST have equal lengths: `params.nonSignerPubkeys`, `params.nonSignerQuorumBitmapIndices`
90
-
*`referenceBlockNumber` MUST NOT be greater than `block.number`
91
+
*`referenceBlockNumber` MUST be less than `block.number`
91
92
*`quorumNumbers` MUST be an ordered list of valid, initialized quorums
92
93
*`params.nonSignerPubkeys` MUST ONLY contain unique pubkeys, in ascending order of their pubkey hash
93
94
* For each quorum:
94
-
* If stale stakes are forbidden (see [`BLSSignatureChecker.setStaleStakesForbidden`](#blssignaturecheckersetstalestakesforbidden)), check the last `quorumUpdateBlockNumber` is within `DelegationManager.withdrawalDelayBlocks` of `referenceBlockNumber`. This references a value in the EigenLayer core contracts - see [EigenLayer core docs][core-docs-m2] for more info.
95
+
* If stale stakes are forbidden (see [`BLSSignatureChecker.setStaleStakesForbidden`](#blssignaturecheckersetstalestakesforbidden)), check the last `quorumUpdateBlockNumber` is within `DelegationManager.minWithdrawalDelayBlocks` of `referenceBlockNumber`. This references a value in the EigenLayer core contracts - see [EigenLayer core docs][core-docs-m2] for more info.
95
96
* Validate that each `params.quorumApks` corresponds to the quorum's apk at the `referenceBlockNumber`
96
97
* For each historical state lookup, the `referenceBlockNumber` and provided index MUST point to a valid historical entry:
97
98
*`referenceBlockNumber` MUST come after the entry's `updateBlockNumber`
Copy file name to clipboardExpand all lines: docs/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,8 +97,8 @@ These histories are used by offchain code to query state at particular blocks, a
97
97
##### Hooking Into EigenLayer Core
98
98
99
99
The main thing that links an AVS to the EigenLayer core contracts is that when EigenLayer Operators register/deregister with an AVS, the AVS calls these functions in EigenLayer core:
These methods ensure that the Operator registering with the AVS is also registered as an Operator in EigenLayer core. In this repo, these methods are called by the `ServiceManagerBase`.
Copy file name to clipboardExpand all lines: src/BLSSignatureChecker.sol
+10-3Lines changed: 10 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ contract BLSSignatureChecker is IBLSSignatureChecker {
46
46
47
47
/**
48
48
* RegistryCoordinator owner can either enforce or not that operator stakes are staler
49
-
* than the delegation.withdrawalDelayBlocks() window.
49
+
* than the delegation.minWithdrawalDelayBlocks() window.
50
50
* @param value to toggle staleStakesForbidden
51
51
*/
52
52
function setStaleStakesForbidden(boolvalue) external onlyCoordinatorOwner {
@@ -75,6 +75,9 @@ contract BLSSignatureChecker is IBLSSignatureChecker {
75
75
* is correct, i.e., ensure that the stake returned from the specified block number is recent enough and that the stake is either the most recent update
76
76
* for the total stake (of the operator) or latest before the referenceBlockNumber.
77
77
* @param msgHash is the hash being signed
78
+
* @dev NOTE: Be careful to ensure `msgHash` is collision-resistant! This method does not hash
79
+
* `msgHash` in any way, so if an attacker is able to pass in an arbitrary value, they may be able
80
+
* to tamper with signature verification.
78
81
* @param quorumNumbers is the bytes array of quorum numbers that are being signed for
79
82
* @param referenceBlockNumber is the block number at which the stake information is being verified
80
83
* @param params is the struct containing information on nonsigners, stakes, quorum apks, and the aggregate signature
@@ -109,7 +112,7 @@ contract BLSSignatureChecker is IBLSSignatureChecker {
0 commit comments