Skip to content

Conversation

bowenli86
Copy link
Contributor

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 9 commits June 1, 2025 12:51
* 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
@bowenli86
Copy link
Contributor Author

bowenli86 commented Jun 1, 2025

have to resolve a ton of conflicts when rebasing to main after redistribution merged

to preserve release-dev/moocow, i'm starting a new branch release-dev/moocow-rebased and resolved conflicts here and merge into main, instead of force push and overwrite release-dev/moocow

@bowenli86 bowenli86 force-pushed the release-dev/moocow-rebased branch from c2934a5 to 555aef9 Compare June 1, 2025 20:11
@bowenli86
Copy link
Contributor Author

commits in changelog will be added after merging to main, otherwise we will lose commit of this pr

@bowenli86 bowenli86 requested a review from ypatil12 June 2, 2025 16:11
Copy link
Collaborator

@ypatil12 ypatil12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bowenli86 bowenli86 merged commit 48ba63b into main Jun 3, 2025
17 checks passed
@bowenli86 bowenli86 deleted the release-dev/moocow-rebased branch June 3, 2025 15:50
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.

3 participants