Skip to main content

rv_gas_cost_for_block

Function rv_gas_cost_for_block 

Source
pub fn rv_gas_cost_for_block(
    insts: &[RvPreDecodedInst],
    block_start: usize,
    mem_cycles: u8,
) -> u32
Expand description

Compute per-block gas cost for a PVM2 basic block. The block runs from insts[block_start] until the next instruction whose is_gas_block_start is true (or the end of insts). Uses the single-pass GasSimulator (decode-throughput + register-readiness tracking — the model from spec/Jar/JAVM/GasCostSinglePass.lean) driven by the LUT fast path (rv_feed_gas_direct). Returns max(max_done − 3, 1).