Struct near_parameters::vm::LimitConfig
source · pub struct LimitConfig {Show 26 fields
pub max_gas_burnt: Gas,
pub max_stack_height: u32,
pub contract_prepare_version: ContractPrepareVersion,
pub initial_memory_pages: u32,
pub max_memory_pages: u32,
pub registers_memory_limit: u64,
pub max_register_size: u64,
pub max_number_registers: u64,
pub max_number_logs: u64,
pub max_total_log_length: u64,
pub max_total_prepaid_gas: Gas,
pub max_actions_per_receipt: u64,
pub max_number_bytes_method_names: u64,
pub max_length_method_name: u64,
pub max_arguments_length: u64,
pub max_length_returned_data: u64,
pub max_contract_size: u64,
pub max_transaction_size: u64,
pub max_length_storage_key: u64,
pub max_length_storage_value: u64,
pub max_promises_per_function_call_action: u64,
pub max_number_input_data_dependencies: u64,
pub max_functions_number_per_contract: Option<u64>,
pub wasmer2_stack_limit: i32,
pub max_locals_per_contract: Option<u64>,
pub account_id_validity_rules_version: AccountIdValidityRulesVersion,
}
Expand description
Describes limits for VM and Runtime. TODO #4139: consider switching to strongly-typed wrappers instead of raw quantities
Fields§
§max_gas_burnt: Gas
Max amount of gas that can be used, excluding gas attached to promises.
max_stack_height: u32
How tall the stack is allowed to grow?
See https://wiki.parity.io/WebAssembly-StackHeight to find out how the stack frame cost is calculated.
contract_prepare_version: ContractPrepareVersion
Whether a legacy version of stack limiting should be used, see
ContractPrepareVersion
.
initial_memory_pages: u32
The initial number of memory pages. NOTE: It’s not a limiter itself, but it’s a value we use for initial_memory_pages.
max_memory_pages: u32
What is the maximal memory pages amount is allowed to have for a contract.
registers_memory_limit: u64
Limit of memory used by registers.
max_register_size: u64
Maximum number of bytes that can be stored in a single register.
max_number_registers: u64
Maximum number of registers that can be used simultaneously.
Note that due to an implementation quirk [read: a bug] in VMLogic, if we have this number of registers, no subsequent writes to the registers will succeed even if they replace an existing register.
max_number_logs: u64
Maximum number of log entries.
max_total_log_length: u64
Maximum total length in bytes of all log messages.
max_total_prepaid_gas: Gas
Max total prepaid gas for all function call actions per receipt.
max_actions_per_receipt: u64
Max number of actions per receipt.
max_number_bytes_method_names: u64
Max total length of all method names (including terminating character) for a function call permission access key.
max_length_method_name: u64
Max length of any method name (without terminating character).
max_arguments_length: u64
Max length of arguments in a function call action.
max_length_returned_data: u64
Max length of returned data
max_contract_size: u64
Max contract size
max_transaction_size: u64
Max transaction size
max_length_storage_key: u64
Max storage key size
max_length_storage_value: u64
Max storage value size
max_promises_per_function_call_action: u64
Max number of promises that a function call can create
max_number_input_data_dependencies: u64
Max number of input data dependencies
max_functions_number_per_contract: Option<u64>
If present, stores max number of functions in one contract
wasmer2_stack_limit: i32
If present, stores the secondary stack limit as implemented by wasmer2.
This limit should never be hit normally.
max_locals_per_contract: Option<u64>
If present, stores max number of locals declared globally in one contract
account_id_validity_rules_version: AccountIdValidityRulesVersion
Whether to enforce account_id well-formedness where it wasn’t enforced historically.
Trait Implementations§
source§impl Clone for LimitConfig
impl Clone for LimitConfig
source§fn clone(&self) -> LimitConfig
fn clone(&self) -> LimitConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for LimitConfig
impl Debug for LimitConfig
source§impl<'de> Deserialize<'de> for LimitConfig
impl<'de> Deserialize<'de> for LimitConfig
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 Hash for LimitConfig
impl Hash for LimitConfig
source§impl PartialEq for LimitConfig
impl PartialEq for LimitConfig
source§fn eq(&self, other: &LimitConfig) -> bool
fn eq(&self, other: &LimitConfig) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for LimitConfig
impl Serialize for LimitConfig
impl Eq for LimitConfig
impl StructuralEq for LimitConfig
impl StructuralPartialEq for LimitConfig
Auto Trait Implementations§
impl RefUnwindSafe for LimitConfig
impl Send for LimitConfig
impl Sync for LimitConfig
impl Unpin for LimitConfig
impl UnwindSafe for LimitConfig
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.