IOperatorsRegistryV1

Kiln

Operators Registry Interface (v1)

This interface exposes methods to handle the list of operators and their keys

Methods

addOperator

function addOperator(string _name, address _operator) external nonpayable returns (uint256)

Adds an operator to the registry

Only callable by the administrator

Parameters

Returns

addValidators

function addValidators(uint256 _index, uint256 _keyCount, bytes _publicKeysAndSignatures) external nonpayable

Adds new keys for an operator

Only callable by the administrator or the operator address

Parameters

getOperator

function getOperator(uint256 _index) external view returns (struct Operators.Operator)

Get operator details

Parameters

Returns

getOperatorCount

function getOperatorCount() external view returns (uint256)

Get operator count

Returns

getRiver

function getRiver() external view returns (address)

Retrieve the River address

Returns

getValidator

function getValidator(uint256 _operatorIndex, uint256 _validatorIndex) external view returns (bytes publicKey, bytes signature, bool funded)

Get the details of a validator

Parameters

Returns

initOperatorsRegistryV1

function initOperatorsRegistryV1(address _admin, address _river) external nonpayable

Initializes the operators registry

Parameters

listActiveOperators

function listActiveOperators() external view returns (struct Operators.Operator[])

Retrieve the active operator set

Returns

pickNextValidators

function pickNextValidators(uint256 _count) external nonpayable returns (bytes[] publicKeys, bytes[] signatures)

Retrieve validator keys based on operator statuses

Parameters

Returns

removeValidators

function removeValidators(uint256 _index, uint256[] _indexes) external nonpayable

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

setOperatorAddress

function setOperatorAddress(uint256 _index, address _newOperatorAddress) external nonpayable

Changes the operator address of an operator

Only callable by the administrator or the previous operator address

Parameters

setOperatorLimits

function setOperatorLimits(uint256[] _operatorIndexes, uint256[] _newLimits, uint256 _snapshotBlock) external nonpayable

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

setOperatorName

function setOperatorName(uint256 _index, string _newName) external nonpayable

Changes the operator name

Only callable by the administrator or the operator

Parameters

setOperatorStatus

function setOperatorStatus(uint256 _index, bool _newStatus) external nonpayable

Changes the operator status

Only callable by the administrator

Parameters

setOperatorStoppedValidatorCount

function setOperatorStoppedValidatorCount(uint256 _index, uint256 _newStoppedValidatorCount) external nonpayable

Changes the operator stopped validator count

Only callable by the administrator

Parameters

Events

AddedOperator

event AddedOperator(uint256 indexed index, string name, address indexed operatorAddress)

A new operator has been added to the registry

Parameters

AddedValidatorKeys

event AddedValidatorKeys(uint256 indexed index, bytes publicKeysAndSignatures)

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

OperatorEditsAfterSnapshot

event OperatorEditsAfterSnapshot(uint256 indexed index, uint256 currentLimit, uint256 newLimit, uint256 indexed latestKeysEditBlockNumber, uint256 indexed snapshotBlock)

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

OperatorLimitUnchanged

event OperatorLimitUnchanged(uint256 indexed index, uint256 limit)

The call didn't alter the limit of the operator

Parameters

RemovedValidatorKey

event RemovedValidatorKey(uint256 indexed index, bytes publicKey)

The operator or the admin removed a public key and its signature from the registry

Parameters

SetOperatorAddress

event SetOperatorAddress(uint256 indexed index, address indexed newOperatorAddress)

The operator address has been changed

Parameters

SetOperatorLimit

event SetOperatorLimit(uint256 indexed index, uint256 newLimit)

The operator limit has been changed

Parameters

SetOperatorName

event SetOperatorName(uint256 indexed index, string newName)

The operator display name has been changed

Parameters

SetOperatorStatus

event SetOperatorStatus(uint256 indexed index, bool active)

The operator status has been changed

Parameters

SetOperatorStoppedValidatorCount

event SetOperatorStoppedValidatorCount(uint256 indexed index, uint256 newStoppedValidatorCount)

The operator stopped validator count has been changed

Parameters

SetRiver

event SetRiver(address indexed river)

The stored river address has been changed

Parameters

Errors

InactiveOperator

error InactiveOperator(uint256 index)

The calling operator is inactive

Parameters

InvalidArrayLengths

error InvalidArrayLengths()

The provided operator and limits array have different lengths

InvalidEmptyArray

error InvalidEmptyArray()

The provided operator and limits array are empty

InvalidFundedKeyDeletionAttempt

error InvalidFundedKeyDeletionAttempt()

A funded key deletion has been attempted

InvalidIndexOutOfBounds

error InvalidIndexOutOfBounds()

The index that is removed is out of bounds

InvalidKeyCount

error InvalidKeyCount()

The provided key count is 0

InvalidKeysLength

error InvalidKeysLength()

The provided concatenated keys do not have the expected length

InvalidUnsortedIndexes

error InvalidUnsortedIndexes()

The index provided are not sorted properly (descending order)

OperatorLimitTooHigh

error OperatorLimitTooHigh(uint256 index, uint256 limit, uint256 keyCount)

The value for the operator limit is too high

Parameters

OperatorLimitTooLow

error OperatorLimitTooLow(uint256 index, uint256 limit, uint256 fundedKeyCount)

The value for the limit is too low

Parameters

UnorderedOperatorList

error UnorderedOperatorList()

The provided list of operators is not in increasing order

Last updated