pub fn encode_update_diem_consensus_config_script_function(
    sliding_nonce: u64,
    config: Vec<u8, Global>
) -> TransactionPayload
Expand description

Summary

Updates the Diem consensus config that is stored on-chain and is used by the Consensus. This transaction can only be sent from the Diem Root account.

Technical Description

Updates the DiemConsensusConfig on-chain config and emits a DiemConfig::NewEpochEvent to trigger a reconfiguration of the system.

Parameters

NameTypeDescription
accountsignerSigner of the sending account. Must be the Diem Root account.
sliding_nonceu64The sliding_nonce (see: SlidingNonce) to be used for this transaction.
configvector<u8>The serialized bytes of consensus config.

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.