Skip to main content

ValidatorStrikes

ValidatorStrikes.sol is a supplementary contract that stores the latest Merkle tree root and CID for validator strike data reported by the Performance Oracle. Anyone can submit a valid Merkle proof showing that one or more validators have reached the strike threshold configured for their Node Operator type. For each qualifying validator, the contract records a bad-performance penalty through ExitPenalties and calls Ejector to trigger the validator's exit.

Upgradability​

The contract uses OssifiableProxy for upgradability.

State Variables​

ORACLE​

address public immutable ORACLE

MODULE​

IBaseModule public immutable MODULE

ACCOUNTING​

IAccounting public immutable ACCOUNTING

EXIT_PENALTIES​

IExitPenalties public immutable EXIT_PENALTIES

PARAMETERS_REGISTRY​

IParametersRegistry public immutable PARAMETERS_REGISTRY

ejector​

IEjector public ejector

treeRoot​

The latest Merkle Tree root

bytes32 public treeRoot

treeCid​

CID of the last published Merkle tree

string public treeCid

Functions​

onlyOracle​

modifier onlyOracle() ;

constructor​

constructor(address module, address oracle) ;

initialize​

Initialize contract from scratch. In case of a method call frontrun, the contract instance should be discarded. It is recommended to call this method in the same transaction as the deployment transaction and perform extensive deployment verification before using the contract instance.

function initialize(address admin, address _ejector) external initializer;

setEjector​

Set the address of the Ejector contract

function setEjector(address _ejector) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
_ejectoraddressAddress of the Ejector contract

processOracleReport​

Receive the data of the Merkle tree from the Oracle contract and process it

New tree might be empty and it is valid value because of strikesLifetime

function processOracleReport(bytes32 _treeRoot, string calldata _treeCid) external onlyOracle;

Parameters

NameTypeDescription
_treeRootbytes32Root of the Merkle tree
_treeCidstringIPFS CID of the tree

processBadPerformanceProof​

Report multiple keys as bad performing

function processBadPerformanceProof(
KeyStrikes[] calldata keyStrikesList,
bytes32[] calldata proof,
bool[] calldata proofFlags,
address refundRecipient
) external payable;

Parameters

NameTypeDescription
keyStrikesListKeyStrikes[]List of KeyStrikes structs
proofbytes32[]Multi-proof of the strikes
proofFlagsbool[]Flags to process the multi-proof, see OZ processMultiProof
refundRecipientaddressAddress to send the refund to

getInitializedVersion​

Returns the initialized version of the contract

function getInitializedVersion() external view returns (uint64);

verifyProof​

Check the contract accepts the provided multi-proof

function verifyProof(
KeyStrikes[] calldata keyStrikesList,
bytes[] memory pubkeys,
bytes32[] calldata proof,
bool[] calldata proofFlags
) public view returns (bool);

Parameters

NameTypeDescription
keyStrikesListKeyStrikes[]List of KeyStrikes structs
pubkeysbytes[]Public keys corresponding to each entry in keyStrikesList
proofbytes32[]Multi-proof of the strikes
proofFlagsbool[]Flags to process the multi-proof, see OZ processMultiProof

Returns

NameTypeDescription
<none>boolTrue if proof is accepted

hashLeaf​

Get a hash of a leaf in a tree of strikes

Double hash the leaf to prevent second pre-image attacks

function hashLeaf(KeyStrikes calldata keyStrikes, bytes memory pubkey) public pure returns (bytes32);

Parameters

NameTypeDescription
keyStrikesKeyStrikesKeyStrikes struct
pubkeybytesPublic key

Returns

NameTypeDescription
<none>bytes32Hash of the leaf

_setEjector​

function _setEjector(address _ejector) internal;

_ejectByStrikes​

function _ejectByStrikes(
KeyStrikes calldata keyStrikes,
bytes memory pubkey,
uint256 value,
address refundRecipient
) internal;

_onlyOracle​

function _onlyOracle() internal view;