pub fn encode_set_validator_config_and_reconfigure_script(
    validator_account: AccountAddress,
    consensus_pubkey: Vec<u8>,
    validator_network_addresses: Vec<u8>,
    fullnode_network_addresses: Vec<u8>
) -> Script
Expand description

Summary

Updates a validator’s configuration, and triggers a reconfiguration of the system to update the validator set with this new validator configuration. Can only be successfully sent by a Validator Operator account that is already registered with a validator.

Technical Description

This updates the fields with corresponding names held in the ValidatorConfig::ValidatorConfig config resource held under validator_account. It then emits a DiemConfig::NewEpochEvent to trigger a reconfiguration of the system. This reconfiguration will update the validator set on-chain with the updated ValidatorConfig::ValidatorConfig.

Parameters

NameTypeDescription
validator_operator_account&signerSigner reference of the sending account. Must be the registered validator operator for the validator at validator_address.
validator_accountaddressThe address of the validator’s ValidatorConfig::ValidatorConfig resource being updated.
consensus_pubkeyvector<u8>New Ed25519 public key to be used in the updated ValidatorConfig::ValidatorConfig.
validator_network_addressesvector<u8>New set of validator_network_addresses to be used in the updated ValidatorConfig::ValidatorConfig.
fullnode_network_addressesvector<u8>New set of fullnode_network_addresses to be used in the updated ValidatorConfig::ValidatorConfig.

Common Abort Conditions

Error CategoryError ReasonDescription
Errors::NOT_PUBLISHEDValidatorConfig::EVALIDATOR_CONFIGvalidator_address does not have a ValidatorConfig::ValidatorConfig resource published under it.
Errors::REQUIRES_ROLERoles::EVALIDATOR_OPERATORvalidator_operator_account does not have a Validator Operator role.
Errors::INVALID_ARGUMENTValidatorConfig::EINVALID_TRANSACTION_SENDERvalidator_operator_account is not the registered operator for the validator at validator_address.
Errors::INVALID_ARGUMENTValidatorConfig::EINVALID_CONSENSUS_KEYconsensus_pubkey is not a valid ed25519 public key.
Errors::INVALID_STATEDiemConfig::EINVALID_BLOCK_TIMEAn invalid time value was encountered in reconfiguration. Unlikely to occur.
  • Script::create_validator_account
  • Script::create_validator_operator_account
  • Script::add_validator_and_reconfigure
  • Script::remove_validator_and_reconfigure
  • Script::set_validator_operator
  • Script::set_validator_operator_with_nonce_admin
  • Script::register_validator_config