openvm_circuit/arch/execution_mode/
preflight.rs

1use crate::arch::Arena;
2
3pub struct PreflightCtx<RA> {
4    pub arenas: Vec<RA>,
5    pub instret_end: Option<u64>,
6}
7
8impl<RA: Arena> PreflightCtx<RA> {
9    /// `capacities` is list of `(height, width)` dimensions for each arena, indexed by AIR index.
10    /// The length of `capacities` must equal the number of AIRs.
11    /// Here `height` will always mean an overestimate of the trace height for that AIR, while
12    /// `width` may have different meanings depending on the `RA` type.
13    pub fn new_with_capacity(capacities: &[(usize, usize)], instret_end: Option<u64>) -> Self {
14        let arenas = capacities
15            .iter()
16            .map(|&(height, main_width)| RA::with_capacity(height, main_width))
17            .collect();
18
19        Self {
20            arenas,
21            instret_end,
22        }
23    }
24}