pub fn encode_set_gas_constants_script_function(
sliding_nonce: u64,
global_memory_per_byte_cost: u64,
global_memory_per_byte_write_cost: u64,
min_transaction_gas_units: u64,
large_transaction_cutoff: u64,
intrinsic_gas_per_byte: u64,
maximum_number_of_gas_units: u64,
min_price_per_gas_unit: u64,
max_price_per_gas_unit: u64,
max_transaction_size_in_bytes: u64,
gas_unit_scaling_factor: u64,
default_account_size: u64
) -> TransactionPayload
Expand description
Summary
Updates the gas constants stored on chain and used by the VM for gas metering. This transaction can only be sent from the Diem Root account.
Technical Description
Updates the on-chain config holding the DiemVMConfig
and emits a
DiemConfig::NewEpochEvent
to trigger a reconfiguration of the system.
Parameters
Name | Type | Description |
---|---|---|
account | signer | Signer of the sending account. Must be the Diem Root account. |
sliding_nonce | u64 | The sliding_nonce (see: SlidingNonce ) to be used for this transaction. |
global_memory_per_byte_cost | u64 | The new cost to read global memory per-byte to be used for gas metering. |
global_memory_per_byte_write_cost | u64 | The new cost to write global memory per-byte to be used for gas metering. |
min_transaction_gas_units | u64 | The new flat minimum amount of gas required for any transaction. |
large_transaction_cutoff | u64 | The new size over which an additional charge will be assessed for each additional byte. |
intrinsic_gas_per_byte | u64 | The new number of units of gas that to be charged per-byte over the new large_transaction_cutoff . |
maximum_number_of_gas_units | u64 | The new maximum number of gas units that can be set in a transaction. |
min_price_per_gas_unit | u64 | The new minimum gas price that can be set for a transaction. |
max_price_per_gas_unit | u64 | The new maximum gas price that can be set for a transaction. |
max_transaction_size_in_bytes | u64 | The new maximum size of a transaction that can be processed. |
gas_unit_scaling_factor | u64 | The new scaling factor to use when scaling between external and internal gas units. |
default_account_size | u64 | The new default account size to use when assessing final costs for reads and writes to global storage. |
Common Abort Conditions
Error Category | Error Reason | Description |
---|---|---|
Errors::INVALID_ARGUMENT | DiemVMConfig::EGAS_CONSTANT_INCONSISTENCY | The provided gas constants are inconsistent. |
Errors::NOT_PUBLISHED | SlidingNonce::ESLIDING_NONCE | A SlidingNonce resource is not published under account . |
Errors::INVALID_ARGUMENT | SlidingNonce::ENONCE_TOO_OLD | The sliding_nonce is too old and it’s impossible to determine if it’s duplicated or not. |
Errors::INVALID_ARGUMENT | SlidingNonce::ENONCE_TOO_NEW | The sliding_nonce is too far in the future. |
Errors::INVALID_ARGUMENT | SlidingNonce::ENONCE_ALREADY_RECORDED | The sliding_nonce has been previously recorded. |
Errors::REQUIRES_ADDRESS | CoreAddresses::EDIEM_ROOT | account is not the Diem Root account. |