pub trait RuntimeExecutor {
// Required methods
fn execute(
&mut self,
bytecode_or_hash: BytecodeOrHash,
ctx: RuntimeContext,
) -> ExecutionResult;
fn resume(
&mut self,
call_id: u32,
return_data: &[u8],
fuel16_ptr: u32,
fuel_consumed: u64,
fuel_refunded: i64,
exit_code: i32,
) -> ExecutionResult;
fn forget_runtime(&mut self, call_id: u32);
fn warmup(&mut self, bytecode: RwasmModule, hash: B256, address: Address);
fn reset_call_id_counter(&mut self);
fn memory_read(
&mut self,
call_id: u32,
offset: usize,
buffer: &mut [u8],
) -> Result<(), TrapCode>;
}Required Methods§
Sourcefn execute(
&mut self,
bytecode_or_hash: BytecodeOrHash,
ctx: RuntimeContext,
) -> ExecutionResult
fn execute( &mut self, bytecode_or_hash: BytecodeOrHash, ctx: RuntimeContext, ) -> ExecutionResult
Executes the entry function of the module determined by the current execution state.
Returns either a finalized result.
Sourcefn resume(
&mut self,
call_id: u32,
return_data: &[u8],
fuel16_ptr: u32,
fuel_consumed: u64,
fuel_refunded: i64,
exit_code: i32,
) -> ExecutionResult
fn resume( &mut self, call_id: u32, return_data: &[u8], fuel16_ptr: u32, fuel_consumed: u64, fuel_refunded: i64, exit_code: i32, ) -> ExecutionResult
Resumes a previously interrupted runtime.
fuel16_ptr optionally points to a 16-byte buffer where fuel consumption and refund are written back.
Sourcefn forget_runtime(&mut self, call_id: u32)
fn forget_runtime(&mut self, call_id: u32)
Drop a runtime we don’t need to resume anymore
Sourcefn warmup(&mut self, bytecode: RwasmModule, hash: B256, address: Address)
fn warmup(&mut self, bytecode: RwasmModule, hash: B256, address: Address)
Warm up the bytecode
Sourcefn reset_call_id_counter(&mut self)
fn reset_call_id_counter(&mut self)
Resets the per-transaction call identifier counter and clears recoverable runtimes.
Intended to be invoked at the beginning of a new transaction.