Commit 48ba63b
authored
feat: merge Moocow and ELIP5 into main (#1425)
**Motivation:**
1. MOOCOW: Add basic pectra compatibility to EigenPods, supporting
EIP-7002 and EIP-7251. See [release
info](https://hackmd.io/uijo9RSnSMOmejK1aKH0vw?view) for details.
2. ELIP5: Implement 2 Eigen token events to track observability of
wrap/unwrap action, and added semver to Eigen token
**Modifications:**
*1. Add 4 methods to `EigenPod.sol`:*
See full method docs in `IEigenPod.sol` - they're long, so I didn't copy
them here 😄
```solidity
/**
* @param srcPubkey the pubkey of the source validator for the consolidation
* @param targetPubkey the pubkey of the target validator for the consolidation
* @dev Note that if srcPubkey == targetPubkey, this is a "switch request," and will
* change the validator's withdrawal credential type from 0x01 to 0x02.
* For more notes on usage, see `requestConsolidation`
*/
struct ConsolidationRequest {
bytes srcPubkey;
bytes targetPubkey;
}
/**
* @param pubkey the pubkey of the validator to withdraw from
* @param amountGwei the amount (in gwei) to withdraw from the beacon chain to the pod
* @dev Note that if amountGwei == 0, this is a "full exit request," and will fully exit
* the validator to the pod.
* For more notes on usage, see `requestWithdrawal`
*/
struct WithdrawalRequest {
bytes pubkey;
uint64 amountGwei;
}
/// SEE FULL DOCS IN IEigenPod.sol
function requestConsolidation(
ConsolidationRequest[] calldata requests
) external payable onlyOwnerOrProofSubmitter;
/// SEE FULL DOCS IN IEigenPod.sol
function requestWithdrawal(
WithdrawalRequest[] calldata requests
) external payable onlyOwnerOrProofSubmitter;
/// @notice Returns the fee required to add a consolidation request to the EIP-7251 predeploy this block.
/// @dev Note that the predeploy updates its fee every block according to https://eips.ethereum.org/EIPS/eip-7251#fee-calculation
/// Consider overestimating the amount sent to ensure the fee does not update before your transaction.
function getConsolidationRequestFee() external view returns (uint256);
/// @notice Returns the current fee required to add a withdrawal request to the EIP-7002 predeploy.
/// @dev Note that the predeploy updates its fee every block according to https://eips.ethereum.org/EIPS/eip-7002#fee-update-rule
/// Consider overestimating the amount sent to ensure the fee does not update before your transaction.
function getWithdrawalRequestFee() external view returns (uint256);
```
*2. Add 4 events to `EigenPod.sol`:*
```solidity
/// @notice Emitted when a consolidation request is initiated where source == target
event SwitchToCompoundingRequested(bytes32 indexed validatorPubkeyHash);
/// @notice Emitted when a standard consolidation request is initiated
event ConsolidationRequested(bytes32 indexed sourcePubkeyHash, bytes32 indexed targetPubkeyHash);
/// @notice Emitted when a withdrawal request is initiated where request.amountGwei == 0
event ExitRequested(bytes32 indexed validatorPubkeyHash);
/// @notice Emitted when a partial withdrawal request is initiated
event WithdrawalRequested(bytes32 indexed validatorPubkeyHash, uint64 withdrawalAmountGwei);
```
*3. Modify 2 `EigenPod` methods:*
* `EigenPod._updateCheckpoint()`:
* **Context**: Prior to v1.3.0, checkpoints would be deleted on
completion. However, this was changed in 1.3.0 to save gas when starting
a checkpoint. Checkpoint completion was instead marked by
`currentCheckpointTimestamp == 0`
* **What changed**: With this release, checkpoints are _still_ not
deleted on completion. However, when finalizing a checkpoint, the
contract will store the finalized checkpoint in storage, where it can be
queried via `EigenPod.currentCheckpoint()`.
* `EigenPod.GENESIS_TIME()`:
* This method/variable has been unused for over a year. This release
removes the method from `EigenPods`.
*4. Modify 5 events in `EigenPod.sol`:*
* **Context**: When referencing a validator, EigenPod events emitted
either a validator index or a full pubkey.
* **What changed**: EigenPod events now all emit a `pubkeyHash` when
referencing a validator.
Updated event definitions:
```solidity
/// @notice Emitted when an ETH validator stakes via this eigenPod
event EigenPodStaked(bytes32 pubkeyHash);
/// @notice Emitted when an ETH validator's withdrawal credentials are successfully verified to be pointed to this eigenPod
event ValidatorRestaked(bytes32 pubkeyHash);
/// @notice Emitted when an ETH validator's balance is proven to be updated. Here newValidatorBalanceGwei
// is the validator's balance that is credited on EigenLayer.
event ValidatorBalanceUpdated(bytes32 pubkeyHash, uint64 balanceTimestamp, uint64 newValidatorBalanceGwei);
/// @notice Emitted when a validator is proven for a given checkpoint
event ValidatorCheckpointed(uint64 indexed checkpointTimestamp, bytes32 indexed pubkeyHash);
/// @notice Emitted when a validaor is proven to have 0 balance at a given checkpoint
event ValidatorWithdrawn(uint64 indexed checkpointTimestamp, bytes32 indexed pubkeyHash);
```
*5. Add 2 events to `Eigen.sol`:*
* **What changed**: When wrapping/unwrapping EIGEN, corresponding events
are now emitted
```solidity
/// @notice Emitted when bEIGEN tokens are wrapped into EIGEN
event TokenWrapped(address indexed account, uint256 amount);
/// @notice Emitted when EIGEN tokens are unwrapped into bEIGEN
event TokenUnwrapped(address indexed account, uint256 amount);
```
**Result:**
EigenPods will support Pectra features, allowing the pod owner or proof
submitter of a pod to initiate consolidations and withdrawals via the
EIP-7002 and EIP-7521 predeploys.File tree
57 files changed
+5310
-1973
lines changed- CHANGELOG
- certora/harnesses
- docs/core
- pkg/bindings
- BeaconChainProofs
- DelegationManager
- EigenPodManager
- EigenPodStorage
- EigenPod
- EigenStrategy
- Eigen
- IEigenPod
- RewardsCoordinator
- SlashEscrowFactory
- StrategyBaseTVLLimits
- StrategyBase
- StrategyFactory
- StrategyManager
- script
- deploy
- devnet
- local
- releases
- v.1.5.0-redistribution
- v1.6.0-moocow-and-elip5
- utils
- src
- contracts
- interfaces
- libraries
- pods
- token
- test
- harnesses
- integration
- mocks
- tests/eigenpod
- users
- mocks
- token
- unit
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
57 files changed
+5310
-1973
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | 3 | | |
7 | 4 | | |
8 | 5 | | |
9 | 6 | | |
10 | | - | |
11 | 7 | | |
12 | 8 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
24 | 14 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 15 | + | |
| 16 | + | |
36 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
37 | 21 | | |
38 | 22 | | |
39 | 23 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
13 | 12 | | |
14 | | - | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments