Expand description
Validator Config V2 interface for managing consensus validators with append-only, delete-once semantics.
V2 uses an append-only design that eliminates the need for historical state access during node recovery. Validators are immutable after creation and can only be deleted once.
Key differences from V1:
activebool replaced byaddedAtHeightanddeactivatedAtHeight- No
updateValidator- validators are immutable after creation - Requires Ed25519 signature on
addValidatorto prove key ownership - Both address and public key must be unique across all validators (including deleted)
interface IValidatorConfigV2 {
struct Validator { bytes32 publicKey; address validatorAddress; string ingress; string egress; address feeRecipient; uint64 index; uint64 addedAtHeight; uint64 deactivatedAtHeight; }
function getActiveValidators() external view returns (Validator[] memory validators);
function getInitializedAtHeight() external view returns (uint64);
function owner() external view returns (address);
function validatorCount() external view returns (uint64);
function validatorByIndex(uint64 index) external view returns (Validator memory);
function validatorByAddress(address validatorAddress) external view returns (Validator memory);
function validatorByPublicKey(bytes32 publicKey) external view returns (Validator memory);
function getNextNetworkIdentityRotationEpoch() external view returns (uint64);
function isInitialized() external view returns (bool);
function addValidator(address validatorAddress, bytes32 publicKey, string calldata ingress, string calldata egress, address feeRecipient, bytes calldata signature) external returns (uint64 index);
function deactivateValidator(uint64 idx) external;
function rotateValidator(uint64 idx, bytes32 publicKey, string calldata ingress, string calldata egress, bytes calldata signature) external;
function setFeeRecipient(uint64 idx, address feeRecipient) external;
function setIpAddresses(uint64 idx, string calldata ingress, string calldata egress) external;
function transferValidatorOwnership(uint64 idx, address newAddress) external;
function transferOwnership(address newOwner) external;
function setNetworkIdentityRotationEpoch(uint64 epoch) external;
function migrateValidator(uint64 idx) external;
function initializeIfMigrated() external;
event ValidatorAdded(uint64 indexed index, address indexed validatorAddress, bytes32 publicKey, string ingress, string egress, address feeRecipient);
event ValidatorDeactivated(uint64 indexed index, address indexed validatorAddress);
event ValidatorRotated(uint64 indexed index, uint64 indexed deactivatedIndex, address indexed validatorAddress, bytes32 oldPublicKey, bytes32 newPublicKey, string ingress, string egress, address caller);
event FeeRecipientUpdated(uint64 indexed index, address feeRecipient, address caller);
event IpAddressesUpdated(uint64 indexed index, string ingress, string egress, address caller);
event ValidatorOwnershipTransferred(uint64 indexed index, address indexed oldAddress, address indexed newAddress, address caller);
event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);
event ValidatorMigrated(uint64 indexed index, address indexed validatorAddress, bytes32 publicKey);
event NetworkIdentityRotationEpochSet(uint64 indexed previousEpoch, uint64 indexed nextEpoch);
event Initialized(uint64 height);
event SkippedValidatorMigration(uint64 indexed index, address indexed validatorAddress, bytes32 publicKey);
error AlreadyInitialized();
error IngressAlreadyExists(string ingress);
error EmptyV1ValidatorSet();
error InvalidMigrationIndex();
error InvalidOwner();
error InvalidPublicKey();
error InvalidSignature();
error InvalidSignatureFormat();
error InvalidValidatorAddress();
error MigrationNotComplete();
error NotInitialized();
error NotIp(string input, string backtrace);
error NotIpPort(string input, string backtrace);
error PublicKeyAlreadyExists();
error Unauthorized();
error AddressAlreadyHasValidator();
error ValidatorAlreadyDeactivated();
error ValidatorNotFound();
}Modules§
- abi
- Contains dynamic ABI definitions for this contract.
Structs§
- Address
Already HasValidator - Custom error with signature
AddressAlreadyHasValidator()and selector0x77a6ca7e. - Already
Initialized - Custom error with signature
AlreadyInitialized()and selector0x0dc149f0. - Empty
V1Validator Set - Custom error with signature
EmptyV1ValidatorSet()and selector0x77c218dd. - FeeRecipient
Updated - Event with signature
FeeRecipientUpdated(uint64,address,address)and selector0x22b6921469e5c41d4013782fda1738d3f501be71802a08377c25987f0a2a68c0. - IValidator
Config V2Instance - A
IValidatorConfigV2instance. - Ingress
Already Exists - Custom error with signature
IngressAlreadyExists(string)and selector0x8591b353. - Initialized
- Event with signature
Initialized(uint64)and selector0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. - Invalid
Migration Index - Custom error with signature
InvalidMigrationIndex()and selector0x34e4bb70. - Invalid
Owner - Custom error with signature
InvalidOwner()and selector0x49e27cff. - Invalid
Public Key - Custom error with signature
InvalidPublicKey()and selector0xa2d0fee8. - Invalid
Signature - Custom error with signature
InvalidSignature()and selector0x8baa579f. - Invalid
Signature Format - Custom error with signature
InvalidSignatureFormat()and selector0x8529df1f. - Invalid
Validator Address - Custom error with signature
InvalidValidatorAddress()and selector0x713ce511. - IpAddresses
Updated - Event with signature
IpAddressesUpdated(uint64,string,string,address)and selector0x241dec1e5ad7db0fa5d3d80c9fb8362e665dd623a4453decff244990e5db64b4. - Migration
NotComplete - Custom error with signature
MigrationNotComplete()and selector0xcf45835b. - Network
Identity Rotation Epoch Set - Event with signature
NetworkIdentityRotationEpochSet(uint64,uint64)and selector0x713bea732fe97c115b54c1b99ac96d7439806000ff4970322cc60f240180e3d0. - NotInitialized
- Custom error with signature
NotInitialized()and selector0x87138d5c. - NotIp
- Custom error with signature
NotIp(string,string)and selector0xda00093e. - NotIp
Port - Custom error with signature
NotIpPort(string,string)and selector0x443ba5f5. - Ownership
Transferred - Event with signature
OwnershipTransferred(address,address)and selector0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. - Public
KeyAlready Exists - Custom error with signature
PublicKeyAlreadyExists()and selector0xbfa96094. - Skipped
Validator Migration - Event with signature
SkippedValidatorMigration(uint64,address,bytes32)and selector0xacac4fb2a24744049568d5be18ddc954871a3c8e805ee63a438e15e7490b908d. - Unauthorized
- Custom error with signature
Unauthorized()and selector0x82b42900. - Validator
- Validator information
- Validator
Added - Event with signature
ValidatorAdded(uint64,address,bytes32,string,string,address)and selector0x2f013b45d5e1f23545bf878cd3fd902f5a327541c96f83fc826a2d9bb25d79a1. - Validator
Already Deactivated - Custom error with signature
ValidatorAlreadyDeactivated()and selector0xfb1ba7c3. - Validator
Deactivated - Event with signature
ValidatorDeactivated(uint64,address)and selector0x67d2695de7744d47781e04f4e6e3c98540bd3efdf5eba283c32734701cf0d240. - Validator
Migrated - Event with signature
ValidatorMigrated(uint64,address,bytes32)and selector0x2e1e3dd2e695e031b81bb15d615eed5ff5ccd3f3334a6181e52dc878473b859c. - Validator
NotFound - Custom error with signature
ValidatorNotFound()and selector0x580e542f. - Validator
Ownership Transferred - Event with signature
ValidatorOwnershipTransferred(uint64,address,address,address)and selector0x424eaa11c8177b4916856bb34ad6fb8843c76b6c3a3ef340925dc733e3203fac. - Validator
Rotated - Event with signature
ValidatorRotated(uint64,uint64,address,bytes32,bytes32,string,string,address)and selector0x1068b9f6c5935b37af967e63040bf1a8540171c0bd0255180625784b00f5dd3b. - addValidator
Call - Add a new validator (owner only)
Function with signature
addValidator(address,bytes32,string,string,address,bytes)and selector0x6dcf616a. - addValidator
Return - Add a new validator (owner only)
Container type for the return parameters of the
addValidator(address,bytes32,string,string,address,bytes)function. - deactivate
Validator Call - Deactivate a validator (owner or validator)
Function with signature
deactivateValidator(uint64)and selector0x8f289544. - deactivate
Validator Return - Deactivate a validator (owner or validator)
Container type for the return parameters of the
deactivateValidator(uint64)function. - getActive
Validators Call - Get only active validators (deactivatedAtHeight == 0)
Function with signature
getActiveValidators()and selector0x9de70258. - getActive
Validators Return - Get only active validators (deactivatedAtHeight == 0)
Container type for the return parameters of the
getActiveValidators()function. - getInitialized
AtHeight Call - Get the block height at which the contract was initialized
Function with signature
getInitializedAtHeight()and selector0xf926b083. - getInitialized
AtHeight Return - Get the block height at which the contract was initialized
Container type for the return parameters of the
getInitializedAtHeight()function. - getNext
Network Identity Rotation Epoch Call - Get the epoch for next network identity rotation (full DKG ceremony)
Function with signature
getNextNetworkIdentityRotationEpoch()and selector0x42739f79. - getNext
Network Identity Rotation Epoch Return - Get the epoch for next network identity rotation (full DKG ceremony)
Container type for the return parameters of the
getNextNetworkIdentityRotationEpoch()function. - initialize
IfMigrated Call - Initialize V2 after migration (owner only)
Function with signature
initializeIfMigrated()and selector0x2f88bb4f. - initialize
IfMigrated Return - Initialize V2 after migration (owner only)
Container type for the return parameters of the
initializeIfMigrated()function. - isInitialized
Call - Check if V2 has been initialized
Function with signature
isInitialized()and selector0x392e53cd. - isInitialized
Return - Check if V2 has been initialized
Container type for the return parameters of the
isInitialized()function. - migrate
Validator Call - Migrate a single validator from V1 (owner only)
Function with signature
migrateValidator(uint64)and selector0xc8e73200. - migrate
Validator Return - Migrate a single validator from V1 (owner only)
Container type for the return parameters of the
migrateValidator(uint64)function. - owner
Call - Get the contract owner
Function with signature
owner()and selector0x8da5cb5b. - owner
Return - Get the contract owner
Container type for the return parameters of the
owner()function. - rotate
Validator Call - Rotate a validator to new identity (owner or validator)
Function with signature
rotateValidator(uint64,bytes32,string,string,bytes)and selector0x82f20dbe. - rotate
Validator Return - Rotate a validator to new identity (owner or validator)
Container type for the return parameters of the
rotateValidator(uint64,bytes32,string,string,bytes)function. - setFee
Recipient Call - Update fee recipient.
Function with signature
setFeeRecipient(uint64,address)and selector0x572e4068. - setFee
Recipient Return - Update fee recipient.
Container type for the return parameters of the
setFeeRecipient(uint64,address)function. - setIp
Addresses Call - Update IP addresses (owner or validator)
Function with signature
setIpAddresses(uint64,string,string)and selector0x55f25dc6. - setIp
Addresses Return - Update IP addresses (owner or validator)
Container type for the return parameters of the
setIpAddresses(uint64,string,string)function. - setNetwork
Identity Rotation Epoch Call - Set the epoch for next network identity rotation via full DKG ceremony (owner only)
Function with signature
setNetworkIdentityRotationEpoch(uint64)and selector0xcb8425d2. - setNetwork
Identity Rotation Epoch Return - Set the epoch for next network identity rotation via full DKG ceremony (owner only)
Container type for the return parameters of the
setNetworkIdentityRotationEpoch(uint64)function. - transfer
Ownership Call - Transfer contract ownership (owner only)
Function with signature
transferOwnership(address)and selector0xf2fde38b. - transfer
Ownership Return - Transfer contract ownership (owner only)
Container type for the return parameters of the
transferOwnership(address)function. - transfer
Validator Ownership Call - Transfer validator ownership to new address (owner or validator)
Function with signature
transferValidatorOwnership(uint64,address)and selector0x9e38a5f1. - transfer
Validator Ownership Return - Transfer validator ownership to new address (owner or validator)
Container type for the return parameters of the
transferValidatorOwnership(uint64,address)function. - validator
ByAddress Call - Get validator by address
Function with signature
validatorByAddress(address)and selector0x1a6dda94. - validator
ByAddress Return - Get validator by address
Container type for the return parameters of the
validatorByAddress(address)function. - validator
ByIndex Call - Get validator by index
Function with signature
validatorByIndex(uint64)and selector0xecb14a34. - validator
ByIndex Return - Get validator by index
Container type for the return parameters of the
validatorByIndex(uint64)function. - validator
ByPublic KeyCall - Get validator by public key
Function with signature
validatorByPublicKey(bytes32)and selector0x1b425d5e. - validator
ByPublic KeyReturn - Get validator by public key
Container type for the return parameters of the
validatorByPublicKey(bytes32)function. - validator
Count Call - Get total count of validators ever added (including deactivated)
Function with signature
validatorCount()and selector0x0f43a677. - validator
Count Return - Get total count of validators ever added (including deactivated)
Container type for the return parameters of the
validatorCount()function.
Enums§
- IValidator
Config V2Calls - Container for all the
IValidatorConfigV2function calls. - IValidator
Config V2Errors - Container for all the
IValidatorConfigV2custom errors. - IValidator
Config V2Events - Container for all the
IValidatorConfigV2events.
Functions§
- new
- Creates a new wrapper around an on-chain
IValidatorConfigV2contract instance.