Skip to content

Commit b4fa900

Browse files
authored
feat: partial withdrawal batching (#515)
* feat: implement pepe * move state into Storage contract * remove withdrawal proof method * feat: poc for partial withdrawal batching * feat: remove beaconChainOracle in favor of 4788 * modify verifyStaleBalance to use plural form * add pause flags for new methods * deprecate old state variables * minor cleanup and commenting * chore: get things compiling * i commented out/deleted a bajillion tests * fix: adjust storage footprint to be consistent with m2 * feat: adjust verifyStaleBalance to allow anyone to start a checkpoint * removes staleness concept from pod and manager state * clean: clean up start checkpoint logic * clean: remove comments * clean: remove outdated comment and rename proofs method * fix: remove unused variable and deprecate another * chore: rename lastFinalizedCheckpoint to lastCheckpointTimestamp * feat: add events for checkpoint creation and progression * feat: remove unneeded oracle interface from EigenPodManager * feat: remove unnecessary state root caching and add ValidatorWithdrawn event * feat: remove all use of the delayed withdrawal router (#524) * modify activateRestaking flow to use checkpointing * remove withdrawNonBeaconChainETHBalanceWei in favor of checkpointing * feat: remove staleness grace period * feat: add flag to startCheckpoint to prevent 0-balance checkpoints * chore: move currentCheckpoint to a public getter and update IEigenPod interface * chore: fix comment, update interfaces, add event * chore: clarify comment on activateRestaking * feat: skip validator if already checkpointed * fix: finish rebase * chore: make bindings * fix: swap inequality check to correctly skip duplicate proofs * chore: make bindings * test: modify integration test framework to support pepe (#563) * test: basic epoch processing * wip: balance proofs somewhat functional * test: flesh out beacon chain abi and test workflow * test: cleanup * test: add basic invariant checks for checkpoint proofs * test: add tests for full exits * feat: checkpoint proofs use balance container root * also refactors and cleans up BeaconChainProofs * more refactor/cleanup to come * chore: more proof library cleanup, removing unused constants * chore: additional cleanup and renaming of proof constants for consistency * chore: clean comments and reorganize constants * chore: remove delayedWithdrawalRouter from EigenPod * feat: adjust storage sizes for fields in checkpoint struct * feat: remove activateRestaking in favor of startCheckpoint (#577) * see PR comment for details * test: add proofgen test contract * fix: rename and add balance proof * feat: track balance exited for checkpoints * chore: deprecate deneb fork timestamp functions in EigenPodManager * test: fix existing integration tests * test: fix some unit tests and remove many outdated tests * test: start setting up new integration tests * fix: fixes two issues with verifyWC timing * verifyWC -> startCheckpoint in the same block no longer results in a bricked checkpoint * verifyWC using a timestamp older than the current checkpoint no longer allows you to submit a checkpoint proof for the new validator * chore: fix outdated comment * test: fleshed out eigenpod test flows * also reduced number of validators being generated by tests (for speed) * test: flesh out additional pod flows * chore: make bindings * test: add checks for several integration tests * fix: add additional pause condition for verifyStaleBalance * docs: add initial EigenPod docs * docs: clean and update EigenPodManager docs * chore: small wip to eigenpod docs and contract comment cleanup * chore: fix gas metering test to be consistent * also minor clarity tweak in verifyCheckpointProofs * test: eigenpod unit tests with checkpointing (#591) * test: testings init * test: eigenpod unit tests refactor * test: startCheckpoint unit tests * test: pod unit tests * fix: rebase changes * chore: make bindings * chore: revert pod changes * test: add several tests and checks --------- Co-authored-by: wadealexc <[email protected]> * chore: cleanup dwr and unused code (#593) * chore: cleanup dwr and unused code * chore: comment out pod specs * feat: remove staleness timing window * chore: update IEigenPod interface with updated comments * chore: fix bindings * test: finish verify start complete flow for pepe integration tests * chore: fix bindings * test: add slashing and native eth integration tests * build: partial withdrawal batching upgrade scripts (#598) * build: preprod pod upgrade scripts * chore: cleanup unused files * chore: add pepe deployment output * docs: finish main eigenpod docs and improve commenting * docs: finish main eigenpod docs * feat: remove hasRestaked and lastCheckpointTimestamp checks * test: add tests for constructor and initialize * test: fix mainnet fork tests and compiler warnings * docs: update diagrams for pepe * chore: upgrade preprod eigenpods (#611) * chore: upgrade preprod eigenpods * chore: remove unneeded logs * chore: deploy and update deployment addresses * feat: public block root getter (#612) * docs: update user flow diagrams to mention supported tokens * also increases resolution * feat: add proof submitter address (#629) * feat: add proof submitter address * test: add event emission test * docs: fix comments and add proof submitter to docs * chore: add sigma prime audit * feat: deploy new pods to holesky preprod * includes proofSubmitter address * feat: update PEPE events (#632) * feat: mock out new events for EigenPodManager * chore: make bindings * feat: remove unneeded event change and update tests * chore: make bindings * fix: final event versions * chore: upgrade preprod with new PEPE events * docs: update audit report * fix: reject credential proofs if activation epoch is not set (#668) * fix: reject credential proofs if activation epoch is not set * chore: make bindings * chore: fix formatting and borked config * fix: fix borked addresses in holesky config * chore: fix formatting again * chore: upgrade preprod with new credential check * chore: deploy pepe to holesky
1 parent 3b47ccf commit b4fa900

File tree

146 files changed

+10519
-13395
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+10519
-13395
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ You can view the deployed contract addresses below, or check out the code itself
183183
| -------- | -------- | -------- | -------- |
184184
| [`DelegationManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/core/DelegationManager.sol) | [`0xA44151489861Fe9e3055d95adC98FbD462B948e7`](https://holesky.etherscan.io/address/0xA44151489861Fe9e3055d95adC98FbD462B948e7) | [`0x83f8...0D76`](https://holesky.etherscan.io/address/0x83f8F8f0BB125F7870F6bfCf76853f874C330D76) | Proxy: [`[email protected]`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) |
185185
| [`StrategyManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/core/StrategyManager.sol) | [`0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6`](https://holesky.etherscan.io/address/0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6) | [`0x59f7...3a18`](https://holesky.etherscan.io/address/0x59f766A603C53f3AC8Be43bBe158c1519b193a18) | Proxy: [`[email protected]`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) |
186-
| [`EigenPodManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/pods/EigenPodManager.sol) | [`0x30770d7E3e71112d7A6b7259542D1f680a70e315`](https://holesky.etherscan.io/address/0x30770d7E3e71112d7A6b7259542D1f680a70e315) | [`0x5265...4a7B`](https://holesky.etherscan.io/address/0x5265C162f7d5F3fE3175a78828ab16bf5E324a7B) | Proxy: [`[email protected]`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) |
186+
| [`EigenPodManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/pods/EigenPodManager.sol) | [`0x30770d7E3e71112d7A6b7259542D1f680a70e315`](https://holesky.etherscan.io/address/0x30770d7E3e71112d7A6b7259542D1f680a70e315) | [`0x91A6...CCc5`](https://holesky.etherscan.io/address/0x91A6525a4a843F5a5B633905300c33F79413CCc5) | Proxy: [`[email protected]`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) |
187187
| [`AVSDirectory`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/core/AVSDirectory.sol) | [`0x055733000064333CaDDbC92763c58BF0192fFeBf`](https://holesky.etherscan.io/address/0x055733000064333CaDDbC92763c58BF0192fFeBf) | [`0xEF5B...3e3a`](https://holesky.etherscan.io/address/0xEF5BA995Bc7722fd1e163edF8Dc09375de3d3e3a) | Proxy: [`[email protected]`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) |
188188
| [`Slasher`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/core/Slasher.sol) | [`0xcAe751b75833ef09627549868A04E32679386e7C`](https://holesky.etherscan.io/address/0xcAe751b75833ef09627549868A04E32679386e7C) | [`0x9971...345A`](https://holesky.etherscan.io/address/0x99715D255E34a39bE9943b82F281CA734bcF345A) | Proxy: [`[email protected]`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) |
189-
| [`RewardsCoordinator`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/core/RewardsCoordinator.sol) | [`0xAcc1fb458a1317E886dB376Fc8141540537E68fE`](https://holesky.etherscan.io/address/0xAcc1fb458a1317E886dB376Fc8141540537E68fE) | [`0x123C...3D02`](https://holesky.etherscan.io/address/0x123C1A3543DBCA3f704E703dDda7FAAaA8e43D02) | Proxy: [`[email protected]`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) |
189+
| [`RewardsCoordinator`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/core/RewardsCoordinator.sol) | [`0xAcc1fb458a1317E886dB376Fc8141540537E68fE`](https://holesky.etherscan.io/address/0xAcc1fb458a1317E886dB376Fc8141540537E68fE) | [`0xe546...7f97`](https://holesky.etherscan.io/address/0xe54625095656206AC1B42819875343453c447f97) | Proxy: [`[email protected]`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) |
190190

191191
###### Strategies
192192

@@ -227,9 +227,8 @@ The following strategies differ significantly from the other strategies deployed
227227

228228
| Name | Proxy | Implementation | Notes |
229229
| -------- | -------- | -------- | -------- |
230-
| [`EigenPod (beacon)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/pods/EigenPod.sol) | [`0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D`](https://holesky.etherscan.io/address/0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D) | [`0xe98f...641c`](https://holesky.etherscan.io/address/0xe98f9298344527608A1BCC23907B8145F9Cb641c) | - Beacon: [`BeaconProxy`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/beacon/BeaconProxy.sol) <br />- Pods: [`UpgradeableBeacon`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/beacon/UpgradeableBeacon.sol) |
230+
| [`EigenPod (beacon)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/pods/EigenPod.sol) | [`0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D`](https://holesky.etherscan.io/address/0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D) | [`0x10ad...319c`](https://holesky.etherscan.io/address/0x10ad7e30e3F52076C8462D573530f4461377319c) | - Beacon: [`BeaconProxy`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/beacon/BeaconProxy.sol) <br />- Pods: [`UpgradeableBeacon`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/beacon/UpgradeableBeacon.sol) |
231231
| [`DelayedWithdrawalRouter`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/pods/DelayedWithdrawalRouter.sol) | [`0x642c646053eaf2254f088e9019ACD73d9AE0FA32`](https://holesky.etherscan.io/address/0x642c646053eaf2254f088e9019ACD73d9AE0FA32) | [`0xcE8b...3407`](https://holesky.etherscan.io/address/0xcE8b8D99773a718423F8040a6e52c06a4ce63407) | Proxy: [`[email protected]`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) |
232-
| [`EigenLayerBeaconOracle`](https://github.com/succinctlabs/eigenlayer-beacon-oracle/blob/main/contracts/src/EigenLayerBeaconOracle.sol) | - | [`0x4C11...8f25`](https://holesky.etherscan.io/address/0x4C116BB629bff7A8373c2378bBd919f8349B8f25) | Provided by [Succinct](https://succinct.xyz/) |
233232

234233
###### EIGEN/bEIGEN
235234

390 KB
Binary file not shown.

certora/harnesses/EigenPodHarness.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ contract EigenPodHarness is EigenPod {
77

88
constructor(
99
IETHPOSDeposit _ethPOS,
10-
IDelayedWithdrawalRouter _delayedWithdrawalRouter,
1110
IEigenPodManager _eigenPodManager,
1211
uint64 _MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR,
1312
uint64 _GENESIS_TIME
1413
)
15-
EigenPod(_ethPOS, _delayedWithdrawalRouter, _eigenPodManager, _MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR, _GENESIS_TIME) {}
14+
EigenPod(_ethPOS, _eigenPodManager, _MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR, _GENESIS_TIME) {}
1615

1716
function get_validatorIndex(bytes32 pubkeyHash) public view returns (uint64) {
1817
return _validatorPubkeyHashToInfo[pubkeyHash].validatorIndex;

certora/scripts/core/verifyStrategyManager.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ solc-select use 0.8.12
77

88
certoraRun certora/harnesses/StrategyManagerHarness.sol \
99
lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol lib/openzeppelin-contracts/contracts/mocks/ERC1271WalletMock.sol \
10-
src/contracts/pods/EigenPodManager.sol src/contracts/pods/EigenPod.sol src/contracts/pods/DelayedWithdrawalRouter.sol \
10+
src/contracts/pods/EigenPodManager.sol src/contracts/pods/EigenPod.sol \
1111
src/contracts/strategies/StrategyBase.sol src/contracts/core/DelegationManager.sol \
1212
src/contracts/core/Slasher.sol src/contracts/permissions/PauserRegistry.sol \
1313
--verify StrategyManagerHarness:certora/specs/core/StrategyManager.spec \

certora/scripts/pods/verifyEigenPod.sh

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,21 @@ then
33
RULE="--rule $2"
44
fi
55

6-
solc-select use 0.8.12
6+
# solc-select use 0.8.12
77

8-
certoraRun certora/harnesses/EigenPodHarness.sol \
9-
src/contracts/core/DelegationManager.sol src/contracts/pods/EigenPodManager.sol \
10-
src/contracts/core/Slasher.sol src/contracts/permissions/PauserRegistry.sol \
11-
src/contracts/core/StrategyManager.sol \
12-
src/contracts/strategies/StrategyBase.sol \
13-
lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol \
14-
lib/openzeppelin-contracts/contracts/mocks/ERC1271WalletMock.sol \
15-
--verify EigenPodHarness:certora/specs/pods/EigenPod.spec \
16-
--solc_via_ir \
17-
--solc_optimize 1 \
18-
--optimistic_loop \
19-
--prover_args '-recursionEntryLimit 3' \
20-
--optimistic_hashing \
21-
--parametric_contracts EigenPodHarness \
22-
$RULE \
23-
--loop_iter 1 \
24-
--packages @openzeppelin=lib/openzeppelin-contracts @openzeppelin-upgrades=lib/openzeppelin-contracts-upgradeable \
25-
--msg "EigenPod $1 $2" \
8+
# certoraRun certora/harnesses/EigenPodHarness.sol \
9+
# src/contracts/core/DelegationManager.sol src/contracts/pods/EigenPodManager.sol \
10+
# src/contracts/core/Slasher.sol src/contracts/permissions/PauserRegistry.sol \
11+
# src/contracts/core/StrategyManager.sol \
12+
# src/contracts/strategies/StrategyBase.sol \
13+
# lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol \
14+
# lib/openzeppelin-contracts/contracts/mocks/ERC1271WalletMock.sol \
15+
# --verify EigenPodHarness:certora/specs/pods/EigenPod.spec \
16+
# --optimistic_loop \
17+
# --prover_args '-recursionEntryLimit 3' \
18+
# --optimistic_hashing \
19+
# --parametric_contracts EigenPodHarness \
20+
# $RULE \
21+
# --loop_iter 1 \
22+
# --packages @openzeppelin=lib/openzeppelin-contracts @openzeppelin-upgrades=lib/openzeppelin-contracts-upgradeable \
23+
# --msg "EigenPod $1 $2" \

certora/scripts/pods/verifyEigenPodManager.sh

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,17 @@ then
33
RULE="--rule $2"
44
fi
55

6-
solc-select use 0.8.12
6+
# solc-select use 0.8.12
77

8-
certoraRun certora/harnesses/EigenPodManagerHarness.sol \
9-
src/contracts/core/DelegationManager.sol src/contracts/pods/EigenPod.sol src/contracts/strategies/StrategyBase.sol src/contracts/core/StrategyManager.sol \
10-
src/contracts/core/Slasher.sol src/contracts/permissions/PauserRegistry.sol \
11-
--verify EigenPodManagerHarness:certora/specs/pods/EigenPodManager.spec \
12-
--solc_via_ir \
13-
--solc_optimize 1 \
14-
--optimistic_loop \
15-
--optimistic_fallback \
16-
--optimistic_hashing \
17-
--parametric_contracts EigenPodManagerHarness \
18-
$RULE \
19-
--loop_iter 3 \
20-
--packages @openzeppelin=lib/openzeppelin-contracts @openzeppelin-upgrades=lib/openzeppelin-contracts-upgradeable \
21-
--msg "EigenPodManager $1 $2" \
8+
# certoraRun certora/harnesses/EigenPodManagerHarness.sol \
9+
# src/contracts/core/DelegationManager.sol src/contracts/pods/EigenPod.sol src/contracts/strategies/StrategyBase.sol src/contracts/core/StrategyManager.sol \
10+
# src/contracts/core/Slasher.sol src/contracts/permissions/PauserRegistry.sol \
11+
# --verify EigenPodManagerHarness:certora/specs/pods/EigenPodManager.spec \
12+
# --optimistic_loop \
13+
# --optimistic_fallback \
14+
# --optimistic_hashing \
15+
# --parametric_contracts EigenPodManagerHarness \
16+
# $RULE \
17+
# --loop_iter 3 \
18+
# --packages @openzeppelin=lib/openzeppelin-contracts @openzeppelin-upgrades=lib/openzeppelin-contracts-upgradeable \
19+
# --msg "EigenPodManager $1 $2" \

certora/specs/core/Slasher.spec

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ methods {
2727
// external calls to EigenPod
2828
function _.withdrawRestakedBeaconChainETH(address,uint256) external => DISPATCHER(true);
2929

30-
// external calls to DelayedWithdrawalRouter (from EigenPod)
31-
function _.createDelayedWithdrawal(address, address) external => DISPATCHER(true);
32-
3330
// external calls to PauserRegistry
3431
function _.isPauser(address) external => DISPATCHER(true);
3532
function _.unpauser() external => DISPATCHER(true);

certora/specs/core/StrategyManager.spec

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ methods {
3131

3232
// external calls to EigenPod
3333
function _.withdrawRestakedBeaconChainETH(address,uint256) external => DISPATCHER(true);
34-
35-
// external calls to DelayedWithdrawalRouter (from EigenPod)
36-
function _.createDelayedWithdrawal(address, address) external => DISPATCHER(true);
3734

3835
// external calls to PauserRegistry
3936
function _.isPauser(address) external => DISPATCHER(true);

certora/specs/pods/EigenPod.spec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ methods {
7171
function validatorPubkeyHashToInfo(bytes32 validatorPubkeyHash) external returns (IEigenPod.ValidatorInfo) envfree;
7272
function provenWithdrawal(bytes32 validatorPubkeyHash, uint64 slot) external returns (bool) envfree;
7373
function validatorStatus(bytes32 pubkeyHash) external returns (IEigenPod.VALIDATOR_STATUS) envfree;
74-
function delayedWithdrawalRouter() external returns (address) envfree;
7574
function nonBeaconChainETHBalanceWei() external returns (uint256) envfree;
7675

7776
// harnessed functions

certora/specs/pods/EigenPodManager.spec

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ methods {
2626

2727
// external calls to EigenPod
2828
function _.withdrawRestakedBeaconChainETH(address,uint256) external => DISPATCHER(true);
29-
3029
// external calls to PauserRegistry
3130
function _.isPauser(address) external => DISPATCHER(true);
3231
function _.unpauser() external => DISPATCHER(true);
@@ -36,7 +35,6 @@ methods {
3635
function getPod(address podOwner) external returns (address) envfree;
3736
function ethPOS() external returns (address) envfree;
3837
function eigenPodBeacon() external returns (address) envfree;
39-
function beaconChainOracle() external returns (address) envfree;
4038
function getBlockRootAtTimestamp(uint64 timestamp) external returns (bytes32) envfree;
4139
function strategyManager() external returns (address) envfree;
4240
function slasher() external returns (address) envfree;

0 commit comments

Comments
 (0)