Module diem_sdk::move_types::gas_schedule
Expand description
This module lays out the basic abstract costing schedule for bytecode instructions.
It is important to note that the cost schedule defined in this file does not track hashing operations or other native operations; the cost of each native operation will be returned by the native function itself.
Structs
- A newtype wrapper that represents the (abstract) memory size that the instruction will take up.
- The cost tables, keyed by the serialized form of the bytecode instruction. We use the serialized form as opposed to the instruction enum itself as the key since this will be the on-chain representation of bytecode instructions in the future.
- The
GasCost
tracks: - A newtype wrapper around the gas price for each unit of gas consumed.
- Units of gas as seen by clients of the Move VM.
- Units of gas used within the Move VM, scaled for fine-grained accounting.
Constants
- The size in bytes for a non-string or address constant on the stack
- For V1 all accounts will be ~800 bytes
- Any transaction over this size will be charged
INTRINSIC_GAS_PER_BYTE
per byte - The maximum size representable by AbstractMemorySize
- For exists checks on data that doesn’t exists this is the multiplier that is used.
- One unit of gas
- The size in bytes for a reference on the stack
- The size of a struct in bytes
Traits
- A trait encoding the operations permitted on the underlying carrier for the gas unit, and how other gas-related units can interact with other units – operations can only be performed across units with the same underlying carrier (i.e. as long as the underlying data is the same).
Type Definitions
- The underlying carrier for gas-related units and costs. Data with this type should not be manipulated directly, but instead be manipulated using the newtype wrappers defined around them and the functions defined in the
GasAlgebra
trait.