Skip to content

feat: merge release branch of MOOCOW and ELIP5 into main #1375

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

Closed
wants to merge 9 commits into from

Conversation

wadealexc
Copy link
Member

@wadealexc wadealexc commented May 15, 2025

Motivation:

  1. MOOCOW: Add basic pectra compatibility to EigenPods, supporting EIP-7002 and EIP-7251. See release info 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 😄

/**
 * @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:

/// @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:

/// @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
/// @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.

wadealexc and others added 7 commits May 22, 2025 17:48
* docs: add docs for moocow methods and move EigenPod to inheritdoc syntax

* chore: forge fmt

* test: fix fork tests
* test: add unit tests for consolidation and withdrawal
* chore: make bindings
* chore: misc feedback
…bility (#1356)

* docs: update release README
* chore: fix eigenpod version in 1.6.0 script
**Motivation:**

add semver to eigen

**Modifications:**

add semver to eigen

**Result:**

add semver to eigen
@wadealexc wadealexc force-pushed the release-dev/moocow branch from 2814285 to 55f984f Compare May 22, 2025 17:57
@bowenli86 bowenli86 changed the title feat: MOOCOW and ELIP5 release: merge release branch of MOOCOW and ELIP5 into main May 27, 2025
@bowenli86 bowenli86 changed the title release: merge release branch of MOOCOW and ELIP5 into main feat: merge release branch of MOOCOW and ELIP5 into main May 27, 2025
@bowenli86
Copy link
Collaborator

merged in #1425

@bowenli86 bowenli86 closed this Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants