Skip to content

feat: basic pectra compatibility #1334

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

wadealexc
Copy link
Member

@wadealexc wadealexc commented Apr 22, 2025

Motivation:

Add basic pectra compatibility to EigenPods, supporting EIP-7002 and EIP-7251

Modifications:

Add 2 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;

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);

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.

@bowenli86
Copy link
Collaborator

events looks good to me ✅

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