Skip to main content

Module IValidatorConfigV2

Module IValidatorConfigV2 

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:

  • active bool replaced by addedAtHeight and deactivatedAtHeight
  • No updateValidator - validators are immutable after creation
  • Requires Ed25519 signature on addValidator to 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§

AddressAlreadyHasValidator
Custom error with signature AddressAlreadyHasValidator() and selector 0x77a6ca7e.
AlreadyInitialized
Custom error with signature AlreadyInitialized() and selector 0x0dc149f0.
EmptyV1ValidatorSet
Custom error with signature EmptyV1ValidatorSet() and selector 0x77c218dd.
FeeRecipientUpdated
Event with signature FeeRecipientUpdated(uint64,address,address) and selector 0x22b6921469e5c41d4013782fda1738d3f501be71802a08377c25987f0a2a68c0.
IValidatorConfigV2Instance
A IValidatorConfigV2 instance.
IngressAlreadyExists
Custom error with signature IngressAlreadyExists(string) and selector 0x8591b353.
Initialized
Event with signature Initialized(uint64) and selector 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2.
InvalidMigrationIndex
Custom error with signature InvalidMigrationIndex() and selector 0x34e4bb70.
InvalidOwner
Custom error with signature InvalidOwner() and selector 0x49e27cff.
InvalidPublicKey
Custom error with signature InvalidPublicKey() and selector 0xa2d0fee8.
InvalidSignature
Custom error with signature InvalidSignature() and selector 0x8baa579f.
InvalidSignatureFormat
Custom error with signature InvalidSignatureFormat() and selector 0x8529df1f.
InvalidValidatorAddress
Custom error with signature InvalidValidatorAddress() and selector 0x713ce511.
IpAddressesUpdated
Event with signature IpAddressesUpdated(uint64,string,string,address) and selector 0x241dec1e5ad7db0fa5d3d80c9fb8362e665dd623a4453decff244990e5db64b4.
MigrationNotComplete
Custom error with signature MigrationNotComplete() and selector 0xcf45835b.
NetworkIdentityRotationEpochSet
Event with signature NetworkIdentityRotationEpochSet(uint64,uint64) and selector 0x713bea732fe97c115b54c1b99ac96d7439806000ff4970322cc60f240180e3d0.
NotInitialized
Custom error with signature NotInitialized() and selector 0x87138d5c.
NotIp
Custom error with signature NotIp(string,string) and selector 0xda00093e.
NotIpPort
Custom error with signature NotIpPort(string,string) and selector 0x443ba5f5.
OwnershipTransferred
Event with signature OwnershipTransferred(address,address) and selector 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
PublicKeyAlreadyExists
Custom error with signature PublicKeyAlreadyExists() and selector 0xbfa96094.
SkippedValidatorMigration
Event with signature SkippedValidatorMigration(uint64,address,bytes32) and selector 0xacac4fb2a24744049568d5be18ddc954871a3c8e805ee63a438e15e7490b908d.
Unauthorized
Custom error with signature Unauthorized() and selector 0x82b42900.
Validator
Validator information
ValidatorAdded
Event with signature ValidatorAdded(uint64,address,bytes32,string,string,address) and selector 0x2f013b45d5e1f23545bf878cd3fd902f5a327541c96f83fc826a2d9bb25d79a1.
ValidatorAlreadyDeactivated
Custom error with signature ValidatorAlreadyDeactivated() and selector 0xfb1ba7c3.
ValidatorDeactivated
Event with signature ValidatorDeactivated(uint64,address) and selector 0x67d2695de7744d47781e04f4e6e3c98540bd3efdf5eba283c32734701cf0d240.
ValidatorMigrated
Event with signature ValidatorMigrated(uint64,address,bytes32) and selector 0x2e1e3dd2e695e031b81bb15d615eed5ff5ccd3f3334a6181e52dc878473b859c.
ValidatorNotFound
Custom error with signature ValidatorNotFound() and selector 0x580e542f.
ValidatorOwnershipTransferred
Event with signature ValidatorOwnershipTransferred(uint64,address,address,address) and selector 0x424eaa11c8177b4916856bb34ad6fb8843c76b6c3a3ef340925dc733e3203fac.
ValidatorRotated
Event with signature ValidatorRotated(uint64,uint64,address,bytes32,bytes32,string,string,address) and selector 0x1068b9f6c5935b37af967e63040bf1a8540171c0bd0255180625784b00f5dd3b.
addValidatorCall
Add a new validator (owner only) Function with signature addValidator(address,bytes32,string,string,address,bytes) and selector 0x6dcf616a.
addValidatorReturn
Add a new validator (owner only) Container type for the return parameters of the addValidator(address,bytes32,string,string,address,bytes) function.
deactivateValidatorCall
Deactivate a validator (owner or validator) Function with signature deactivateValidator(uint64) and selector 0x8f289544.
deactivateValidatorReturn
Deactivate a validator (owner or validator) Container type for the return parameters of the deactivateValidator(uint64) function.
getActiveValidatorsCall
Get only active validators (deactivatedAtHeight == 0) Function with signature getActiveValidators() and selector 0x9de70258.
getActiveValidatorsReturn
Get only active validators (deactivatedAtHeight == 0) Container type for the return parameters of the getActiveValidators() function.
getInitializedAtHeightCall
Get the block height at which the contract was initialized Function with signature getInitializedAtHeight() and selector 0xf926b083.
getInitializedAtHeightReturn
Get the block height at which the contract was initialized Container type for the return parameters of the getInitializedAtHeight() function.
getNextNetworkIdentityRotationEpochCall
Get the epoch for next network identity rotation (full DKG ceremony) Function with signature getNextNetworkIdentityRotationEpoch() and selector 0x42739f79.
getNextNetworkIdentityRotationEpochReturn
Get the epoch for next network identity rotation (full DKG ceremony) Container type for the return parameters of the getNextNetworkIdentityRotationEpoch() function.
initializeIfMigratedCall
Initialize V2 after migration (owner only) Function with signature initializeIfMigrated() and selector 0x2f88bb4f.
initializeIfMigratedReturn
Initialize V2 after migration (owner only) Container type for the return parameters of the initializeIfMigrated() function.
isInitializedCall
Check if V2 has been initialized Function with signature isInitialized() and selector 0x392e53cd.
isInitializedReturn
Check if V2 has been initialized Container type for the return parameters of the isInitialized() function.
migrateValidatorCall
Migrate a single validator from V1 (owner only) Function with signature migrateValidator(uint64) and selector 0xc8e73200.
migrateValidatorReturn
Migrate a single validator from V1 (owner only) Container type for the return parameters of the migrateValidator(uint64) function.
ownerCall
Get the contract owner Function with signature owner() and selector 0x8da5cb5b.
ownerReturn
Get the contract owner Container type for the return parameters of the owner() function.
rotateValidatorCall
Rotate a validator to new identity (owner or validator) Function with signature rotateValidator(uint64,bytes32,string,string,bytes) and selector 0x82f20dbe.
rotateValidatorReturn
Rotate a validator to new identity (owner or validator) Container type for the return parameters of the rotateValidator(uint64,bytes32,string,string,bytes) function.
setFeeRecipientCall
Update fee recipient. Function with signature setFeeRecipient(uint64,address) and selector 0x572e4068.
setFeeRecipientReturn
Update fee recipient. Container type for the return parameters of the setFeeRecipient(uint64,address) function.
setIpAddressesCall
Update IP addresses (owner or validator) Function with signature setIpAddresses(uint64,string,string) and selector 0x55f25dc6.
setIpAddressesReturn
Update IP addresses (owner or validator) Container type for the return parameters of the setIpAddresses(uint64,string,string) function.
setNetworkIdentityRotationEpochCall
Set the epoch for next network identity rotation via full DKG ceremony (owner only) Function with signature setNetworkIdentityRotationEpoch(uint64) and selector 0xcb8425d2.
setNetworkIdentityRotationEpochReturn
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.
transferOwnershipCall
Transfer contract ownership (owner only) Function with signature transferOwnership(address) and selector 0xf2fde38b.
transferOwnershipReturn
Transfer contract ownership (owner only) Container type for the return parameters of the transferOwnership(address) function.
transferValidatorOwnershipCall
Transfer validator ownership to new address (owner or validator) Function with signature transferValidatorOwnership(uint64,address) and selector 0x9e38a5f1.
transferValidatorOwnershipReturn
Transfer validator ownership to new address (owner or validator) Container type for the return parameters of the transferValidatorOwnership(uint64,address) function.
validatorByAddressCall
Get validator by address Function with signature validatorByAddress(address) and selector 0x1a6dda94.
validatorByAddressReturn
Get validator by address Container type for the return parameters of the validatorByAddress(address) function.
validatorByIndexCall
Get validator by index Function with signature validatorByIndex(uint64) and selector 0xecb14a34.
validatorByIndexReturn
Get validator by index Container type for the return parameters of the validatorByIndex(uint64) function.
validatorByPublicKeyCall
Get validator by public key Function with signature validatorByPublicKey(bytes32) and selector 0x1b425d5e.
validatorByPublicKeyReturn
Get validator by public key Container type for the return parameters of the validatorByPublicKey(bytes32) function.
validatorCountCall
Get total count of validators ever added (including deactivated) Function with signature validatorCount() and selector 0x0f43a677.
validatorCountReturn
Get total count of validators ever added (including deactivated) Container type for the return parameters of the validatorCount() function.

Enums§

IValidatorConfigV2Calls
Container for all the IValidatorConfigV2 function calls.
IValidatorConfigV2Errors
Container for all the IValidatorConfigV2 custom errors.
IValidatorConfigV2Events
Container for all the IValidatorConfigV2 events.

Functions§

new
Creates a new wrapper around an on-chain IValidatorConfigV2 contract instance.