Skip to main content

rv_block_reserve_for_block

Function rv_block_reserve_for_block 

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

Worst-case category-#3 reserve (in gas) for the basic block starting at block_start: the maximum materialization cost the block can debit at faults. The block-entry gate reserves this (a gate, not a charge — see ~/docs/spec-staging/gas-cost.md §1/§3) so #3 can never drive gas negative mid-block.

Sums rv_kind_reserve over the block. An ecall/ecalli block contributes 0 — it has no load/store, and its #3 (the dynamic call-frame / host cost) is charged separately at dispatch. Saturates to u32::MAX (blocks are bounded by code size, so this never binds).