Struct diem_sdk::move_types::gas_schedule::GasConstants
pub struct GasConstants {
pub global_memory_per_byte_cost: InternalGasUnits<u64>,
pub global_memory_per_byte_write_cost: InternalGasUnits<u64>,
pub min_transaction_gas_units: InternalGasUnits<u64>,
pub large_transaction_cutoff: AbstractMemorySize<u64>,
pub intrinsic_gas_per_byte: InternalGasUnits<u64>,
pub maximum_number_of_gas_units: GasUnits<u64>,
pub min_price_per_gas_unit: GasPrice<u64>,
pub max_price_per_gas_unit: GasPrice<u64>,
pub max_transaction_size_in_bytes: u64,
pub gas_unit_scaling_factor: u64,
pub default_account_size: AbstractMemorySize<u64>,
}
Fields§
§global_memory_per_byte_cost: InternalGasUnits<u64>
The cost per-byte read from global storage.
global_memory_per_byte_write_cost: InternalGasUnits<u64>
The cost per-byte written to storage.
min_transaction_gas_units: InternalGasUnits<u64>
The flat minimum amount of gas required for any transaction. Charged at the start of execution.
large_transaction_cutoff: AbstractMemorySize<u64>
Any transaction over this size will be charged an additional amount per byte.
intrinsic_gas_per_byte: InternalGasUnits<u64>
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<u64>
~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<u64>
The minimum gas price that a transaction can be submitted with.
max_price_per_gas_unit: GasPrice<u64>
The maximum gas unit price that a transaction can be submitted with.
max_transaction_size_in_bytes: u64
§gas_unit_scaling_factor: u64
§default_account_size: AbstractMemorySize<u64>
Implementations§
§impl GasConstants
impl GasConstants
pub fn to_internal_units(&self, units: GasUnits<u64>) -> InternalGasUnits<u64>
pub fn to_external_units(&self, units: InternalGasUnits<u64>) -> GasUnits<u64>
Trait Implementations§
§impl Clone for GasConstants
impl Clone for GasConstants
§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 more§impl Debug for GasConstants
impl Debug for GasConstants
§impl Default for GasConstants
impl Default for GasConstants
§fn default() -> GasConstants
fn default() -> GasConstants
§impl<'de> Deserialize<'de> for GasConstants
impl<'de> Deserialize<'de> for GasConstants
§fn deserialize<__D>(
__deserializer: __D
) -> Result<GasConstants, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<GasConstants, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
§impl PartialEq<GasConstants> for GasConstants
impl PartialEq<GasConstants> for GasConstants
§fn eq(&self, other: &GasConstants) -> bool
fn eq(&self, other: &GasConstants) -> bool
self
and other
values to be equal, and is used
by ==
.§impl Serialize for GasConstants
impl Serialize for GasConstants
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
impl Eq for GasConstants
impl StructuralEq for GasConstants
impl StructuralPartialEq for GasConstants
Auto Trait Implementations§
impl RefUnwindSafe for GasConstants
impl Send for GasConstants
impl Sync for GasConstants
impl Unpin for GasConstants
impl UnwindSafe for GasConstants
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.