Skip to main content

CSExitPenalties

CSExitPenalties.sol is a supplementary contract responsible for processing and storing information about exit-related penalties, namely:

  • Delayed exit penalty;
  • Bad performance ejection penalty (see CSStrikes);
  • TE fee paid in case of a forced exit.

Upgradability

The contract uses OssifiableProxy for upgradability.

State Variables

MODULE

ICSModule public immutable MODULE;

PARAMETERS_REGISTRY

ICSParametersRegistry public immutable PARAMETERS_REGISTRY;

ACCOUNTING

ICSAccounting public immutable ACCOUNTING;

STRIKES

address public immutable STRIKES;

VOLUNTARY_EXIT_TYPE_ID

uint8 public constant VOLUNTARY_EXIT_TYPE_ID = 0;

STRIKES_EXIT_TYPE_ID

uint8 public constant STRIKES_EXIT_TYPE_ID = 1;

Functions

processExitDelayReport

Handles tracking and penalization logic for a validator that remains active beyond its eligible exit window.

see IStakingModule.reportValidatorExitDelay for details

function processExitDelayReport(uint256 nodeOperatorId, bytes calldata publicKey, uint256 eligibleToExitInSec)
external
onlyModule;

Parameters

NameTypeDescription
nodeOperatorIduint256The ID of the node operator whose validator's status is being delivered.
publicKeybytesThe public key of the validator being reported.
eligibleToExitInSecuint256The duration (in seconds) indicating how long the validator has been eligible to exit but has not exited.

processTriggeredExit

Process the triggered exit report

function processTriggeredExit(
uint256 nodeOperatorId,
bytes calldata publicKey,
uint256 withdrawalRequestPaidFee,
uint256 exitType
) external onlyModule;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
publicKeybytesPublic key of the validator
withdrawalRequestPaidFeeuint256The fee paid for the withdrawal request
exitTypeuint256The type of the exit (0 - direct exit, 1 - forced exit)

processStrikesReport

Process the strikes report

function processStrikesReport(uint256 nodeOperatorId, bytes calldata publicKey) external onlyStrikes;

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
publicKeybytesPublic key of the validator

isValidatorExitDelayPenaltyApplicable

Determines whether a validator exit status should be updated and will have affect on Node Operator.

there is a onlyModule modifier to prevent using it from outside as it gives a false-positive information for non-existent node operators. use isValidatorExitDelayPenaltyApplicable in the CSModule.sol instead

function isValidatorExitDelayPenaltyApplicable(
uint256 nodeOperatorId,
bytes calldata publicKey,
uint256 eligibleToExitInSec
) external view onlyModule returns (bool);

Parameters

NameTypeDescription
nodeOperatorIduint256The ID of the node operator.
publicKeybytesValidator's public key.
eligibleToExitInSecuint256The number of seconds the validator was eligible to exit but did not.

Returns

NameTypeDescription
<none>boolbool Returns true if contract should receive updated validator's status.

getExitPenaltyInfo

get delayed exit penalty info for the given Node Operator

function getExitPenaltyInfo(uint256 nodeOperatorId, bytes calldata publicKey)
external
view
returns (ExitPenaltyInfo memory);

Parameters

NameTypeDescription
nodeOperatorIduint256ID of the Node Operator
publicKeybytesPublic key of the validator

Returns

NameTypeDescription
<none>ExitPenaltyInfopenaltyInfo Delayed exit penalty info

Events

ValidatorExitDelayProcessed

event ValidatorExitDelayProcessed(uint256 indexed nodeOperatorId, bytes pubkey, uint256 delayPenalty);

TriggeredExitFeeRecorded

event TriggeredExitFeeRecorded(
uint256 indexed nodeOperatorId,
uint256 indexed exitType,
bytes pubkey,
uint256 withdrawalRequestPaidFee,
uint256 withdrawalRequestRecordedFee
);

StrikesPenaltyProcessed

event StrikesPenaltyProcessed(uint256 indexed nodeOperatorId, bytes pubkey, uint256 strikesPenalty);