Skip to content

Commit

Permalink
feat: partial withdrawal batching (#515)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
wadealexc authored Aug 9, 2024
1 parent 3b47ccf commit b4fa900
Show file tree
Hide file tree
Showing 146 changed files with 10,519 additions and 13,395 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ You can view the deployed contract addresses below, or check out the code itself
| -------- | -------- | -------- | -------- |
| [`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) |
| [`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) |
| [`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) |
| [`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) |
| [`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) |
| [`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) |
| [`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) |
| [`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) |

###### Strategies

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

| Name | Proxy | Implementation | Notes |
| -------- | -------- | -------- | -------- |
| [`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) |
| [`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) |
| [`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) |
| [`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/) |

###### EIGEN/bEIGEN

Expand Down
Binary file not shown.
3 changes: 1 addition & 2 deletions certora/harnesses/EigenPodHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ contract EigenPodHarness is EigenPod {

constructor(
IETHPOSDeposit _ethPOS,
IDelayedWithdrawalRouter _delayedWithdrawalRouter,
IEigenPodManager _eigenPodManager,
uint64 _MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR,
uint64 _GENESIS_TIME
)
EigenPod(_ethPOS, _delayedWithdrawalRouter, _eigenPodManager, _MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR, _GENESIS_TIME) {}
EigenPod(_ethPOS, _eigenPodManager, _MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR, _GENESIS_TIME) {}

function get_validatorIndex(bytes32 pubkeyHash) public view returns (uint64) {
return _validatorPubkeyHashToInfo[pubkeyHash].validatorIndex;
Expand Down
2 changes: 1 addition & 1 deletion certora/scripts/core/verifyStrategyManager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ solc-select use 0.8.12

certoraRun certora/harnesses/StrategyManagerHarness.sol \
lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol lib/openzeppelin-contracts/contracts/mocks/ERC1271WalletMock.sol \
src/contracts/pods/EigenPodManager.sol src/contracts/pods/EigenPod.sol src/contracts/pods/DelayedWithdrawalRouter.sol \
src/contracts/pods/EigenPodManager.sol src/contracts/pods/EigenPod.sol \
src/contracts/strategies/StrategyBase.sol src/contracts/core/DelegationManager.sol \
src/contracts/core/Slasher.sol src/contracts/permissions/PauserRegistry.sol \
--verify StrategyManagerHarness:certora/specs/core/StrategyManager.spec \
Expand Down
36 changes: 17 additions & 19 deletions certora/scripts/pods/verifyEigenPod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@ then
RULE="--rule $2"
fi

solc-select use 0.8.12
# solc-select use 0.8.12

certoraRun certora/harnesses/EigenPodHarness.sol \
src/contracts/core/DelegationManager.sol src/contracts/pods/EigenPodManager.sol \
src/contracts/core/Slasher.sol src/contracts/permissions/PauserRegistry.sol \
src/contracts/core/StrategyManager.sol \
src/contracts/strategies/StrategyBase.sol \
lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol \
lib/openzeppelin-contracts/contracts/mocks/ERC1271WalletMock.sol \
--verify EigenPodHarness:certora/specs/pods/EigenPod.spec \
--solc_via_ir \
--solc_optimize 1 \
--optimistic_loop \
--prover_args '-recursionEntryLimit 3' \
--optimistic_hashing \
--parametric_contracts EigenPodHarness \
$RULE \
--loop_iter 1 \
--packages @openzeppelin=lib/openzeppelin-contracts @openzeppelin-upgrades=lib/openzeppelin-contracts-upgradeable \
--msg "EigenPod $1 $2" \
# certoraRun certora/harnesses/EigenPodHarness.sol \
# src/contracts/core/DelegationManager.sol src/contracts/pods/EigenPodManager.sol \
# src/contracts/core/Slasher.sol src/contracts/permissions/PauserRegistry.sol \
# src/contracts/core/StrategyManager.sol \
# src/contracts/strategies/StrategyBase.sol \
# lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol \
# lib/openzeppelin-contracts/contracts/mocks/ERC1271WalletMock.sol \
# --verify EigenPodHarness:certora/specs/pods/EigenPod.spec \
# --optimistic_loop \
# --prover_args '-recursionEntryLimit 3' \
# --optimistic_hashing \
# --parametric_contracts EigenPodHarness \
# $RULE \
# --loop_iter 1 \
# --packages @openzeppelin=lib/openzeppelin-contracts @openzeppelin-upgrades=lib/openzeppelin-contracts-upgradeable \
# --msg "EigenPod $1 $2" \
28 changes: 13 additions & 15 deletions certora/scripts/pods/verifyEigenPodManager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@ then
RULE="--rule $2"
fi

solc-select use 0.8.12
# solc-select use 0.8.12

certoraRun certora/harnesses/EigenPodManagerHarness.sol \
src/contracts/core/DelegationManager.sol src/contracts/pods/EigenPod.sol src/contracts/strategies/StrategyBase.sol src/contracts/core/StrategyManager.sol \
src/contracts/core/Slasher.sol src/contracts/permissions/PauserRegistry.sol \
--verify EigenPodManagerHarness:certora/specs/pods/EigenPodManager.spec \
--solc_via_ir \
--solc_optimize 1 \
--optimistic_loop \
--optimistic_fallback \
--optimistic_hashing \
--parametric_contracts EigenPodManagerHarness \
$RULE \
--loop_iter 3 \
--packages @openzeppelin=lib/openzeppelin-contracts @openzeppelin-upgrades=lib/openzeppelin-contracts-upgradeable \
--msg "EigenPodManager $1 $2" \
# certoraRun certora/harnesses/EigenPodManagerHarness.sol \
# src/contracts/core/DelegationManager.sol src/contracts/pods/EigenPod.sol src/contracts/strategies/StrategyBase.sol src/contracts/core/StrategyManager.sol \
# src/contracts/core/Slasher.sol src/contracts/permissions/PauserRegistry.sol \
# --verify EigenPodManagerHarness:certora/specs/pods/EigenPodManager.spec \
# --optimistic_loop \
# --optimistic_fallback \
# --optimistic_hashing \
# --parametric_contracts EigenPodManagerHarness \
# $RULE \
# --loop_iter 3 \
# --packages @openzeppelin=lib/openzeppelin-contracts @openzeppelin-upgrades=lib/openzeppelin-contracts-upgradeable \
# --msg "EigenPodManager $1 $2" \
3 changes: 0 additions & 3 deletions certora/specs/core/Slasher.spec
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ methods {
// external calls to EigenPod
function _.withdrawRestakedBeaconChainETH(address,uint256) external => DISPATCHER(true);

// external calls to DelayedWithdrawalRouter (from EigenPod)
function _.createDelayedWithdrawal(address, address) external => DISPATCHER(true);

// external calls to PauserRegistry
function _.isPauser(address) external => DISPATCHER(true);
function _.unpauser() external => DISPATCHER(true);
Expand Down
3 changes: 0 additions & 3 deletions certora/specs/core/StrategyManager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ methods {

// external calls to EigenPod
function _.withdrawRestakedBeaconChainETH(address,uint256) external => DISPATCHER(true);

// external calls to DelayedWithdrawalRouter (from EigenPod)
function _.createDelayedWithdrawal(address, address) external => DISPATCHER(true);

// external calls to PauserRegistry
function _.isPauser(address) external => DISPATCHER(true);
Expand Down
1 change: 0 additions & 1 deletion certora/specs/pods/EigenPod.spec
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ methods {
function validatorPubkeyHashToInfo(bytes32 validatorPubkeyHash) external returns (IEigenPod.ValidatorInfo) envfree;
function provenWithdrawal(bytes32 validatorPubkeyHash, uint64 slot) external returns (bool) envfree;
function validatorStatus(bytes32 pubkeyHash) external returns (IEigenPod.VALIDATOR_STATUS) envfree;
function delayedWithdrawalRouter() external returns (address) envfree;
function nonBeaconChainETHBalanceWei() external returns (uint256) envfree;

// harnessed functions
Expand Down
2 changes: 0 additions & 2 deletions certora/specs/pods/EigenPodManager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ methods {

// external calls to EigenPod
function _.withdrawRestakedBeaconChainETH(address,uint256) external => DISPATCHER(true);

// external calls to PauserRegistry
function _.isPauser(address) external => DISPATCHER(true);
function _.unpauser() external => DISPATCHER(true);
Expand All @@ -36,7 +35,6 @@ methods {
function getPod(address podOwner) external returns (address) envfree;
function ethPOS() external returns (address) envfree;
function eigenPodBeacon() external returns (address) envfree;
function beaconChainOracle() external returns (address) envfree;
function getBlockRootAtTimestamp(uint64 timestamp) external returns (bytes32) envfree;
function strategyManager() external returns (address) envfree;
function slasher() external returns (address) envfree;
Expand Down
28 changes: 12 additions & 16 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[middleware-repo]: https://github.com/Layr-Labs/eigenlayer-middleware/

## EigenLayer M2 Docs
## EigenLayer Docs - v0.4.0 Release

This repo contains the EigenLayer core contracts, which enable restaking of liquid staking tokens (LSTs) and beacon chain ETH to secure new services, called AVSs (actively validated services). For more info on AVSs, check out the EigenLayer middleware contracts [here][middleware-repo].

Expand Down Expand Up @@ -33,16 +33,14 @@ This document provides an overview of system components, contracts, and user rol
| -------- | -------- | -------- |
| [`EigenPodManager.sol`](../src/contracts/pods/EigenPodManager.sol) | Singleton | Transparent proxy |
| [`EigenPod.sol`](../src/contracts/pods/EigenPod.sol) | Instanced, deployed per-user | Beacon proxy |
| [`DelayedWithdrawalRouter.sol`](../src/contracts/pods/DelayedWithdrawalRouter.sol) | Singleton | Transparent proxy |
| [`succinctlabs/EigenLayerBeaconOracle.sol`](https://github.com/succinctlabs/telepathy-contracts/blob/main/external/integrations/eigenlayer/EigenLayerBeaconOracle.sol) | Singleton | UUPS proxy | [`0x40B1...9f2c`](https://goerli.etherscan.io/address/0x40B10ddD29a2cfF33DBC420AE5bbDa0649049f2c) |

These contracts work together to enable native ETH restaking:
* Users deploy `EigenPods` via the `EigenPodManager`, which contain beacon chain state proof logic used to verify a validator's withdrawal credentials, balance, and exit. An `EigenPod's` main role is to serve as the withdrawal address for one or more of a user's validators.
* Users deploy `EigenPods` via the `EigenPodManager`, which contain beacon chain state proof logic used to verify a validator's withdrawal credentials and current balances. An `EigenPod's` main role is to serve as the fee recipient and/or withdrawal credentials for one or more of a user's validators.
* The `EigenPodManager` handles `EigenPod` creation and accounting+interactions between users with restaked native ETH and the `DelegationManager`.
* The `DelayedWithdrawalRouter` imposes a 7-day delay on completing partial beacon chain withdrawals from an `EigenPod`. This is primarily to add a stopgap against a hack being able to instantly withdraw funds (note that all withdrawals from EigenLayer -- other than partial withdrawals earned by validators -- are initiated via the `DelegationManager`).
* The `EigenLayerBeaconOracle` provides beacon chain block roots for use in various proofs. The oracle is supplied by Succinct's Telepathy protocol ([docs link](https://docs.telepathy.xyz/)).

See full documentation in [`/core/EigenPodManager.md`](./core/EigenPodManager.md).
See full documentation in:
* [`/core/EigenPodManager.md`](./core/EigenPodManager.md)
* [`/core/EigenPod.md`](./core/EigenPod.md)

#### StrategyManager

Expand Down Expand Up @@ -123,8 +121,7 @@ Stakers can restake any combination of these: a Staker may hold ALL of these ass
* Stakers **withdraw** assets via the DelegationManager, *no matter what assets they're withdrawing*
* Stakers **delegate** to an Operator via the DelegationManager

Unimplemented as of M2:
* Stakers earn yield by delegating to an Operator as the Operator provides services to an AVS
*Unimplemented as of v0.4.0:*
* Stakers are at risk of being slashed if the Operator misbehaves

##### Operator
Expand All @@ -136,8 +133,7 @@ An Operator is a user who helps run the software built on top of EigenLayer (AVS
* Operators can **deposit** and **withdraw** assets just like Stakers can
* Operators can opt in to providing services for an AVS using that AVS's middleware contracts. See the [EigenLayer middleware][middleware-repo] repo for more details.

*Unimplemented as of M2:*
* Operators earn fees as part of the services they provide
*Unimplemented as of v0.4.0:*
* Operators may be slashed by the services they register with (if they misbehave)

---
Expand Down Expand Up @@ -170,18 +166,18 @@ This flow is mostly useful if a Staker wants to change which Operator they are d

Completing a queued withdrawal as tokens is roughly the same for both native ETH and LSTs.

However, note that *before* a withdrawal can be completed, native ETH stakers will need to perform additional steps, detailed in the "Withdrawal Processing" diagrams below.
However, note that *before* a withdrawal can be completed, native ETH stakers will need to perform additional steps, detailed in the diagrams below.

![.](./images/Staker%20Flow%20Diagrams/Complete%20Withdrawal%20as%20Tokens.png)

##### Withdrawal Processing: Validator Exits
##### `EigenPods`: Processing Validator Exits

If a Staker wants to fully withdraw from the beacon chain, they need to perform these additional steps before their withdrawal is completable:

![.](./images/Staker%20Flow%20Diagrams/Validator%20Exits.png)

##### Withdrawal Processing: Partial Beacon Chain Withdrawals
##### `EigenPods`: Processing Validator Yield

If a Staker wants to withdraw consensus rewards from the beacon chain, they do NOT go through the `DelegationManager`. This is the only withdrawal type that is not initiated in the `DelegationManager`:
As the Staker's `EigenPod` accumulates consensus layer or execution layer yield, the `EigenPod's` balance will increase. The Staker can Checkpoint their validator to claim this yield as shares, which can either remain staked in EigenLayer or be withdrawn via the `DelegationManager` withdrawal queue:

![.](./images/Staker%20Flow%20Diagrams/Partial%20Withdrawals.png)
![.](./images/Staker%20Flow%20Diagrams/Validator%20Yield.png)
Loading

0 comments on commit b4fa900

Please sign in to comment.