Struct LimitConfig

Source
pub struct LimitConfig {
Show 28 fields pub account_id_validity_rules_version: AccountIdValidityRulesVersion, pub initial_memory_pages: u32, pub max_actions_per_receipt: u64, pub max_arguments_length: u64, pub max_contract_size: u64, pub max_functions_number_per_contract: Option<u64>, pub max_gas_burnt: u64, pub max_length_method_name: u64, pub max_length_returned_data: u64, pub max_length_storage_key: u64, pub max_length_storage_value: u64, pub max_locals_per_contract: Option<u64>, pub max_memory_pages: u32, pub max_number_bytes_method_names: u64, pub max_number_input_data_dependencies: u64, pub max_number_logs: u64, pub max_number_registers: u64, pub max_promises_per_function_call_action: u64, pub max_receipt_size: u64, pub max_register_size: u64, pub max_stack_height: u32, pub max_total_log_length: u64, pub max_total_prepaid_gas: u64, pub max_transaction_size: u64, pub max_yield_payload_size: u64, pub per_receipt_storage_proof_size_limit: u32, pub registers_memory_limit: u64, pub yield_timeout_length_in_blocks: u64,
}
Expand description

Describes limits for VM and Runtime. TODO #4139: consider switching to strongly-typed wrappers instead of raw quantities

JSON schema
{
 "description": "Describes limits for VM and Runtime.\nTODO #4139: consider switching to strongly-typed wrappers instead of raw quantities",
 "type": "object",
 "required": [
   "initial_memory_pages",
   "max_actions_per_receipt",
   "max_arguments_length",
   "max_contract_size",
   "max_gas_burnt",
   "max_length_method_name",
   "max_length_returned_data",
   "max_length_storage_key",
   "max_length_storage_value",
   "max_memory_pages",
   "max_number_bytes_method_names",
   "max_number_input_data_dependencies",
   "max_number_logs",
   "max_number_registers",
   "max_promises_per_function_call_action",
   "max_receipt_size",
   "max_register_size",
   "max_stack_height",
   "max_total_log_length",
   "max_total_prepaid_gas",
   "max_transaction_size",
   "max_yield_payload_size",
   "per_receipt_storage_proof_size_limit",
   "registers_memory_limit",
   "yield_timeout_length_in_blocks"
 ],
 "properties": {
   "account_id_validity_rules_version": {
     "description": "Whether to enforce account_id well-formed-ness where it wasn't enforced\nhistorically.",
     "default": 0,
     "allOf": [
       {
         "$ref": "#/components/schemas/AccountIdValidityRulesVersion"
       }
     ]
   },
   "initial_memory_pages": {
     "description": "The initial number of memory pages.\nNOTE: It's not a limiter itself, but it's a value we use for initial_memory_pages.",
     "type": "integer",
     "format": "uint32",
     "minimum": 0.0
   },
   "max_actions_per_receipt": {
     "description": "Max number of actions per receipt.",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_arguments_length": {
     "description": "Max length of arguments in a function call action.",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_contract_size": {
     "description": "Max contract size",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_functions_number_per_contract": {
     "description": "If present, stores max number of functions in one contract",
     "type": [
       "integer",
       "null"
     ],
     "format": "uint64",
     "minimum": 0.0
   },
   "max_gas_burnt": {
     "description": "Max amount of gas that can be used, excluding gas attached to promises.",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_length_method_name": {
     "description": "Max length of any method name (without terminating character).",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_length_returned_data": {
     "description": "Max length of returned data",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_length_storage_key": {
     "description": "Max storage key size",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_length_storage_value": {
     "description": "Max storage value size",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_locals_per_contract": {
     "description": "If present, stores max number of locals declared globally in one contract",
     "type": [
       "integer",
       "null"
     ],
     "format": "uint64",
     "minimum": 0.0
   },
   "max_memory_pages": {
     "description": "What is the maximal memory pages amount is allowed to have for a contract.",
     "type": "integer",
     "format": "uint32",
     "minimum": 0.0
   },
   "max_number_bytes_method_names": {
     "description": "Max total length of all method names (including terminating character) for a function call\npermission access key.",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_number_input_data_dependencies": {
     "description": "Max number of input data dependencies",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_number_logs": {
     "description": "Maximum number of log entries.",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_number_registers": {
     "description": "Maximum number of registers that can be used simultaneously.\n\nNote that due to an implementation quirk [read: a bug] in VMLogic, if we\nhave this number of registers, no subsequent writes to the registers\nwill succeed even if they replace an existing register.",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_promises_per_function_call_action": {
     "description": "Max number of promises that a function call can create",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_receipt_size": {
     "description": "Max receipt size",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_register_size": {
     "description": "Maximum number of bytes that can be stored in a single register.",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_stack_height": {
     "description": "How tall the stack is allowed to grow?\n\nSee <https://wiki.parity.io/WebAssembly-StackHeight> to find out how the stack frame cost\nis calculated.",
     "type": "integer",
     "format": "uint32",
     "minimum": 0.0
   },
   "max_total_log_length": {
     "description": "Maximum total length in bytes of all log messages.",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_total_prepaid_gas": {
     "description": "Max total prepaid gas for all function call actions per receipt.",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_transaction_size": {
     "description": "Max transaction size",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "max_yield_payload_size": {
     "description": "Maximum number of bytes for payload passed over a yield resume.",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "per_receipt_storage_proof_size_limit": {
     "description": "Hard limit on the size of storage proof generated while executing a single receipt.",
     "type": "integer",
     "format": "uint",
     "minimum": 0.0
   },
   "registers_memory_limit": {
     "description": "Limit of memory used by registers.",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   },
   "yield_timeout_length_in_blocks": {
     "description": "Number of blocks after which a yielded promise times out.",
     "type": "integer",
     "format": "uint64",
     "minimum": 0.0
   }
 }
}

Fields§

§account_id_validity_rules_version: AccountIdValidityRulesVersion

Whether to enforce account_id well-formed-ness where it wasn’t enforced historically.

§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_actions_per_receipt: u64

Max number of actions per receipt.

§max_arguments_length: u64

Max length of arguments in a function call action.

§max_contract_size: u64

Max contract size

§max_functions_number_per_contract: Option<u64>

If present, stores max number of functions in one contract

§max_gas_burnt: u64

Max amount of gas that can be used, excluding gas attached to promises.

§max_length_method_name: u64

Max length of any method name (without terminating character).

§max_length_returned_data: u64

Max length of returned data

§max_length_storage_key: u64

Max storage key size

§max_length_storage_value: u64

Max storage value size

§max_locals_per_contract: Option<u64>

If present, stores max number of locals declared globally in one contract

§max_memory_pages: u32

What is the maximal memory pages amount is allowed to have for a contract.

§max_number_bytes_method_names: u64

Max total length of all method names (including terminating character) for a function call permission access key.

§max_number_input_data_dependencies: u64

Max number of input data dependencies

§max_number_logs: u64

Maximum number of log entries.

§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_promises_per_function_call_action: u64

Max number of promises that a function call can create

§max_receipt_size: u64

Max receipt size

§max_register_size: u64

Maximum number of bytes that can be stored in a single register.

§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.

§max_total_log_length: u64

Maximum total length in bytes of all log messages.

§max_total_prepaid_gas: u64

Max total prepaid gas for all function call actions per receipt.

§max_transaction_size: u64

Max transaction size

§max_yield_payload_size: u64

Maximum number of bytes for payload passed over a yield resume.

§per_receipt_storage_proof_size_limit: u32

Hard limit on the size of storage proof generated while executing a single receipt.

§registers_memory_limit: u64

Limit of memory used by registers.

§yield_timeout_length_in_blocks: u64

Number of blocks after which a yielded promise times out.

Trait Implementations§

Source§

impl Clone for LimitConfig

Source§

fn clone(&self) -> LimitConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LimitConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for LimitConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<&LimitConfig> for LimitConfig

Source§

fn from(value: &LimitConfig) -> Self

Converts to this type from the input type.
Source§

impl Serialize for LimitConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,