ValidatorDetails
Modified from KRogLA's work for Lido.
State Variables
PUBKEY_LENGTH
The validator pubkey byte length.
SIGNATURE_LENGTH
The validator signature byte length.
UINT40_MAX
The maximum uint40 value.
Functions
computeStorageKeyOffset
Compute the storage key offset.
Parameters
Name | Type | Description |
---|---|---|
|
| The storage slot. |
|
| The operator ID. |
|
| The key index. |
saveValidatorDetails
Store operator details.
Parameters
Name | Type | Description |
---|---|---|
|
| The storage slot. |
|
| The operator ID. |
|
| The start index. |
|
| Keys count to load. |
|
| Keys buffer to read from. |
|
| Signatures buffer to read from. |
Returns
Name | Type | Description |
---|---|---|
|
| totalKeysCount New total keys count. |
swapValidatorDetails
Swap operator detail indexes in storage.
Parameters
Name | Type | Description |
---|---|---|
|
| The storage slot. |
|
| The operator ID. |
|
| The start index of the first set of keys. |
|
| The start index of the second set of keys. |
|
| Keys count to swap. |
removeValidatorDetails
Remove validator details from storage.
Parameters
Name | Type | Description |
---|---|---|
|
| The storage slot. |
|
| The Operator ID. |
|
| The start index. |
|
| Keys count to load. |
|
| Current total keys count for operator. |
Returns
Name | Type | Description |
---|---|---|
|
| totalKeysCount New total keys count. |
loadValidatorDetails
Load validator details from storage.
Parameters
Name | Type | Description |
---|---|---|
|
| The storage slot. |
|
| The operator ID. |
|
| The start index. |
|
| Keys count to load. |
|
| Pre-allocated key buffer to read in. |
|
| Pre-allocated signature buffer to read in. |
|
| start offset in |
allocateMemoryForPubKeys
Allocate memory for keyCount
public keys.
Parameters
Name | Type | Description |
---|---|---|
|
| The number of public keys. |
allocateMemory
Allocate memory for count
validator details.
Parameters
Name | Type | Description |
---|---|---|
|
| The number of validators. |
Events
ValidatorDetailsAdded
Emitted when a new validator signing key is added.
Parameters
Name | Type | Description |
---|---|---|
|
| The operator ID. |
|
| The validator public key. |
ValidatorDetailsRemoved
Emitted when a validator signing key is removed.
Parameters
Name | Type | Description |
---|---|---|
|
| The operator ID. |
|
| The validator public key. |
ValidatorDetailsSwapped
Emitted when the indexes of two validator signing keys are swapped.
Parameters
Name | Type | Description |
---|---|---|
|
| The operator ID. |
|
| The first validator public key. |
|
| The second validator public key. |
Errors
INVALID_KEYS_COUNT
Thrown when the number of keys is invalid.
INDEXES_OVERLAP
Thrown when the indexes of keys overlap.
LENGTH_MISMATCH
Thrown when the keys and signatures lengths mismatch.
EMPTY_KEY
Thrown when the key is empty.
Last updated