Skip to content
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

feat: ecdsa basic registry #194

Merged
merged 73 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
cb10d60
update: change core submodule branch
ypatil12 Jan 26, 2024
a5a2499
fix: make commit hook executable again (#160)
stevennevins Jan 30, 2024
23dbbf7
ci: add ci to run on PRs to m2-mainnet-fixes (#159)
stevennevins Jan 30, 2024
5c55896
refactor: update minWithdrawalDelayBLocks variable (#152)
8sunyuan Jan 30, 2024
00e3f14
fix: churner (#157)
0x0aa0 Jan 30, 2024
cc086d3
fix: submodule (#164)
0x0aa0 Jan 30, 2024
1807458
test: fix flaky tests by removing bogosort (#163)
wadealexc Jan 31, 2024
6e51369
chore: storage gaps and nits (#155)
stevennevins Jan 31, 2024
4e41195
chore: eigenlayer-contracts (#168)
0x0aa0 Feb 1, 2024
32afa68
test/refactor: gas scenarios for updateOperators (#170)
8sunyuan Feb 6, 2024
7c93107
chore: less restrictive license for library code (#177)
ChaoticWalrus Feb 9, 2024
2262079
docs: update README to point at deployment info (#178)
wadealexc Feb 9, 2024
f304468
feat: minor gas optimization (#183)
ChaoticWalrus Feb 13, 2024
30e2e15
fix: include missing fields in TYPEHASH defintion (#182)
ChaoticWalrus Feb 13, 2024
ba6aa51
docs: fix grammer and inaccurate naming (#179)
wadealexc Feb 13, 2024
9fa87d6
fix: prevent use of current block as reference block number (#181)
wadealexc Feb 13, 2024
6f76a76
chore: clean up loops to iterate downward and remove unneeded checks …
wadealexc Feb 13, 2024
9401286
docs: clarify usage of msgHash (#184)
wadealexc Feb 13, 2024
6421ba6
feat: basic ecdsa registry
Feb 13, 2024
33f8947
feat(ecdsa): shared test setup
Feb 14, 2024
e834ad2
feat: add events to weight updates
Feb 15, 2024
d06e593
chore: add to unaudited folder
Feb 15, 2024
6f899e9
fix: checkpoint threshold weight
Feb 16, 2024
847f1d7
chore: organize code
Feb 16, 2024
e978a11
feat: add variants of the ECDSAStakeRegistry
Feb 16, 2024
bf3381b
chore: prettier formatting
Feb 16, 2024
733120e
chore: organize
Feb 16, 2024
1e67298
chore: rename stakeQuorum -> quorum
Feb 16, 2024
3cce973
fix: comment
Feb 16, 2024
31f45db
fix: typo
Feb 16, 2024
24fad96
chore: clarify comment
Feb 16, 2024
75844b4
fix: clarify stake threshold comment
Feb 16, 2024
099af5c
test: add test cases for updates in fixed stake case
Feb 22, 2024
2387e94
chore: merge dev
Feb 26, 2024
5d3b7a4
chore: resolve conflict with eigenlayer core
Feb 26, 2024
91fd2e3
Merge branch 'dev' into feat/ecdsa-basic
Feb 27, 2024
31a4804
chore: add missing natspec
Feb 27, 2024
1c44de6
chore: cleanup
stevennevins Mar 4, 2024
0600e16
test: split out equal weight tests
stevennevins Mar 4, 2024
948538b
refactor: separate out setup boilerplate from test contract
stevennevins Mar 4, 2024
0be18cb
test: add regression case
stevennevins Mar 4, 2024
842b403
fix: add event to update minimum weight
stevennevins Mar 4, 2024
18ffec9
test: update an unregistered operator
stevennevins Mar 4, 2024
0ba744a
Merge branch 'dev' into feat/ecdsa-basic
stevennevins Mar 5, 2024
33627dc
chore: use arrayified getOperatorShares
stevennevins Mar 8, 2024
55da82a
test: add duplicate test in check signatures
stevennevins Mar 8, 2024
cfd5a41
test: permissioned registry unit tests
stevennevins Mar 8, 2024
a72f7e9
fix: update behavior for revoking an operator
stevennevins Mar 8, 2024
8843c90
fix: add error for invariant that signedWeight cant exceed totalWeight
stevennevins Mar 8, 2024
f723e4f
feat: enforce invariant that operator weights must be updated when ma…
stevennevins Mar 8, 2024
97592a6
fix: update operators must happen after the config update
stevennevins Mar 8, 2024
fe6fda4
perf(gas): only update total weight once when updating an array of op…
stevennevins Mar 8, 2024
38ea16a
fix(wip): add bps check for threshold
stevennevins Mar 11, 2024
a513621
refactor: logic into internal functions and add events
stevennevins Mar 11, 2024
3be0cb8
fix: revert back to previous threshold stake calculation
stevennevins Mar 11, 2024
6528c76
feat: make interface compatible with avs sync
stevennevins Mar 11, 2024
17f12ce
perf: remove pausable
stevennevins Mar 11, 2024
e360e91
fix: improve clarity for bps usage in threshold weight
stevennevins Mar 12, 2024
1cee48d
test(gas): add gas test for checkSignatures
stevennevins Mar 12, 2024
f7963a1
perf(benchmark): update to use 30 operators
stevennevins Mar 12, 2024
bada3d4
perf(gas): short circuit return before pushing a new checkpoint
stevennevins Mar 12, 2024
6a40e8b
chore: nits
stevennevins Mar 13, 2024
2728ac0
docs(natspec): add missing documentation
stevennevins Mar 13, 2024
a076cb9
fix: fix updateOperators
stevennevins Mar 13, 2024
88550e0
docs: add comment for check in _updateOperators
stevennevins Mar 19, 2024
79d95aa
fix: remove redundant logic
stevennevins Mar 19, 2024
b513d6a
docs: cleanup quorum related comments
stevennevins Mar 19, 2024
8c91ee7
docs: update stake threshold description
stevennevins Mar 19, 2024
6f4bb09
Merge branch 'dev' into feat/ecdsa-basic
stevennevins Mar 20, 2024
9607372
docs: update readme to indicate unaudited status
stevennevins Mar 20, 2024
ebfd762
fix: typo
stevennevins Mar 20, 2024
9c2fb52
fix: formatting
stevennevins Mar 20, 2024
7d837d4
docs: consistent disclaimer
stevennevins Mar 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions src/interfaces/IECDSAStakeRegistryEventsAndErrors.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

import {IStrategy} from "eigenlayer-contracts/src/contracts/interfaces/IStrategy.sol";

struct StrategyParams {
IStrategy strategy; // The strategy contract reference
uint96 multiplier; // The multiplier applied to the strategy
}

struct Quorum {
StrategyParams[] strategies; // An array of strategy parameters to define the quorum
}

interface ECDSAStakeRegistryEventsAndErrors {
/// @notice Emitted when the system registers an operator
/// @param _operator The address of the registered operator
/// @param _avs The address of the associated AVS
event OperatorRegistered(address indexed _operator, address indexed _avs);

/// @notice Emitted when the system deregisters an operator
/// @param _operator The address of the deregistered operator
/// @param _avs The address of the associated AVS
event OperatorDeregistered(address indexed _operator, address indexed _avs);

/// @notice Emitted when the system updates the quorum
/// @param _old The previous quorum configuration
/// @param _new The new quorum configuration
event QuorumUpdated(Quorum _old, Quorum _new);

/// @notice Emitted when the weight to join the operator set updates
/// @param _old The previous minimum weight
/// @param _new The new minimumWeight
event MinimumWeightUpdated(uint256 _old, uint256 _new);

/// @notice Emitted when the weight required to be an operator changes
/// @param oldMinimumWeight The previous weight
/// @param newMinimumWeight The updated weight
event UpdateMinimumWeight(uint256 oldMinimumWeight, uint256 newMinimumWeight);

/// @notice Emitted when the system updates an operator's weight
/// @param _operator The address of the operator updated
/// @param oldWeight The operator's weight before the update
/// @param newWeight The operator's weight after the update
event OperatorWeightUpdated(address indexed _operator, uint256 oldWeight, uint256 newWeight);

/// @notice Emitted when the system updates the total weight
/// @param oldTotalWeight The total weight before the update
/// @param newTotalWeight The total weight after the update
event TotalWeightUpdated(uint256 oldTotalWeight, uint256 newTotalWeight);

/// @notice Emits when setting a new threshold weight.
event ThresholdWeightUpdated(uint256 _thresholdWeight);

/// @notice Indicates when the lengths of the signers array and signatures array do not match.
error LengthMismatch();

/// @notice Indicates encountering an invalid length for the signers or signatures array.
error InvalidLength();

/// @notice Indicates encountering an invalid signature.
error InvalidSignature();

/// @notice Thrown when the threshold update is greater than BPS
error InvalidThreshold();

/// @notice Thrown when missing operators in an update
error MustUpdateAllOperators();

/// @notice Indicates operator weights were out of sync and the signed weight exceed the total
error InvalidSignedWeight();

/// @notice Indicates the total signed stake fails to meet the required threshold.
error InsufficientSignedStake();

/// @notice Indicates an individual signer's weight fails to meet the required threshold.
error InsufficientWeight();

/// @notice Indicates the quorum is invalid
error InvalidQuorum();

/// @notice Indicates the system finds a list of items unsorted
error NotSorted();

/// @notice Thrown when registering an already registered operator
error OperatorAlreadyRegistered();

/// @notice Thrown when de-registering or updating the stake for an unregisted operator
error OperatorNotRegistered();
}
Loading
Loading