Struct move_core_types::gas_schedule::GasConstants
source · pub struct GasConstants {
pub global_memory_per_byte_cost: InternalGasUnits<GasCarrier>,
pub global_memory_per_byte_write_cost: InternalGasUnits<GasCarrier>,
pub min_transaction_gas_units: InternalGasUnits<GasCarrier>,
pub large_transaction_cutoff: AbstractMemorySize<GasCarrier>,
pub intrinsic_gas_per_byte: InternalGasUnits<GasCarrier>,
pub maximum_number_of_gas_units: GasUnits<GasCarrier>,
pub min_price_per_gas_unit: GasPrice<GasCarrier>,
pub max_price_per_gas_unit: GasPrice<GasCarrier>,
pub max_transaction_size_in_bytes: GasCarrier,
pub gas_unit_scaling_factor: GasCarrier,
pub default_account_size: AbstractMemorySize<GasCarrier>,
}
Fields§
§global_memory_per_byte_cost: InternalGasUnits<GasCarrier>
The cost per-byte read from global storage.
global_memory_per_byte_write_cost: InternalGasUnits<GasCarrier>
The cost per-byte written to storage.
min_transaction_gas_units: InternalGasUnits<GasCarrier>
The flat minimum amount of gas required for any transaction. Charged at the start of execution.
large_transaction_cutoff: AbstractMemorySize<GasCarrier>
Any transaction over this size will be charged an additional amount per byte.
intrinsic_gas_per_byte: InternalGasUnits<GasCarrier>
The units of gas that to be charged per byte over the large_transaction_cutoff
in addition to
min_transaction_gas_units
for transactions whose size exceeds large_transaction_cutoff
.
maximum_number_of_gas_units: GasUnits<GasCarrier>
~5 microseconds should equal one unit of computational gas. We bound the maximum
computational time of any given transaction at roughly 20 seconds. We want this number and
MAX_PRICE_PER_GAS_UNIT
to always satisfy the inequality that
MAXIMUM_NUMBER_OF_GAS_UNITS * MAX_PRICE_PER_GAS_UNIT < min(u64::MAX, GasUnits
min_price_per_gas_unit: GasPrice<GasCarrier>
The minimum gas price that a transaction can be submitted with.
max_price_per_gas_unit: GasPrice<GasCarrier>
The maximum gas unit price that a transaction can be submitted with.
max_transaction_size_in_bytes: GasCarrier
§gas_unit_scaling_factor: GasCarrier
§default_account_size: AbstractMemorySize<GasCarrier>
Implementations§
source§impl GasConstants
impl GasConstants
pub fn to_internal_units( &self, units: GasUnits<GasCarrier> ) -> InternalGasUnits<GasCarrier>
pub fn to_external_units( &self, units: InternalGasUnits<GasCarrier> ) -> GasUnits<GasCarrier>
Trait Implementations§
source§impl Clone for GasConstants
impl Clone for GasConstants
source§fn clone(&self) -> GasConstants
fn clone(&self) -> GasConstants
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GasConstants
impl Debug for GasConstants
source§impl Default for GasConstants
impl Default for GasConstants
source§impl<'de> Deserialize<'de> for GasConstants
impl<'de> Deserialize<'de> for GasConstants
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl PartialEq<GasConstants> for GasConstants
impl PartialEq<GasConstants> for GasConstants
source§fn eq(&self, other: &GasConstants) -> bool
fn eq(&self, other: &GasConstants) -> bool
self
and other
values to be equal, and is used
by ==
.