UpgradePurposeType

enum UpgradePurposeType : uint8 {
    ConsensusParameters = 0,
    StateTransition = 1,
}
nametypedescription
typeUpgradePurposeTypeType of upgrade purpose.
dataOne of ConsensusParameters, StateTransitionUpgrade purposes.

Transaction is invalid if:

  • type is not valid UpgradePurposeType value`

ConsensusParameters

nametypedescription
witnessIndexuint16Index of witness that contains a serialized(with postcard) consensus parameters.
checksumbyte[32]The hash of the serialized consensus parameters.

Given helper deserialize_consensus_parameters() that deserializes the consensus parameters from a witness by using postcard algorithm.

Transaction is invalid if:

  • witnessIndex >= tx.witnessesCount
  • checksum != sha256(tx.data.witnesses[witnessIndex])
  • deserialize_consensus_parameters(tx.data.witnesses[witnessIndex]) returns an error.

StateTransition

nametypedescription
bytecodeRootbyte[32]The root of the new bytecode of the state transition function.