Function diem_transaction_builder::stdlib::encode_update_diem_version_script[][src]

pub fn encode_update_diem_version_script(
    sliding_nonce: u64,
    major: u64
) -> Script
Expand description

Summary

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

Technical Description

Updates the DiemVersion on-chain config and emits a DiemConfig::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 Diem 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::EDIEM_ROOTaccount is not the Diem Root account.
Errors::INVALID_ARGUMENTDiemVersion::EINVALID_MAJOR_VERSION_NUMBERmajor is less-than or equal to the current major version stored on-chain.