Skip to content

Commit 48ba63b

Browse files
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.
2 parents f5ea6d3 + 507b673 commit 48ba63b

File tree

57 files changed

+5310
-1973
lines changed

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

CHANGELOG/CHANGELOG-1.6.0.md

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,24 @@
11
# v1.6.0 Moocow and ELIP5
22

3-
**Use this template to draft changelog and submit PR to review by the team**
4-
5-
63
## Release Manager
74

85
@wadealexc @bowenli86
96

10-
117
## Highlights
128

13-
🚀 New Features – Highlight major new functionality
14-
- ...
15-
- ...
16-
17-
⛔ Breaking Changes – Call out backward-incompatible changes.
18-
- ...
19-
- ...
20-
21-
📌 Deprecations – Mention features that are being phased out.
22-
- ...
23-
- ...
9+
🚀 **New Features**
10+
- New APIs supporting Pectra's validator consolidation and withdrawal features: `EigenPod.requestConsolidation(...)` and `EigenPod.requestWithdrawal(...)`
11+
- New getters to support Pectra APIs: `EigenPod.getConsolidationRequestFee()` and `EigenPod.getWithdrawalRequestFee()`
12+
- Added 4 new events to `EigenPod.sol` to track consolidation and withdrawal requests
13+
- Added 2 new events to `Eigen.sol` to track token wraps/unwraps with `BackingEigen`
2414

25-
🛠️ Security Fixes – Specify patched vulnerabilities.
26-
- ...
27-
- ...
28-
29-
🔧 Improvements – Enhancements to existing features.
30-
- ...
31-
- ...
32-
33-
🐛 Bug Fixes – List resolved issues.
34-
- ...
35-
- ...
15+
📌 **Deprecations**
16+
- Removed `EigenPod.GENESIS_TIME()` getter. This method, though public, has been unused for over a year.
3617

18+
🔧 **Improvements**
19+
- When finalizing an `EigenPod` checkpoint (`proofsRemaining == 0`), the contract will store the finalized checkpoint in storage. This can be queried via `EigenPod.currentCheckpoint()`. Starting a new checkpoint will overwrite this previously-finalized checkpoint.
20+
- Added semver to `Eigen`
3721

3822
## Changelog
3923

40-
Copy the one that's auto generated from github by default to here, and submit PR for review
41-
42-
43-
- merged PRs in diff from last release
44-
- contributors
45-
- etc
24+
* feat: MOOCOW and ELIP5 ([#1375](https://github.com/Layr-Labs/eigenlayer-contracts/pull/1375))

certora/harnesses/EigenPodHarness.sol

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ contract EigenPodHarness is EigenPod {
88
constructor(
99
IETHPOSDeposit _ethPOS,
1010
IEigenPodManager _eigenPodManager,
11-
uint64 _MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR,
12-
uint64 _GENESIS_TIME
11+
string memory _version
1312
)
14-
EigenPod(_ethPOS, _eigenPodManager, _MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR, _GENESIS_TIME) {}
13+
EigenPod(_ethPOS, _eigenPodManager, _version) {}
1514

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

docs/core/EigenPod.md

Lines changed: 145 additions & 13 deletions
Large diffs are not rendered by default.

pkg/bindings/BeaconChainProofs/binding.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/DelegationManager/binding.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/Eigen/binding.go

Lines changed: 325 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/EigenPod/binding.go

Lines changed: 875 additions & 204 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/EigenPodManager/binding.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/EigenPodStorage/binding.go

Lines changed: 760 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/EigenStrategy/binding.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)