Module Evm_node_lib_dev.Gas_price

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.