[][src]Function transaction_builder::encode_remove_validator_and_reconfigure_script

pub fn encode_remove_validator_and_reconfigure_script(
    sliding_nonce: u64,
    validator_name: Vec<u8>,
    validator_address: AccountAddress
) -> Script

Summary

This script removes a validator account from the validator set, and triggers a reconfiguration of the system to remove the validator from the system. This transaction can only be successfully called by the Libra Root account.

Technical Description

This script removes the account at validator_address from the validator set. This transaction emits a LibraConfig::NewEpochEvent event. Once the reconfiguration triggered by this event has been performed, the account at validator_address is no longer considered to be a validator in the network. This transaction will fail if the validator at validator_address is not in the validator set.

Parameters

NameTypeDescription
lr_account&signerThe signer reference of the sending account of this transaction. Must be the Libra Root signer.
sliding_nonceu64The sliding_nonce (see: SlidingNonce) to be used for this transaction.
validator_namevector<u8>ASCII-encoded human name for the validator. Must match the human name in the ValidatorConfig::ValidatorConfig for the validator.
validator_addressaddressThe validator account address to be removed from the validator set.

Common Abort Conditions

Error CategoryError ReasonDescription
Errors::NOT_PUBLISHEDSlidingNonce::ESLIDING_NONCEA SlidingNonce resource is not published under lr_account.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_TOO_OLDThe sliding_nonce is too old and it's impossible to determine if it's duplicated or not.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_TOO_NEWThe sliding_nonce is too far in the future.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_ALREADY_RECORDEDThe sliding_nonce has been previously recorded.
Errors::NOT_PUBLISHEDSlidingNonce::ESLIDING_NONCEThe sending account is not the Libra Root account or Treasury Compliance account
00The provided validator_name does not match the already-recorded human name for the validator.
Errors::INVALID_ARGUMENTLibraSystem::ENOT_AN_ACTIVE_VALIDATORThe validator to be removed is not in the validator set.
Errors::REQUIRES_ADDRESSCoreAddresses::ELIBRA_ROOTThe sending account is not the Libra Root account.
Errors::REQUIRES_ROLERoles::ELIBRA_ROOTThe sending account is not the Libra Root account.
Errors::INVALID_STATELibraConfig::EINVALID_BLOCK_TIMEAn invalid time value was encountered in reconfiguration. Unlikely to occur.

Related Scripts