aptos-gas 0.2.7

Gas metering for the Aptos blockchain
docs.rs failed to build aptos-gas-0.2.7
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

This crate is the core of the gas metering system of the Aptos blockchain.

More specifically, it

  • Is home to the gas meter implementation
  • Defines the gas parameters and formulae for instructions
  • Defines the gas parameters for transactions
  • Sets the initial values for all gas parameters, including the instruction, transaction move-stdlib and aptos-framework ones.
  • Defines a bi-directional mapping between the (Rust) gas parameter structs and their corresponding representation on-chain.

The reason why we need two different representations is that they serve different purposes:

  • The Rust structs are used for quick (static) lookups by the gas meter and native functions when calculating gas costs.
  • The on-chain gas schedule needs to be extensible and unordered so we can upgrate it easily in the future.