IOperatorsRegistryV1
Kiln
Operators Registry Interface (v1)
This interface exposes methods to handle the list of operators and their keys
Methods
addOperator
Adds an operator to the registry
Only callable by the administrator
Parameters
Name | Type | Description |
---|---|---|
_name | string | The name identifying the operator |
_operator | address | The address representing the operator, receiving the rewards |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The index of the new operator |
addValidators
Adds new keys for an operator
Only callable by the administrator or the operator address
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | The operator index |
_keyCount | uint256 | The amount of keys provided |
_publicKeysAndSignatures | bytes | Public keys of the validator, concatenated |
getOperator
Get operator details
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | The index of the operator |
Returns
Name | Type | Description |
---|---|---|
_0 | Operators.Operator | The details of the operator |
getOperatorCount
Get operator count
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The operator count |
getRiver
Retrieve the River address
Returns
Name | Type | Description |
---|---|---|
_0 | address | The address of River |
getValidator
Get the details of a validator
Parameters
Name | Type | Description |
---|---|---|
_operatorIndex | uint256 | The index of the operator |
_validatorIndex | uint256 | The index of the validator |
Returns
Name | Type | Description |
---|---|---|
publicKey | bytes | The public key of the validator |
signature | bytes | The signature used during deposit |
funded | bool | True if validator has been funded |
initOperatorsRegistryV1
Initializes the operators registry
Parameters
Name | Type | Description |
---|---|---|
_admin | address | Admin in charge of managing operators |
_river | address | Address of River system |
listActiveOperators
Retrieve the active operator set
Returns
Name | Type | Description |
---|---|---|
_0 | Operators.Operator[] | The list of active operators and their details |
pickNextValidators
Retrieve validator keys based on operator statuses
Parameters
Name | Type | Description |
---|---|---|
_count | uint256 | Max amount of keys requested |
Returns
Name | Type | Description |
---|---|---|
publicKeys | bytes[] | An array of public keys |
signatures | bytes[] | An array of signatures linked to the public keys |
removeValidators
Remove validator keys
Only callable by the administrator or the operator addressThe indexes must be provided sorted in decreasing order and duplicate-free, otherwise the method will revertThe operator limit will be set to the lowest deleted key index if the operator's limit wasn't equal to its total key countThe operator or the admin cannot remove funded keysWhen removing validators, the indexes of specific unfunded keys can be changed in order to properlyremove the keys from the storage array. Beware of this specific behavior when chaining calls as thetargeted public key indexes can point to a different key after a first call was made and performedsome swaps
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | The operator index |
_indexes | uint256[] | The indexes of the keys to remove |
setOperatorAddress
Changes the operator address of an operator
Only callable by the administrator or the previous operator address
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | The operator index |
_newOperatorAddress | address | The new address of the operator |
setOperatorLimits
Changes the operator staking limit
Only callable by the administratorThe operator indexes must be in increasing order and contain no duplicateThe limit cannot exceed the total key count of the operatorThe _indexes and _newLimits must have the same length.Each limit value is applied to the operator index at the same index in the _indexes array.
Parameters
Name | Type | Description |
---|---|---|
_operatorIndexes | uint256[] | The operator indexes, in increasing order and duplicate free |
_newLimits | uint256[] | The new staking limit of the operators |
_snapshotBlock | uint256 | The block number at which the snapshot was computed |
setOperatorName
Changes the operator name
Only callable by the administrator or the operator
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | The operator index |
_newName | string | The new operator name |
setOperatorStatus
Changes the operator status
Only callable by the administrator
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | The operator index |
_newStatus | bool | The new status of the operator |
setOperatorStoppedValidatorCount
Changes the operator stopped validator count
Only callable by the administrator
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | The operator index |
_newStoppedValidatorCount | uint256 | The new stopped validator count of the operator |
Events
AddedOperator
A new operator has been added to the registry
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | The operator index |
name | string | The operator display name |
operatorAddress | address | The operator address |
AddedValidatorKeys
The operator or the admin added new validator keys and signatures
The public keys and signatures are concatenatedA public key is 48 bytes longA signature is 96 bytes long[P1, S1, P2, S2, ..., PN, SN] where N is the bytes length divided by (96 + 48)
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | The operator index |
publicKeysAndSignatures | bytes | The concatenated public keys and signatures |
OperatorEditsAfterSnapshot
The operator edited its keys after the snapshot block
This means that we cannot assume that its key set is checked by the snapshotThis happens only if the limit was meant to be increased
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | The operator index |
currentLimit | uint256 | The current operator limit |
newLimit | uint256 | The new operator limit that was attempted to be set |
latestKeysEditBlockNumber | uint256 | The last block number at which the operator changed its keys |
snapshotBlock | uint256 | The block number of the snapshot |
OperatorLimitUnchanged
The call didn't alter the limit of the operator
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | The operator index |
limit | uint256 | The limit of the operator |
RemovedValidatorKey
The operator or the admin removed a public key and its signature from the registry
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | The operator index |
publicKey | bytes | The BLS public key that has been removed |
SetOperatorAddress
The operator address has been changed
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | The operator index |
newOperatorAddress | address | The new operator address |
SetOperatorLimit
The operator limit has been changed
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | The operator index |
newLimit | uint256 | The new operator staking limit |
SetOperatorName
The operator display name has been changed
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | The operator index |
newName | string | The new display name |
SetOperatorStatus
The operator status has been changed
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | The operator index |
active | bool | True if the operator is active |
SetOperatorStoppedValidatorCount
The operator stopped validator count has been changed
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | The operator index |
newStoppedValidatorCount | uint256 | The new stopped validator count |
SetRiver
The stored river address has been changed
Parameters
Name | Type | Description |
---|---|---|
river | address | The new river address |
Errors
InactiveOperator
The calling operator is inactive
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | The operator index |
InvalidArrayLengths
The provided operator and limits array have different lengths
InvalidEmptyArray
The provided operator and limits array are empty
InvalidFundedKeyDeletionAttempt
A funded key deletion has been attempted
InvalidIndexOutOfBounds
The index that is removed is out of bounds
InvalidKeyCount
The provided key count is 0
InvalidKeysLength
The provided concatenated keys do not have the expected length
InvalidUnsortedIndexes
The index provided are not sorted properly (descending order)
OperatorLimitTooHigh
The value for the operator limit is too high
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | The operator index |
limit | uint256 | The new limit provided |
keyCount | uint256 | The operator key count |
OperatorLimitTooLow
The value for the limit is too low
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | The operator index |
limit | uint256 | The new limit provided |
fundedKeyCount | uint256 | The operator funded key count |
UnorderedOperatorList
The provided list of operators is not in increasing order
Last updated