Module IValidatorConfig

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§

IValidatorConfigInstance
A IValidatorConfig instance.
NotHostPort
Custom error with signature NotHostPort(string,string,string) and selector 0xad764df2.
NotIpPort
Custom error with signature NotIpPort(string,string,string) and selector 0x89ac2be7.
Unauthorized
Custom error with signature Unauthorized() and selector 0x82b42900.
Validator
Validator information
ValidatorAlreadyExists
Custom error with signature ValidatorAlreadyExists() and selector 0x8d09a73e.
ValidatorNotFound
Custom error with signature ValidatorNotFound() and selector 0x580e542f.
addValidatorCall
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 signature addValidator(address,bytes32,bool,string,string) and selector 0xffb4822e.
addValidatorReturn
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 the addValidator(address,bytes32,bool,string,string) function.
changeOwnerCall
Change owner @param newOwner The new owner address Function with signature changeOwner(address) and selector 0xa6f9dae1.
changeOwnerReturn
Change owner @param newOwner The new owner address Container type for the return parameters of the changeOwner(address) function.
changeValidatorStatusCall
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 selector 0xa1b3f4a9.
changeValidatorStatusReturn
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.
getValidatorsCall
Get the complete set of validators @return validators Array of all validators with their information Function with signature getValidators() and selector 0xb7ab4db5.
getValidatorsReturn
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.
ownerCall
Get the owner of the precompile @return owner The owner address Function with signature owner() and selector 0x8da5cb5b.
ownerReturn
Get the owner of the precompile @return owner The owner address Container type for the return parameters of the owner() function.
updateValidatorCall
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 signature updateValidator(address,bytes32,string,string) and selector 0x09970c76.
updateValidatorReturn
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 the updateValidator(address,bytes32,string,string) function.

Enums§

IValidatorConfigCalls
Container for all the IValidatorConfig function calls.
IValidatorConfigErrors
Container for all the IValidatorConfig custom errors.

Functions§

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