Skip to content

Commit eae9114

Browse files
stevennevinsypatil12steven8sunyuan0x0aa0
authored
feat: ecdsa basic registry (#194)
* 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) * feat: basic ecdsa registry * feat(ecdsa): shared test setup * feat: add events to weight updates * chore: add to unaudited folder * fix: checkpoint threshold weight * chore: organize code * feat: add variants of the ECDSAStakeRegistry * chore: prettier formatting * chore: organize * chore: rename stakeQuorum -> quorum * fix: comment * fix: typo * chore: clarify comment * fix: clarify stake threshold comment * test: add test cases for updates in fixed stake case * chore: resolve conflict with eigenlayer core * chore: add missing natspec * chore: cleanup * test: split out equal weight tests * refactor: separate out setup boilerplate from test contract * test: add regression case * fix: add event to update minimum weight * test: update an unregistered operator * chore: use arrayified getOperatorShares * test: add duplicate test in check signatures * test: permissioned registry unit tests * fix: update behavior for revoking an operator * fix: add error for invariant that signedWeight cant exceed totalWeight * feat: enforce invariant that operator weights must be updated when making configuration changes * fix: update operators must happen after the config update * perf(gas): only update total weight once when updating an array of operators * fix(wip): add bps check for threshold * refactor: logic into internal functions and add events * fix: revert back to previous threshold stake calculation * feat: make interface compatible with avs sync * perf: remove pausable * fix: improve clarity for bps usage in threshold weight * test(gas): add gas test for checkSignatures * perf(benchmark): update to use 30 operators * perf(gas): short circuit return before pushing a new checkpoint * chore: nits * docs(natspec): add missing documentation * fix: fix updateOperators * docs: add comment for check in _updateOperators * fix: remove redundant logic * docs: cleanup quorum related comments * docs: update stake threshold description * docs: update readme to indicate unaudited status * fix: typo * fix: formatting * docs: consistent disclaimer --------- 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]>
1 parent 48e0aec commit eae9114

9 files changed

+1576
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.12;
3+
4+
import {IStrategy} from "eigenlayer-contracts/src/contracts/interfaces/IStrategy.sol";
5+
6+
struct StrategyParams {
7+
IStrategy strategy; // The strategy contract reference
8+
uint96 multiplier; // The multiplier applied to the strategy
9+
}
10+
11+
struct Quorum {
12+
StrategyParams[] strategies; // An array of strategy parameters to define the quorum
13+
}
14+
15+
interface ECDSAStakeRegistryEventsAndErrors {
16+
/// @notice Emitted when the system registers an operator
17+
/// @param _operator The address of the registered operator
18+
/// @param _avs The address of the associated AVS
19+
event OperatorRegistered(address indexed _operator, address indexed _avs);
20+
21+
/// @notice Emitted when the system deregisters an operator
22+
/// @param _operator The address of the deregistered operator
23+
/// @param _avs The address of the associated AVS
24+
event OperatorDeregistered(address indexed _operator, address indexed _avs);
25+
26+
/// @notice Emitted when the system updates the quorum
27+
/// @param _old The previous quorum configuration
28+
/// @param _new The new quorum configuration
29+
event QuorumUpdated(Quorum _old, Quorum _new);
30+
31+
/// @notice Emitted when the weight to join the operator set updates
32+
/// @param _old The previous minimum weight
33+
/// @param _new The new minimumWeight
34+
event MinimumWeightUpdated(uint256 _old, uint256 _new);
35+
36+
/// @notice Emitted when the weight required to be an operator changes
37+
/// @param oldMinimumWeight The previous weight
38+
/// @param newMinimumWeight The updated weight
39+
event UpdateMinimumWeight(uint256 oldMinimumWeight, uint256 newMinimumWeight);
40+
41+
/// @notice Emitted when the system updates an operator's weight
42+
/// @param _operator The address of the operator updated
43+
/// @param oldWeight The operator's weight before the update
44+
/// @param newWeight The operator's weight after the update
45+
event OperatorWeightUpdated(address indexed _operator, uint256 oldWeight, uint256 newWeight);
46+
47+
/// @notice Emitted when the system updates the total weight
48+
/// @param oldTotalWeight The total weight before the update
49+
/// @param newTotalWeight The total weight after the update
50+
event TotalWeightUpdated(uint256 oldTotalWeight, uint256 newTotalWeight);
51+
52+
/// @notice Emits when setting a new threshold weight.
53+
event ThresholdWeightUpdated(uint256 _thresholdWeight);
54+
55+
/// @notice Indicates when the lengths of the signers array and signatures array do not match.
56+
error LengthMismatch();
57+
58+
/// @notice Indicates encountering an invalid length for the signers or signatures array.
59+
error InvalidLength();
60+
61+
/// @notice Indicates encountering an invalid signature.
62+
error InvalidSignature();
63+
64+
/// @notice Thrown when the threshold update is greater than BPS
65+
error InvalidThreshold();
66+
67+
/// @notice Thrown when missing operators in an update
68+
error MustUpdateAllOperators();
69+
70+
/// @notice Indicates operator weights were out of sync and the signed weight exceed the total
71+
error InvalidSignedWeight();
72+
73+
/// @notice Indicates the total signed stake fails to meet the required threshold.
74+
error InsufficientSignedStake();
75+
76+
/// @notice Indicates an individual signer's weight fails to meet the required threshold.
77+
error InsufficientWeight();
78+
79+
/// @notice Indicates the quorum is invalid
80+
error InvalidQuorum();
81+
82+
/// @notice Indicates the system finds a list of items unsorted
83+
error NotSorted();
84+
85+
/// @notice Thrown when registering an already registered operator
86+
error OperatorAlreadyRegistered();
87+
88+
/// @notice Thrown when de-registering or updating the stake for an unregisted operator
89+
error OperatorNotRegistered();
90+
}

0 commit comments

Comments
 (0)