openvm_circuit/arch/execution_mode/
mod.rs1use crate::{arch::VmExecState, system::memory::online::GuestMemory};
2
3pub mod metered;
4pub mod metered_cost;
5mod preflight;
6mod pure;
7
8pub use metered::{ctx::MeteredCtx, segment_ctx::Segment};
9pub use metered_cost::MeteredCostCtx;
10pub use preflight::PreflightCtx;
11pub use pure::ExecutionCtx;
12
13pub trait ExecutionCtxTrait: Sized {
14 fn on_memory_operation(&mut self, address_space: u32, ptr: u32, size: u32);
15 fn should_suspend<F>(vm_state: &mut VmExecState<F, GuestMemory, Self>) -> bool;
16 fn on_terminate<F>(_vm_state: &mut VmExecState<F, GuestMemory, Self>) {}
17}
18
19pub trait MeteredExecutionCtxTrait: ExecutionCtxTrait {
20 fn on_height_change(&mut self, chip_idx: usize, height_delta: u32);
21}