Skip to main content

CSParametersRegistry

CSParametersRegistry.sol is a utility contract that stores Node-Operator-type-related parameters fetched by the other smart contracts related to CSM. A contract requires a mandatory default value for all parameters to ensure consistency. The custom value is returned if it is set for a particular parameter. Otherwise, the default value is returned.

Upgradability

The contract uses OssifiableProxy for upgradability.

State Variables

QUEUE_LOWEST_PRIORITY

QUEUE_LOWEST_PRIORITY identifies the range of available priorities: [0; QUEUE_LOWEST_PRIORITY].

uint256 public immutable QUEUE_LOWEST_PRIORITY;

QUEUE_LEGACY_PRIORITY

QUEUE_LEGACY_PRIORITY is the priority for the CSM v1 queue.

uint256 public immutable QUEUE_LEGACY_PRIORITY;

defaultKeyRemovalCharge

uint256 public defaultKeyRemovalCharge;

defaultElRewardsStealingAdditionalFine

uint256 public defaultElRewardsStealingAdditionalFine;

defaultKeysLimit

uint256 public defaultKeysLimit;

defaultQueueConfig

QueueConfig public defaultQueueConfig;

defaultRewardShare

Default value for the reward share. Can be only be set as a flat value due to possible sybil attacks Decreased reward share for some validators > N will promote sybils. Increased reward share for validators > N will give large operators an advantage

uint256 public defaultRewardShare;

defaultPerformanceLeeway

Default value for the performance leeway. Can be only be set as a flat value due to possible sybil attacks Decreased performance leeway for some validators > N will promote sybils. Increased performance leeway for validators > N will give large operators an advantage

uint256 public defaultPerformanceLeeway;

defaultStrikesParams

StrikesParams public defaultStrikesParams;

defaultBadPerformancePenalty

uint256 public defaultBadPerformancePenalty;

defaultPerformanceCoefficients

PerformanceCoefficients public defaultPerformanceCoefficients;

defaultAllowedExitDelay

uint256 public defaultAllowedExitDelay;

defaultExitDelayPenalty

uint256 public defaultExitDelayPenalty;

defaultMaxWithdrawalRequestFee

uint256 public defaultMaxWithdrawalRequestFee;

Functions

setDefaultKeyRemovalCharge

Set default value for the key removal charge. Default value is used if a specific value is not set for the curveId

function setDefaultKeyRemovalCharge(uint256 keyRemovalCharge) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
keyRemovalChargeuint256value to be set as default for the key removal charge

setDefaultElRewardsStealingAdditionalFine

Set default value for the EL rewards stealing additional fine. Default value is used if a specific value is not set for the curveId

function setDefaultElRewardsStealingAdditionalFine(uint256 fine) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
fineuint256value to be set as default for the EL rewards stealing additional fine

setDefaultKeysLimit

Set default value for the keys limit. Default value is used if a specific value is not set for the curveId

function setDefaultKeysLimit(uint256 limit) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
limituint256value to be set as default for the keys limit

setDefaultRewardShare

Set default value for the reward share. Default value is used if a specific value is not set for the curveId

function setDefaultRewardShare(uint256 share) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
shareuint256value to be set as default for the reward share

setDefaultPerformanceLeeway

Set default value for the performance leeway. Default value is used if a specific value is not set for the curveId

function setDefaultPerformanceLeeway(uint256 leeway) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
leewayuint256value to be set as default for the performance leeway

setDefaultStrikesParams

Set default values for the strikes lifetime and threshold. Default values are used if specific values are not set for the curveId

function setDefaultStrikesParams(uint256 lifetime, uint256 threshold) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
lifetimeuint256The default number of CSM Performance Oracle frames to store strikes values
thresholduint256The default strikes value leading to validator force ejection.

setDefaultBadPerformancePenalty

Set default value for the bad performance penalty. Default value is used if a specific value is not set for the curveId

function setDefaultBadPerformancePenalty(uint256 penalty) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
penaltyuint256value to be set as default for the bad performance penalty

setDefaultPerformanceCoefficients

Set default values for the performance coefficients. Default values are used if specific values are not set for the curveId

function setDefaultPerformanceCoefficients(uint256 attestationsWeight, uint256 blocksWeight, uint256 syncWeight)
external
onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
attestationsWeightuint256value to be set as default for the attestations effectiveness weight
blocksWeightuint256value to be set as default for block proposals effectiveness weight
syncWeightuint256value to be set as default for sync participation effectiveness weight

setDefaultQueueConfig

Set default value for QueueConfig. Default value is used if a specific value is not set for the curveId.

function setDefaultQueueConfig(uint256 priority, uint256 maxDeposits) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
priorityuint256Queue priority.
maxDepositsuint256Maximum number of the fist deposits a Node Operator can get via the priority queue. Ex. with maxDeposits = 10 the Node Operator сan get keys added to the priority queue until the Node Operator has totalDepositedKeys + enqueued >= 10.

setDefaultAllowedExitDelay

set default value for allowed delay before the exit was initiated exit delay in seconds. Default value is used if a specific value is not set for the curveId

function setDefaultAllowedExitDelay(uint256 delay) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
delayuint256value to be set as default for the allowed exit delay

setDefaultExitDelayPenalty

set default value for exit delay penalty. Default value is used if a specific value is not set for the curveId

function setDefaultExitDelayPenalty(uint256 penalty) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
penaltyuint256value to be set as default for the exit delay penalty

setDefaultMaxWithdrawalRequestFee

set default value for max withdrawal request fee. Default value is used if a specific value is not set for the curveId

function setDefaultMaxWithdrawalRequestFee(uint256 fee) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
feeuint256value to be set as default for the max withdrawal request fee

setKeyRemovalCharge

Set key removal charge for the curveId.

function setKeyRemovalCharge(uint256 curveId, uint256 keyRemovalCharge) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to associate key removal charge with
keyRemovalChargeuint256Key removal charge

unsetKeyRemovalCharge

Unset key removal charge for the curveId

function unsetKeyRemovalCharge(uint256 curveId) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to unset custom key removal charge for

setElRewardsStealingAdditionalFine

Set EL rewards stealing additional fine for the curveId.

function setElRewardsStealingAdditionalFine(uint256 curveId, uint256 fine) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to associate EL rewards stealing additional fine limit with
fineuint256EL rewards stealing additional fine

unsetElRewardsStealingAdditionalFine

Unset EL rewards stealing additional fine for the curveId

function unsetElRewardsStealingAdditionalFine(uint256 curveId) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to unset custom EL rewards stealing additional fine for

setKeysLimit

Set keys limit for the curveId.

function setKeysLimit(uint256 curveId, uint256 limit) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to associate keys limit with
limituint256Keys limit

unsetKeysLimit

Unset key removal charge for the curveId

function unsetKeysLimit(uint256 curveId) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to unset custom key removal charge for

setRewardShareData

Set reward share parameters for the curveId

KeyNumberValueInterval = [[1, 10000], [11, 8000], [51, 5000]] stands for 100% rewards for the first 10 keys, 80% rewards for the keys 11-50, and 50% rewards for the keys > 50

function setRewardShareData(uint256 curveId, KeyNumberValueInterval[] calldata data)
external
onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to associate reward share data with
dataKeyNumberValueInterval[]Interval values for keys count and reward share percentages in BP (ex. [[1, 10000], [11, 8000], [51, 5000]])

unsetRewardShareData

Unset reward share parameters for the curveId

function unsetRewardShareData(uint256 curveId) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to unset custom reward share parameters for

setPerformanceLeewayData

Set performance leeway parameters for the curveId

Returns [[1, defaultPerformanceLeeway]] if no intervals are set for the given curveId.

function setPerformanceLeewayData(uint256 curveId, KeyNumberValueInterval[] calldata data)
external
onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to associate performance leeway data with
dataKeyNumberValueInterval[]Interval values for keys count and performance leeway percentages in BP (ex. [[1, 500], [101, 450], [501, 400]])

unsetPerformanceLeewayData

Unset performance leeway parameters for the curveId

function unsetPerformanceLeewayData(uint256 curveId) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to unset custom performance leeway parameters for

setStrikesParams

Set performance strikes lifetime and threshold for the curveId

function setStrikesParams(uint256 curveId, uint256 lifetime, uint256 threshold) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to associate performance strikes lifetime and threshold with
lifetimeuint256Number of CSM Performance Oracle frames to store strikes values
thresholduint256The strikes value leading to validator force ejection

unsetStrikesParams

Unset custom performance strikes lifetime and threshold for the curveId

function unsetStrikesParams(uint256 curveId) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to unset custom performance strikes lifetime and threshold for

setBadPerformancePenalty

Set bad performance penalty for the curveId

function setBadPerformancePenalty(uint256 curveId, uint256 penalty) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to associate bad performance penalty with
penaltyuint256Bad performance penalty

unsetBadPerformancePenalty

Unset bad performance penalty for the curveId

function unsetBadPerformancePenalty(uint256 curveId) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to unset custom bad performance penalty for

setPerformanceCoefficients

Set performance coefficients for the curveId

function setPerformanceCoefficients(
uint256 curveId,
uint256 attestationsWeight,
uint256 blocksWeight,
uint256 syncWeight
) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to associate performance coefficients with
attestationsWeightuint256Attestations effectiveness weight
blocksWeightuint256Block proposals effectiveness weight
syncWeightuint256Sync participation effectiveness weight

unsetPerformanceCoefficients

Unset custom performance coefficients for the curveId

function unsetPerformanceCoefficients(uint256 curveId) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to unset custom performance coefficients for

setQueueConfig

Sets the provided config to the given curve.

function setQueueConfig(uint256 curveId, uint256 priority, uint256 maxDeposits) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to set the config.
priorityuint256Queue priority.
maxDepositsuint256Maximum number of the fist deposits a Node Operator can get via the priority queue. Ex. with maxDeposits = 10 the Node Operator сan get keys added to the priority queue until the Node Operator has totalDepositedKeys + enqueued >= 10.

unsetQueueConfig

Set the given curve's config to the default one.

function unsetQueueConfig(uint256 curveId) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to unset custom config.

setAllowedExitDelay

Set allowed exit delay for the curveId in seconds

function setAllowedExitDelay(uint256 curveId, uint256 delay) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to associate allowed exit delay with
delayuint256allowed exit delay

unsetAllowedExitDelay

Unset exit timeframe deadline delay for the curveId

function unsetAllowedExitDelay(uint256 curveId) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to unset allowed exit delay for

setExitDelayPenalty

Set exit delay penalty for the curveId

cannot be zero

function setExitDelayPenalty(uint256 curveId, uint256 penalty) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to associate exit delay penalty with
penaltyuint256exit delay penalty

unsetExitDelayPenalty

Unset exit delay penalty for the curveId

function unsetExitDelayPenalty(uint256 curveId) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to unset exit delay penalty for

setMaxWithdrawalRequestFee

Set max withdrawal request fee for the curveId

function setMaxWithdrawalRequestFee(uint256 curveId, uint256 fee) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to associate max withdrawal request fee with
feeuint256max withdrawal request fee

unsetMaxWithdrawalRequestFee

Unset max withdrawal request fee for the curveId

function unsetMaxWithdrawalRequestFee(uint256 curveId) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
curveIduint256Curve Id to unset max withdrawal request fee for

getKeyRemovalCharge

Get key removal charge by the curveId. A charge is taken from the bond for each removed key from CSM

defaultKeyRemovalCharge is returned if the value is not set for the given curveId.

function getKeyRemovalCharge(uint256 curveId) external view returns (uint256 keyRemovalCharge);

Parameters

NameTypeDescription
curveIduint256Curve Id to get key removal charge for

Returns

NameTypeDescription
keyRemovalChargeuint256Key removal charge

getElRewardsStealingAdditionalFine

Get EL rewards stealing additional fine by the curveId. Additional fine is added to the EL rewards stealing penalty by CSM

defaultElRewardsStealingAdditionalFine is returned if the value is not set for the given curveId.

function getElRewardsStealingAdditionalFine(uint256 curveId) external view returns (uint256 fine);

Parameters

NameTypeDescription
curveIduint256Curve Id to get EL rewards stealing additional fine for

Returns

NameTypeDescription
fineuint256EL rewards stealing additional fine

getKeysLimit

Get keys limit by the curveId. A limit indicates the maximal amount of the non-exited keys Node Operator can upload

defaultKeysLimit is returned if the value is not set for the given curveId.

function getKeysLimit(uint256 curveId) external view returns (uint256 limit);

Parameters

NameTypeDescription
curveIduint256Curve Id to get keys limit for

Returns

NameTypeDescription
limituint256Keys limit

getRewardShareData

Get reward share parameters by the curveId.

Returns [[1, defaultRewardShare]] if no intervals are set for the given curveId.

function getRewardShareData(uint256 curveId) external view returns (KeyNumberValueInterval[] memory data);

Parameters

NameTypeDescription
curveIduint256Curve Id to get reward share data for

getPerformanceLeewayData

Get performance leeway parameters by the curveId

Returns [[1, defaultPerformanceLeeway]] if no intervals are set for the given curveId.

function getPerformanceLeewayData(uint256 curveId) external view returns (KeyNumberValueInterval[] memory data);

Parameters

NameTypeDescription
curveIduint256Curve Id to get performance leeway data for

getStrikesParams

Get performance strikes lifetime and threshold by the curveId

defaultStrikesParams are returned if the value is not set for the given curveId

function getStrikesParams(uint256 curveId) external view returns (uint256 lifetime, uint256 threshold);

Parameters

NameTypeDescription
curveIduint256Curve Id to get performance strikes lifetime and threshold for

Returns

NameTypeDescription
lifetimeuint256Number of CSM Performance Oracle frames to store strikes values
thresholduint256The strikes value leading to validator force ejection

getBadPerformancePenalty

Get bad performance penalty by the curveId

defaultBadPerformancePenalty is returned if the value is not set for the given curveId.

function getBadPerformancePenalty(uint256 curveId) external view returns (uint256 penalty);

Parameters

NameTypeDescription
curveIduint256Curve Id to get bad performance penalty for

Returns

NameTypeDescription
penaltyuint256Bad performance penalty

getPerformanceCoefficients

Get performance coefficients by the curveId

defaultPerformanceCoefficients are returned if the value is not set for the given curveId.

function getPerformanceCoefficients(uint256 curveId)
external
view
returns (uint256 attestationsWeight, uint256 blocksWeight, uint256 syncWeight);

Parameters

NameTypeDescription
curveIduint256Curve Id to get performance coefficients for

Returns

NameTypeDescription
attestationsWeightuint256Attestations effectiveness weight
blocksWeightuint256Block proposals effectiveness weight
syncWeightuint256Sync participation effectiveness weight

getQueueConfig

Get the queue config for the given curve.

function getQueueConfig(uint256 curveId) external view returns (uint32 queuePriority, uint32 maxDeposits);

Parameters

NameTypeDescription
curveIduint256Curve Id to get the queue config for.

Returns

NameTypeDescription
queuePriorityuint32priority Queue priority.
maxDepositsuint256Maximum number of the fist deposits a Node Operator can get via the priority queue. Ex. with maxDeposits = 10 the Node Operator сan get keys added to the priority queue until the Node Operator has totalDepositedKeys + enqueued >= 10.

getAllowedExitDelay

Get allowed exit delay by the curveId in seconds

defaultAllowedExitDelay is returned if the value is not set for the given curveId.

function getAllowedExitDelay(uint256 curveId) external view returns (uint256 delay);

Parameters

NameTypeDescription
curveIduint256Curve Id to get allowed exit delay for

getExitDelayPenalty

Get exit delay penalty by the curveId

defaultExitDelayPenalty is returned if the value is not set for the given curveId.

function getExitDelayPenalty(uint256 curveId) external view returns (uint256 penalty);

Parameters

NameTypeDescription
curveIduint256Curve Id to get exit delay penalty for

getMaxWithdrawalRequestFee

Get max withdrawal request fee by the curveId

defaultMaxWithdrawalRequestFee is returned if the value is not set for the given curveId.

function getMaxWithdrawalRequestFee(uint256 curveId) external view returns (uint256 fee);

Parameters

NameTypeDescription
curveIduint256Curve Id to get max withdrawal request fee for

getInitializedVersion

Returns the initialized version of the contract

function getInitializedVersion() external view returns (uint64);

Events

DefaultKeyRemovalChargeSet

event DefaultKeyRemovalChargeSet(uint256 value);

DefaultElRewardsStealingAdditionalFineSet

event DefaultElRewardsStealingAdditionalFineSet(uint256 value);

DefaultKeysLimitSet

event DefaultKeysLimitSet(uint256 value);

DefaultRewardShareSet

event DefaultRewardShareSet(uint256 value);

DefaultPerformanceLeewaySet

event DefaultPerformanceLeewaySet(uint256 value);

DefaultStrikesParamsSet

event DefaultStrikesParamsSet(uint256 lifetime, uint256 threshold);

DefaultBadPerformancePenaltySet

event DefaultBadPerformancePenaltySet(uint256 value);

DefaultPerformanceCoefficientsSet

event DefaultPerformanceCoefficientsSet(uint256 attestationsWeight, uint256 blocksWeight, uint256 syncWeight);

DefaultQueueConfigSet

event DefaultQueueConfigSet(uint256 priority, uint256 maxDeposits);

DefaultAllowedExitDelaySet

event DefaultAllowedExitDelaySet(uint256 delay);

DefaultExitDelayPenaltySet

event DefaultExitDelayPenaltySet(uint256 penalty);

DefaultMaxWithdrawalRequestFeeSet

event DefaultMaxWithdrawalRequestFeeSet(uint256 fee);

KeyRemovalChargeSet

event KeyRemovalChargeSet(uint256 indexed curveId, uint256 keyRemovalCharge);

ElRewardsStealingAdditionalFineSet

event ElRewardsStealingAdditionalFineSet(uint256 indexed curveId, uint256 fine);

KeysLimitSet

event KeysLimitSet(uint256 indexed curveId, uint256 limit);

RewardShareDataSet

event RewardShareDataSet(uint256 indexed curveId, KeyNumberValueInterval[] data);

PerformanceLeewayDataSet

event PerformanceLeewayDataSet(uint256 indexed curveId, KeyNumberValueInterval[] data);

StrikesParamsSet

event StrikesParamsSet(uint256 indexed curveId, uint256 lifetime, uint256 threshold);

BadPerformancePenaltySet

event BadPerformancePenaltySet(uint256 indexed curveId, uint256 penalty);

PerformanceCoefficientsSet

event PerformanceCoefficientsSet(
uint256 indexed curveId, uint256 attestationsWeight, uint256 blocksWeight, uint256 syncWeight
);

KeyRemovalChargeUnset

event KeyRemovalChargeUnset(uint256 indexed curveId);

ElRewardsStealingAdditionalFineUnset

event ElRewardsStealingAdditionalFineUnset(uint256 indexed curveId);

KeysLimitUnset

event KeysLimitUnset(uint256 indexed curveId);

RewardShareDataUnset

event RewardShareDataUnset(uint256 indexed curveId);

PerformanceLeewayDataUnset

event PerformanceLeewayDataUnset(uint256 indexed curveId);

StrikesParamsUnset

event StrikesParamsUnset(uint256 indexed curveId);

BadPerformancePenaltyUnset

event BadPerformancePenaltyUnset(uint256 indexed curveId);

PerformanceCoefficientsUnset

event PerformanceCoefficientsUnset(uint256 indexed curveId);

QueueConfigSet

event QueueConfigSet(uint256 indexed curveId, uint256 priority, uint256 maxDeposits);

QueueConfigUnset

event QueueConfigUnset(uint256 indexed curveId);

AllowedExitDelaySet

event AllowedExitDelaySet(uint256 indexed curveId, uint256 delay);

AllowedExitDelayUnset

event AllowedExitDelayUnset(uint256 indexed curveId);

ExitDelayPenaltySet

event ExitDelayPenaltySet(uint256 indexed curveId, uint256 penalty);

ExitDelayPenaltyUnset

event ExitDelayPenaltyUnset(uint256 indexed curveId);

MaxWithdrawalRequestFeeSet

event MaxWithdrawalRequestFeeSet(uint256 indexed curveId, uint256 fee);

MaxWithdrawalRequestFeeUnset

event MaxWithdrawalRequestFeeUnset(uint256 indexed curveId);