pub struct Config {
pub ext_costs: ExtCostsConfig,
pub grow_mem_cost: u32,
pub regular_op_cost: u32,
pub vm_kind: VMKind,
pub storage_get_mode: StorageGetMode,
pub fix_contract_loading_cost: bool,
pub implicit_account_creation: bool,
pub eth_implicit_accounts: bool,
pub discard_custom_sections: bool,
pub saturating_float_to_int: bool,
pub global_contract_host_fns: bool,
pub limit_config: LimitConfig,
}
Expand description
Dynamic configuration parameters required for the WASM runtime to execute a smart contract.
This (VMConfig
) and RuntimeFeesConfig
combined are sufficient to define
protocol specific behavior of the contract runtime. The former contains
configuration for the WASM runtime specifically, while the latter contains
configuration for the transaction runtime and WASM runtime.
Fields§
§ext_costs: ExtCostsConfig
Costs for runtime externals
grow_mem_cost: u32
Gas cost of a growing memory by single page.
regular_op_cost: u32
Gas cost of a regular operation.
vm_kind: VMKind
The kind of the VM implementation to use
storage_get_mode: StorageGetMode
Set to StorageGetMode::FlatStorage
in order to enable the FlatStorageReads
protocol
feature.
fix_contract_loading_cost: bool
Enable the FixContractLoadingCost
protocol feature.
implicit_account_creation: bool
Enable the ImplicitAccountCreation
protocol feature.
eth_implicit_accounts: bool
Enable the EthImplicitAccounts
protocol feature.
discard_custom_sections: bool
Whether to discard custom sections.
saturating_float_to_int: bool
Whether to enable saturating float-to-integer wasm operators.
global_contract_host_fns: bool
Whether to enable global contract related host functions.
limit_config: LimitConfig
Describes limits for VM and Runtime.
Implementations§
Source§impl Config
impl Config
Sourcepub fn non_crypto_hash(&self) -> u64
pub fn non_crypto_hash(&self) -> u64
Computes non-cryptographically-proof hash. The computation is fast but not cryptographically secure.
pub fn make_free(&mut self)
pub fn enable_all_features(&mut self)
Trait Implementations§
Source§impl From<Config> for VMConfigView
impl From<Config> for VMConfigView
Source§impl From<VMConfigView> for Config
impl From<VMConfigView> for Config
Source§fn from(view: VMConfigView) -> Self
fn from(view: VMConfigView) -> Self
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.