[][src]Function transaction_builder::encode_update_libra_version_script

pub fn encode_update_libra_version_script(
    sliding_nonce: u64,
    major: u64
) -> Script

Summary

Updates the Libra major version that is stored on-chain and is used by the VM. This transaction can only be sent from the Libra Root account.

Technical Description

Updates the LibraVersion on-chain config and emits a LibraConfig::NewEpochEvent to trigger a reconfiguration of the system. The major version that is passed in must be strictly greater than the current major version held on-chain. The VM reads this information and can use it to preserve backwards compatibility with previous major versions of the VM.

Parameters

NameTypeDescription
account&signerSigner reference of the sending account. Must be the Libra Root account.
sliding_nonceu64The sliding_nonce (see: SlidingNonce) to be used for this transaction.
majoru64The major version of the VM to be used from this transaction on.

Common Abort Conditions

Error CategoryError ReasonDescription
Errors::NOT_PUBLISHEDSlidingNonce::ESLIDING_NONCEA SlidingNonce resource is not published under 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::REQUIRES_ADDRESSCoreAddresses::ELIBRA_ROOTaccount is not the Libra Root account.
Errors::INVALID_ARGUMENTLibraVersion::EINVALID_MAJOR_VERSION_NUMBERmajor is less-than or equal to the current major version stored on-chain.