Module IValidatorConfig
Expand description
Validator config interface for managing consensus validators.
This precompile manages the set of validators that participate in consensus. Validators can update their own information, rotate their identity to a new address, and the owner can manage validator status.
interface IValidatorConfig {
struct Validator { bytes32 publicKey; bool active; uint64 index; address validatorAddress; string inboundAddress; string outboundAddress; }
function getValidators() external view returns (Validator[] memory validators);
function addValidator(address newValidatorAddress, bytes32 publicKey, bool active, string calldata inboundAddress, string calldata outboundAddress) external;
function updateValidator(address newValidatorAddress, bytes32 publicKey, string calldata inboundAddress, string calldata outboundAddress) external;
function changeValidatorStatus(address validator, bool active) external;
function changeValidatorStatusByIndex(uint64 index, bool active) external;
function owner() external view returns (address);
function changeOwner(address newOwner) external;
function getNextFullDkgCeremony() external view returns (uint64);
function setNextFullDkgCeremony(uint64 epoch) external;
function validatorsArray(uint256 index) external view returns (address);
function validators(address validator) external view returns (Validator memory);
function validatorCount() external view returns (uint64);
error Unauthorized();
error ValidatorAlreadyExists();
error ValidatorNotFound();
error InvalidPublicKey();
error NotHostPort(string field, string input, string backtrace);
error NotIpPort(string field, string input, string backtrace);
}Modules§
- abi
- Contains dynamic ABI definitions for this contract.
Structs§
- IValidator
Config Instance - A
IValidatorConfiginstance. - Invalid
Public Key - Custom error with signature
InvalidPublicKey()and selector0xa2d0fee8. - NotHost
Port - Custom error with signature
NotHostPort(string,string,string)and selector0xad764df2. - NotIp
Port - Custom error with signature
NotIpPort(string,string,string)and selector0x89ac2be7. - Unauthorized
- Custom error with signature
Unauthorized()and selector0x82b42900. - Validator
- Validator information
- Validator
Already Exists - Custom error with signature
ValidatorAlreadyExists()and selector0x8d09a73e. - Validator
NotFound - Custom error with signature
ValidatorNotFound()and selector0x580e542f. - addValidator
Call - Add a new validator (owner only)
@param newValidatorAddress The address of the new validator
@param publicKey The validator’s communication public publicKey
@param inboundAddress The validator’s inbound address
<hostname|ip>:<port>for incoming connections @param outboundAddress The validator’s outbound IP address<ip>:<port>for firewall whitelisting (IP only, no hostnames) Function with signatureaddValidator(address,bytes32,bool,string,string)and selector0xffb4822e. - addValidator
Return - Add a new validator (owner only)
@param newValidatorAddress The address of the new validator
@param publicKey The validator’s communication public publicKey
@param inboundAddress The validator’s inbound address
<hostname|ip>:<port>for incoming connections @param outboundAddress The validator’s outbound IP address<ip>:<port>for firewall whitelisting (IP only, no hostnames) Container type for the return parameters of theaddValidator(address,bytes32,bool,string,string)function. - change
Owner Call - Change owner
@param newOwner The new owner address
Function with signature
changeOwner(address)and selector0xa6f9dae1. - change
Owner Return - Change owner
@param newOwner The new owner address
Container type for the return parameters of the
changeOwner(address)function. - change
Validator Status ByIndex Call - Change validator active status by index (owner only) - T1+
@param index The validator index in the validators array
@param active Whether the validator should be active
@dev Added in T1 to prevent front-running attacks where a validator changes its address
Function with signature
changeValidatorStatusByIndex(uint64,bool)and selector0x5aa3d0e1. - change
Validator Status ByIndex Return - Change validator active status by index (owner only) - T1+
@param index The validator index in the validators array
@param active Whether the validator should be active
@dev Added in T1 to prevent front-running attacks where a validator changes its address
Container type for the return parameters of the
changeValidatorStatusByIndex(uint64,bool)function. - change
Validator Status Call - Change validator active status (owner only)
@param validator The validator address
@param active Whether the validator should be active
@dev Deprecated: Use changeValidatorStatusByIndex to prevent front-running attacks
Function with signature
changeValidatorStatus(address,bool)and selector0xa1b3f4a9. - change
Validator Status Return - Change validator active status (owner only)
@param validator The validator address
@param active Whether the validator should be active
@dev Deprecated: Use changeValidatorStatusByIndex to prevent front-running attacks
Container type for the return parameters of the
changeValidatorStatus(address,bool)function. - getNext
Full DkgCeremony Call - Get the epoch at which a fresh DKG ceremony will be triggered
- getNext
Full DkgCeremony Return - Get the epoch at which a fresh DKG ceremony will be triggered
- getValidators
Call - Get the complete set of validators
@return validators Array of all validators with their information
Function with signature
getValidators()and selector0xb7ab4db5. - getValidators
Return - Get the complete set of validators
@return validators Array of all validators with their information
Container type for the return parameters of the
getValidators()function. - owner
Call - Get the owner of the precompile
@return owner The owner address
Function with signature
owner()and selector0x8da5cb5b. - owner
Return - Get the owner of the precompile
@return owner The owner address
Container type for the return parameters of the
owner()function. - setNext
Full DkgCeremony Call - Set the epoch at which a fresh DKG ceremony will be triggered (owner only)
- setNext
Full DkgCeremony Return - Set the epoch at which a fresh DKG ceremony will be triggered (owner only)
- update
Validator Call - Update validator information (only validator)
@param newValidatorAddress The new address for this validator
@param publicKey The validator’s new communication public publicKey
@param inboundAddress The validator’s inbound address
<hostname|ip>:<port>for incoming connections @param outboundAddress The validator’s outbound IP address<ip>:<port>for firewall whitelisting (IP only, no hostnames) Function with signatureupdateValidator(address,bytes32,string,string)and selector0x09970c76. - update
Validator Return - Update validator information (only validator)
@param newValidatorAddress The new address for this validator
@param publicKey The validator’s new communication public publicKey
@param inboundAddress The validator’s inbound address
<hostname|ip>:<port>for incoming connections @param outboundAddress The validator’s outbound IP address<ip>:<port>for firewall whitelisting (IP only, no hostnames) Container type for the return parameters of theupdateValidator(address,bytes32,string,string)function. - validator
Count Call - Get the total number of validators
@return The count of validators
Function with signature
validatorCount()and selector0x0f43a677. - validator
Count Return - Get the total number of validators
@return The count of validators
Container type for the return parameters of the
validatorCount()function. - validators
Array Call - Get validator address at a specific index in the validators array
@param index The index in the validators array
@return The validator address at the given index
Function with signature
validatorsArray(uint256)and selector0x031fadbd. - validators
Array Return - Get validator address at a specific index in the validators array
@param index The index in the validators array
@return The validator address at the given index
Container type for the return parameters of the
validatorsArray(uint256)function. - validators
Call - Get validator information by address
@param validator The validator address to look up
@return The validator struct for the given address
Function with signature
validators(address)and selector0xfa52c7d8. - validators
Return - Get validator information by address
@param validator The validator address to look up
@return The validator struct for the given address
Container type for the return parameters of the
validators(address)function.
Enums§
- IValidator
Config Calls - Container for all the
IValidatorConfigfunction calls. - IValidator
Config Errors - Container for all the
IValidatorConfigcustom errors.
Functions§
- new
- Creates a new wrapper around an on-chain
IValidatorConfigcontract instance.