Skip to main content

CSVerifier

CSVerifier.sol is the utility contract responsible for the validation of the CL data proofs using EIP-4788. It accepts proof of the validator withdrawal and slashing events and reports these facts to the CSModule.sol if the proof is valid.

Upgradability

The contract is immutable.

State Variables

BEACON_ROOTS

address public constant BEACON_ROOTS = 0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02;

SLOTS_PER_EPOCH

uint64 public immutable SLOTS_PER_EPOCH;

GI_FIRST_WITHDRAWAL_PREV

This index is relative to a state like: BeaconState.latest_execution_payload_header.withdrawals[0].

GIndex public immutable GI_FIRST_WITHDRAWAL_PREV;

GI_FIRST_WITHDRAWAL_CURR

This index is relative to a state like: BeaconState.latest_execution_payload_header.withdrawals[0].

GIndex public immutable GI_FIRST_WITHDRAWAL_CURR;

GI_FIRST_VALIDATOR_PREV

This index is relative to a state like: BeaconState.validators[0].

GIndex public immutable GI_FIRST_VALIDATOR_PREV;

GI_FIRST_VALIDATOR_CURR

This index is relative to a state like: BeaconState.validators[0].

GIndex public immutable GI_FIRST_VALIDATOR_CURR;

GI_HISTORICAL_SUMMARIES_PREV

This index is relative to a state like: BeaconState.historical_summaries.

GIndex public immutable GI_HISTORICAL_SUMMARIES_PREV;

GI_HISTORICAL_SUMMARIES_CURR

This index is relative to a state like: BeaconState.historical_summaries.

GIndex public immutable GI_HISTORICAL_SUMMARIES_CURR;

FIRST_SUPPORTED_SLOT

The very first slot the verifier is supposed to accept proofs for.

Slot public immutable FIRST_SUPPORTED_SLOT;

PIVOT_SLOT

The first slot of the currently compatible fork.

Slot public immutable PIVOT_SLOT;

WITHDRAWAL_ADDRESS

An address withdrawals are supposed to happen to (Lido withdrawal credentials).

address public immutable WITHDRAWAL_ADDRESS;

MODULE

Staking module contract

ICSModule public immutable MODULE;

Functions

processSlashingProof

Verify slashing proof and report slashing to the module for valid proofs

function processSlashingProof(
ProvableBeaconBlockHeader calldata beaconBlock,
SlashingWitness calldata witness,
uint256 nodeOperatorId,
uint256 keyIndex
) external;

Parameters

NameTypeDescription
beaconBlockProvableBeaconBlockHeaderBeacon block header
witnessSlashingWitnessSlashing witness
nodeOperatorIduint256ID of the Node Operator
keyIndexuint256Index of the validator key in the Node Operator's key storage

processWithdrawalProof

Verify withdrawal proof and report withdrawal to the module for valid proofs

function processWithdrawalProof(
ProvableBeaconBlockHeader calldata beaconBlock,
WithdrawalWitness calldata witness,
uint256 nodeOperatorId,
uint256 keyIndex
) external;

Parameters

NameTypeDescription
beaconBlockProvableBeaconBlockHeaderBeacon block header
witnessWithdrawalWitnessWithdrawal witness
nodeOperatorIduint256ID of the Node Operator
keyIndexuint256Index of the validator key in the Node Operator's key storage

processHistoricalWithdrawalProof

Verify withdrawal proof against historical summaries data and report withdrawal to the module for valid proofs

function processHistoricalWithdrawalProof(
ProvableBeaconBlockHeader calldata beaconBlock,
HistoricalHeaderWitness calldata oldBlock,
WithdrawalWitness calldata witness,
uint256 nodeOperatorId,
uint256 keyIndex
) external;

Parameters

NameTypeDescription
beaconBlockProvableBeaconBlockHeaderBeacon block header
oldBlockHistoricalHeaderWitnessHistorical block header witness
witnessWithdrawalWitnessWithdrawal witness
nodeOperatorIduint256ID of the Node Operator
keyIndexuint256Index of the validator key in the Node Operator's key storage