Skip to main content

Module IValidatorConfig

Module IValidatorConfig 

Source
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§

IValidatorConfigInstance
A IValidatorConfig instance.
InvalidPublicKey
Custom error with signature InvalidPublicKey() and selector 0xa2d0fee8.
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.
changeValidatorStatusByIndexCall
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 selector 0x5aa3d0e1.
changeValidatorStatusByIndexReturn
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.
changeValidatorStatusCall
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 selector 0xa1b3f4a9.
changeValidatorStatusReturn
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.
getNextFullDkgCeremonyCall
Get the epoch at which a fresh DKG ceremony will be triggered
getNextFullDkgCeremonyReturn
Get the epoch at which a fresh DKG ceremony will be triggered
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.
setNextFullDkgCeremonyCall
Set the epoch at which a fresh DKG ceremony will be triggered (owner only)
setNextFullDkgCeremonyReturn
Set the epoch at which a fresh DKG ceremony will be triggered (owner only)
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.
validatorCountCall
Get the total number of validators @return The count of validators Function with signature validatorCount() and selector 0x0f43a677.
validatorCountReturn
Get the total number of validators @return The count of validators Container type for the return parameters of the validatorCount() function.
validatorsArrayCall
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 selector 0x031fadbd.
validatorsArrayReturn
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.
validatorsCall
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 selector 0xfa52c7d8.
validatorsReturn
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§

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.