Skip to main content

NodeOperatorsRegistry

Node Operators act as validators on the Beacon chain for the benefit of the protocol. The DAO selects node operators and adds their addresses to the NodeOperatorsRegistry contract. Authorized operators have to generate a set of keys for the validation and also provide them with the smart contract. As Ether is received from users, it is distributed in chunks of 32 Ether between all active Node Operators. The contract contains a list of operators, their keys, and the logic for distributing rewards between them. The DAO can deactivate misbehaving operators.

View Methods#

getRewardsDistribution()#

Returns the rewards distribution proportional to the effective stake for each node operator

function getRewardsDistribution(uint256 _totalRewardShares) returns (
address[] recipients,
uint256[] shares
)

Parameters:#

NameTypeDescription
_totalRewardSharesuint256Total amount of reward shares to distribute

getActiveNodeOperatorsCount()#

Returns number of active node operators

function getActiveNodeOperatorsCount() returns (uint256)

getNodeOperator()#

Returns the n-th node operator

function getNodeOperator(uint256 _id, bool _fullInfo) returns (
bool active,
string name,
address rewardAddress,
uint64 stakingLimit,
uint64 stoppedValidators,
uint64 totalSigningKeys,
uint64 usedSigningKeys
)

Parameters:#

NameTypeDescription
_iduint256Node Operator id
_fullInfoboolIf true, name will be returned as well

getTotalSigningKeyCount()#

Returns total number of signing keys of the node operator

function getTotalSigningKeyCount(uint256 _operator_id) returns (uint256)

Parameters:#

NameTypeDescription
_operator_iduint256Node Operator id

getUnusedSigningKeyCount()#

Returns number of usable signing keys of the node operator

function getUnusedSigningKeyCount(uint256 _operator_id) returns (uint256)

Parameters:#

NameTypeDescription
_operator_iduint256Node Operator id

getSigningKey()#

Returns n-th signing key of the node operator

function getSigningKey(uint256 _operator_id, uint256 _index) returns (
bytes key,
bytes depositSignature,
bool used
)

Parameters:#

NameTypeDescription
_operator_iduint256Node Operator id
_indexuint256Index of the key, starting with 0d

Returns:#

NameTypeDescription
keybytesKey
depositSignaturebytesSignature needed for a depositContract.deposit call
usedboolFlag indication if the key was used in the staking

getNodeOperatorsCount()#

Returns total number of node operators

function getNodeOperatorsCount() returns (uint256)

Methods#

addNodeOperator()#

Add node operator named _name with reward address _rewardAddress and staking limit _stakingLimit

function addNodeOperator(
string _name,
address _rewardAddress,
uint64 _stakingLimit
) returns (uint256 id)

Parameters:#

NameTypeDescription
_namestringHuman-readable name
_rewardAddressaddressEthereum 1 address which receives stETH rewards for this operator
_stakingLimituint64The maximum number of validators to stake for this operator

Returns:#

NameTypeDescription
iduint256A unique key of the added operator

setNodeOperatorActive()#

Activate or disable node operator with given id

function setNodeOperatorActive(uint256 _id, bool _active)

Parameters:#

NameTypeDescription
_iduint256Node Operator id
_activeboolActivate or disable node operator

setNodeOperatorName()#

Change human-readable name of the node operator _id to _name

function setNodeOperatorName(uint256 _id, string _name)

Parameters:#

NameTypeDescription
_iduint256Node Operator id
_namestringHuman-readable name

setNodeOperatorRewardAddress()#

Change reward address of the node operator _id to _rewardAddress

function setNodeOperatorRewardAddress(uint256 _id, address _rewardAddress)

Parameters:#

NameTypeDescription
_iduint256Node Operator id
_rewardAddressaddressNew reward address

setNodeOperatorStakingLimit()#

Set the maximum number of validators to stake for the node operator _id to _stakingLimit

function setNodeOperatorStakingLimit(uint256 _id, uint64 _stakingLimit)

Parameters:#

NameTypeDescription
_iduint256Node Operator id
_stakingLimitaddressMax number of validators to stake

reportStoppedValidators()#

Report _stoppedIncrement more stopped validators of the node operator _id

function reportStoppedValidators(uint256 _id, uint64 _stoppedIncrement)

Parameters:#

NameTypeDescription
_iduint256Node Operator id
_stoppedIncrementuint64Count of stopped validators to increment

trimUnusedKeys()#

Remove unused signing keys

function trimUnusedKeys()
note

Function is used by the Lido contract

addSigningKeys()#

Add _quantity validator signing keys of operator _id to the set of usable keys. Concatenated keys are: _pubkeys. Can be done by the DAO in question by using the designated rewards address.

function addSigningKeys(
uint256 _operator_id,
uint256 _quantity,
bytes _pubkeys,
bytes _signatures
)
note

Along with each key the DAO has to provide a signatures for the (pubkey, withdrawal_credentials, 32000000000) message.

Given that information, the contract'll be able to call depositContract.deposit on-chain.

Parameters:#

NameTypeDescription
_operator_iduint256Node Operator id
_quantityuint64Number of signing keys provided
_pubkeysbytesSeveral concatenated validator signing keys
_signaturesbytesSeveral concatenated signatures for (pubkey, withdrawal_credentials, 32000000000) messages

addSigningKeysOperatorBH()#

Add _quantity validator signing keys of operator _id to the set of usable keys. Concatenated keys are: _pubkeys. Can be done by node operator in question by using the designated rewards address.

function addSigningKeysOperatorBH(
uint256 _operator_id,
uint256 _quantity,
bytes _pubkeys,
bytes _signatures
)
note

Along with each key the DAO has to provide a signatures for the (pubkey, withdrawal_credentials, 32000000000) message.

Given that information, the contract'll be able to call depositContract.deposit on-chain.

Parameters:#

NameTypeDescription
_operator_iduint256Node Operator id
_quantityuint64Number of signing keys provided
_pubkeysbytesSeveral concatenated validator signing keys
_signaturesbytesSeveral concatenated signatures for (pubkey, withdrawal_credentials, 32000000000) messages

removeSigningKey()#

Removes a validator signing key #_index of operator #_id from the set of usable keys. Executed on behalf of DAO.

function removeSigningKey(uint256 _operator_id, uint256 _index)

Parameters:#

NameTypeDescription
_operator_iduint256Node Operator id
_indexuint256Index of the key, starting with 0

removeSigningKeyOperatorBH()#

Removes a validator signing key _index of operator _id from the set of usable keys. Executed on behalf of Node Operator.

function removeSigningKeyOperatorBH(uint256 _operator_id, uint256 _index)

Parameters:#

NameTypeDescription
_operator_iduint256Node Operator id
_indexuint256Index of the key, starting with 0

assignNextSigningKeys()#

Selects and returns at most _numKeys signing keys (as well as the corresponding signatures) from the set of active keys and marks the selected keys as used. May only be called by the Lido contract.

function assignNextSigningKeys(uint256 _numKeys) returns (
bytes memory pubkeys,
bytes memory signatures
)

Parameters:#

NameTypeDescription
_pubkeysbytesThe number of keys to select. The actual number of selected keys may be less due to the lack of active keys.

Returns:#

NameTypeDescription
_pubkeysbytesSeveral concatenated validator signing keys
_signaturesbytesSeveral concatenated signatures for (pubkey, withdrawal_credentials, 32000000000) messages