IStakeRegistry
Inherits: IRegistry
Author: Layr Labs, Inc.
Functions
registerOperator
Registers the operator
with operatorId
for the specified quorumNumbers
.
access restricted to the RegistryCoordinator
*Preconditions (these are assumed, not validated in this contract):
quorumNumbers
has no duplicatesquorumNumbers.length
!= 0quorumNumbers
is ordered in ascending orderthe operator is not already registered*
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the operator to register. |
|
| The id of the operator to register. |
|
| The quorum numbers the operator is registering for, where each byte is an 8 bit integer quorumNumber. |
deregisterOperator
Deregisters the operator with operatorId
for the specified quorumNumbers
.
access restricted to the RegistryCoordinator
*Preconditions (these are assumed, not validated in this contract):
quorumNumbers
has no duplicatesquorumNumbers.length
!= 0quorumNumbers
is ordered in ascending orderthe operator is not already deregistered
quorumNumbers
is a subset of the quorumNumbers that the operator is registered for*
Parameters
Name | Type | Description |
---|---|---|
|
| The id of the operator to deregister. |
|
| The quorum numbers the operator is deregistering from, where each byte is an 8 bit integer quorumNumber. |
minimumStakeForQuorum
In order to register for a quorum i, an operator must have at least minimumStakeForQuorum[i]
getOperatorIdToStakeHistory
Returns the entire operatorIdToStakeHistory[operatorId][quorumNumber]
array.
Parameters
Name | Type | Description |
---|---|---|
|
| The id of the operator of interest. |
|
| The quorum number to get the stake for. |
getLengthOfTotalStakeHistoryForQuorum
getTotalStakeUpdateForQuorumFromIndex
Returns the index
-th entry in the dynamic array of total stake, totalStakeHistory
for quorum quorumNumber
.
Parameters
Name | Type | Description |
---|---|---|
|
| The quorum number to get the stake for. |
|
| Array index for lookup, within the dynamic array |
getStakeUpdateIndexForOperatorIdForQuorumAtBlockNumber
Returns the indices of the operator stakes for the provided quorumNumber
at the given blockNumber
getTotalStakeIndicesByQuorumNumbersAtBlockNumber
Returns the indices of the total stakes for the provided quorumNumbers
at the given blockNumber
getStakeUpdateForQuorumFromOperatorIdAndIndex
Returns the index
-th entry in the operatorIdToStakeHistory[operatorId][quorumNumber]
array.
Function will revert if index
is out-of-bounds.
Parameters
Name | Type | Description |
---|---|---|
|
| The quorum number to get the stake for. |
|
| The id of the operator of interest. |
|
| Array index for lookup, within the dynamic array |
getMostRecentStakeUpdateByOperatorId
Returns the most recent stake weight for the operatorId
for a certain quorum
Function returns an OperatorStakeUpdate struct with every entry equal to 0 in the event that the operator has no stake history
getStakeForQuorumAtBlockNumberFromOperatorIdAndIndex
Returns the stake weight corresponding to operatorId
for quorum quorumNumber
, at the index
-th entry in the operatorIdToStakeHistory[operatorId][quorumNumber]
array if the entry corresponds to the operator's stake at blockNumber
. Reverts otherwise.
Function will revert if index
is out-of-bounds.
used the BLSSignatureChecker to get past stakes of signing operators
Parameters
Name | Type | Description |
---|---|---|
|
| The quorum number to get the stake for. |
|
| Block number to make sure the stake is from. |
|
| The id of the operator of interest. |
|
| Array index for lookup, within the dynamic array |
getTotalStakeAtBlockNumberFromIndex
Returns the total stake weight for quorum quorumNumber
, at the index
-th entry in the totalStakeHistory[quorumNumber]
array if the entry corresponds to the total stake at blockNumber
. Reverts otherwise.
Function will revert if index
is out-of-bounds.
used the BLSSignatureChecker to get past stakes of signing operators
Parameters
Name | Type | Description |
---|---|---|
|
| The quorum number to get the stake for. |
|
| Block number to make sure the stake is from. |
|
| Array index for lookup, within the dynamic array |
getCurrentOperatorStakeForQuorum
Returns the most recent stake weight for the operatorId
for quorum quorumNumber
Function returns weight of 0 in the event that the operator has no stake history
getStakeForOperatorIdForQuorumAtBlockNumber
Returns the stake of the operator for the provided quorumNumber
at the given blockNumber
getCurrentTotalStakeForQuorum
Returns the stake weight from the latest entry in _totalStakeHistory
for quorum quorumNumber
.
Will revert if _totalStakeHistory[quorumNumber]
is empty.
updateStakes
Used for updating information on deposits of nodes.
Parameters
Name | Type | Description |
---|---|---|
|
| are the addresses of the operators whose stake information is getting updated |
Events
StakeUpdate
emitted whenever the stake of operator
is updated
MinimumStakeForQuorumUpdated
Structs
OperatorStakeUpdate
struct used to store the stakes of an individual operator or the sum of all operators' stakes, for storage
Last updated