Module Evm_node_lib_dev.Gas_price

type constants = {
  1. target : Z.t;
  2. alpha : float;
}
val gas_constants : storage_version:int -> constants

Returns the gas constants depending on the storage version set by the kernel.

val price_from_backlog : version:int -> minimum:Z.t -> Z.t -> Z.t

price_from_backlog ~version ~minimum backlog mimics the computation performed by the kernel in order to compute the base fee per gas for the next block.

See the gas_price Rust module in kernel_latest/kernel.

version is used to decide what is the unit of backlog. If it is recent enough, the backlog is interpreted as a gas quantity. Otherwise, it fallbacks to the initial behavior of the kernel where the backlog was counted in estimated ticks.