Skip to main content

run_program

Function run_program 

Source
pub fn run_program(
    spec: &ProgramSpec<'_>,
    handler: &mut dyn EcallHandler,
    initial_gas: u64,
) -> InvocationResult
Expand description

Run a prepared ProgramSpec through the PVM2 (RISC-V) interpreter, returning the same InvocationResult shape nub-arch-x86’s JIT path produces. The exit-reason mapping matches the JIT exit codes (HostCall=4, Trap=7, etc.) so the two backends agree on a well-formed program.

Equivalent to ProgramInstance::new followed by one invoke — same bytes, same gas.