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 owner() external view returns (address);
function changeOwner(address newOwner) external;
error Unauthorized();
error ValidatorAlreadyExists();
error ValidatorNotFound();
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. - 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 Call - Change validator active status (owner only)
@param validator The validator address
@param active Whether the validator should be active
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
Container type for the return parameters of the
changeValidatorStatus(address,bool)function. - 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. - 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.
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.