diff --git a/Cargo.lock b/Cargo.lock index 7f24a11f..6467c244 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -299,7 +299,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -501,7 +501,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1116,7 +1116,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -1484,7 +1484,7 @@ dependencies = [ [[package]] name = "pil-std-lib" version = "0.1.0" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#d02c37288817e8ea852f04484ff58512ec032b92" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#c21166b075d6cbaf93cd8fe81820e35af66847a2" dependencies = [ "log", "num-bigint", @@ -1502,7 +1502,7 @@ dependencies = [ [[package]] name = "pilout" version = "0.1.0" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#d02c37288817e8ea852f04484ff58512ec032b92" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#c21166b075d6cbaf93cd8fe81820e35af66847a2" dependencies = [ "bytes", "log", @@ -1622,7 +1622,7 @@ dependencies = [ [[package]] name = "proofman-common" version = "0.1.0" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#d02c37288817e8ea852f04484ff58512ec032b92" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#c21166b075d6cbaf93cd8fe81820e35af66847a2" dependencies = [ "env_logger", "log", @@ -1641,7 +1641,7 @@ dependencies = [ [[package]] name = "proofman-hints" version = "0.1.0" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#d02c37288817e8ea852f04484ff58512ec032b92" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#c21166b075d6cbaf93cd8fe81820e35af66847a2" dependencies = [ "log", "p3-field", @@ -1652,7 +1652,7 @@ dependencies = [ [[package]] name = "proofman-macros" version = "0.1.0" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#d02c37288817e8ea852f04484ff58512ec032b92" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#c21166b075d6cbaf93cd8fe81820e35af66847a2" dependencies = [ "proc-macro2", "quote", @@ -1662,7 +1662,7 @@ dependencies = [ [[package]] name = "proofman-starks-lib-c" version = "0.1.0" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#d02c37288817e8ea852f04484ff58512ec032b92" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#c21166b075d6cbaf93cd8fe81820e35af66847a2" dependencies = [ "log", ] @@ -1670,7 +1670,7 @@ dependencies = [ [[package]] name = "proofman-util" version = "0.1.0" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#d02c37288817e8ea852f04484ff58512ec032b92" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#c21166b075d6cbaf93cd8fe81820e35af66847a2" dependencies = [ "colored", "sysinfo 0.31.4", @@ -1693,7 +1693,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0f3e5beed80eb580c68e2c600937ac2c4eedabdfd5ef1e5b7ea4f3fba84497b" dependencies = [ "heck", - "itertools 0.10.5", + "itertools 0.13.0", "log", "multimap", "once_cell", @@ -1713,7 +1713,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.13.0", "proc-macro2", "quote", "syn", @@ -1786,7 +1786,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1984,9 +1984,10 @@ dependencies = [ "p3-field", "p3-goldilocks", "proofman-common", + "proofman-util", "sm-rom", - "sysinfo 0.33.0", - "zisk-core", + "sysinfo 0.32.1", + "zisk-pil", ] [[package]] @@ -2011,7 +2012,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2395,6 +2396,20 @@ dependencies = [ "windows", ] +[[package]] +name = "sysinfo" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c33cd241af0f2e9e3b5c32163b873b29956890b5342e6745b917ce9d490f4af" +dependencies = [ + "core-foundation-sys", + "libc", + "memchr", + "ntapi", + "rayon", + "windows", +] + [[package]] name = "sysinfo" version = "0.33.0" @@ -2425,7 +2440,7 @@ dependencies = [ "fastrand", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2637,7 +2652,7 @@ dependencies = [ [[package]] name = "transcript" version = "0.1.0" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#d02c37288817e8ea852f04484ff58512ec032b92" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#c21166b075d6cbaf93cd8fe81820e35af66847a2" dependencies = [ "proofman-starks-lib-c", ] @@ -2892,7 +2907,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -3135,7 +3150,7 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "witness" version = "0.1.0" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#d02c37288817e8ea852f04484ff58512ec032b92" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?branch=feature%2Fminor_clean#c21166b075d6cbaf93cd8fe81820e35af66847a2" dependencies = [ "colored", "env_logger", @@ -3286,6 +3301,7 @@ version = "0.1.0" dependencies = [ "proofman-common", "proofman-macros", + "serde", ] [[package]] diff --git a/pil/Cargo.toml b/pil/Cargo.toml index bd2c6227..a2a0cf3e 100644 --- a/pil/Cargo.toml +++ b/pil/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [dependencies] proofman-common = { workspace = true } proofman-macros = { workspace = true } +serde = { version = "1.0.204", features = ["derive"] } [features] default = [] diff --git a/pil/src/pil_helpers/traces.rs b/pil/src/pil_helpers/traces.rs index dcaad283..de2aeaf6 100644 --- a/pil/src/pil_helpers/traces.rs +++ b/pil/src/pil_helpers/traces.rs @@ -35,13 +35,27 @@ pub const BINARY_EXTENSION_TABLE_AIR_IDS: &[usize] = &[8]; pub const SPECIFIED_RANGES_AIR_IDS: &[usize] = &[9]; + +//PUBLICS +use serde::Deserialize; +use serde::Serialize; +#[derive(Default, Debug, Serialize, Deserialize)] +pub struct ZiskPublics { + #[serde(default)] + pub rom_root: [u64; 4], + +} + +values!(ZiskPublicValues { + rom_root: [F; 4], +}); trace!(MainTrace { a: [F; 2], b: [F; 2], c: [F; 2], flag: F, pc: F, a_src_imm: F, a_src_mem: F, a_offset_imm0: F, a_imm1: F, a_src_step: F, b_src_imm: F, b_src_mem: F, b_offset_imm0: F, b_imm1: F, b_src_ind: F, ind_width: F, is_external_op: F, op: F, store_ra: F, store_mem: F, store_ind: F, store_offset: F, set_pc: F, jmp_offset1: F, jmp_offset2: F, m32: F, addr1: F, __debug_operation_bus_enabled: F, }, 0, 0, 2097152 ); trace!(RomTrace { - line: F, a_offset_imm0: F, a_imm1: F, b_offset_imm0: F, b_imm1: F, ind_width: F, op: F, store_offset: F, jmp_offset1: F, jmp_offset2: F, flags: F, multiplicity: F, + multiplicity: F, }, 0, 1, 1048576 ); trace!(ArithTrace { @@ -76,6 +90,10 @@ trace!(SpecifiedRangesTrace { mul: [F; 1], }, 0, 9, 16777216 ); +trace!(RomRomTrace { + line: F, a_offset_imm0: F, a_imm1: F, b_offset_imm0: F, b_imm1: F, ind_width: F, op: F, store_offset: F, jmp_offset1: F, jmp_offset2: F, flags: F, +}, 0, 1, 1048576, 0 ); + values!(MainAirValues { main_last_segment: F, main_segment: F, }); diff --git a/rom-merkle/Cargo.toml b/rom-merkle/Cargo.toml index 1feb281a..13af50c1 100644 --- a/rom-merkle/Cargo.toml +++ b/rom-merkle/Cargo.toml @@ -7,11 +7,12 @@ edition = "2021" sm-rom = { path = "../state-machines/rom" } log = { workspace = true } proofman-common = { workspace = true } -zisk-core = { path = "../core" } +proofman-util = { workspace = true } +zisk-pil = { path="../pil" } p3-goldilocks = { git = "https://github.com/Plonky3/Plonky3.git", rev = "c3d754ef77b9fce585b46b972af751fe6e7a9803" } p3-field = { workspace = true } clap = { version = "4.5.13", features = ["derive", "env"] } env_logger = "0.11" -sysinfo = "0.33" +sysinfo = "0.32" colored = "2" \ No newline at end of file diff --git a/rom-merkle/src/main.rs b/rom-merkle/src/main.rs index c138df84..7aa5dd5c 100644 --- a/rom-merkle/src/main.rs +++ b/rom-merkle/src/main.rs @@ -1,40 +1,44 @@ use clap::{Arg, Command}; use colored::Colorize; -// use proofman_common::{GlobalInfo, ProofType, SetupCtx}; -use std::path::Path; +use p3_goldilocks::Goldilocks; +use proofman_common::{get_custom_commit_trace, GlobalInfo, ProofType, SetupCtx}; +use proofman_util::create_buffer_fast; +use sm_rom::RomSM; +use std::{path::Path, sync::Arc}; use sysinfo::System; -// use zisk_core::Riscv2zisk; +use zisk_pil::RomRomTrace; fn main() { let matches = Command::new("ROM Handler") .version("1.0") .about("Compute the Merkle Root of a ROM file") - .arg(Arg::new("rom").value_name("FILE").help("The ROM file path").required(true).index(1)) + .arg( + Arg::new("rom").long("rom").value_name("FILE").help("The ROM file path").required(true), + ) .arg( Arg::new("proving_key") + .long("proving-key") .value_name("FILE") .help("The proving key folder path") - .required(true) - .index(2), + .required(true), ) .arg( - Arg::new("global_info") + Arg::new("rom_buffer") + .long("rom-buffer") .value_name("FILE") - .help("The global info file path") - .required(true) - .index(3), + .help("The rom buffer path") + .required(true), ) .get_matches(); // Get the value of the `rom` argument as a path let rom_path_str = matches.get_one::("rom").expect("ROM path is required"); let rom_path = Path::new(rom_path_str); - // let proving_key_path_str = - // matches.get_one::("proving_key").expect("Proving key path is required"); - // let proving_key_path = Path::new(proving_key_path_str); - // let global_info_path_str = - // matches.get_one::("global_info").expect("Global info path is required"); - // let global_info_path = Path::new(global_info_path_str); + let proving_key_path_str = + matches.get_one::("proving_key").expect("Proving key path is required"); + let proving_key_path = Path::new(proving_key_path_str); + let rom_buffer_str = + matches.get_one::("rom_buffer").expect("Buffer file path is required"); env_logger::builder() .format_timestamp(None) @@ -76,29 +80,25 @@ fn main() { std::process::exit(1); } - // If all checks pass, continue with the program - println!("ROM Path is valid: {}", rom_path.display()); - - // let _buffer_allocator: Arc = - // Arc::new(StarkBufferAllocator::new(proving_key_path.to_path_buf())); - // let global_info = GlobalInfo::new(global_info_path); - // let _sctx = Arc::new(SetupCtx::new(&global_info, &ProofType::Basic)); + let global_info = GlobalInfo::new(proving_key_path); + let sctx = Arc::new(SetupCtx::new(&global_info, &ProofType::Basic)); - // // Get the ELF file path as a string - // let elf_filename: String = rom_path.to_str().unwrap().into(); - // println!("Proving ROM for ELF file={}", elf_filename); + let mut custom_rom_trace: RomRomTrace = RomRomTrace::new(); + let setup = sctx.get_setup(custom_rom_trace.airgroup_id(), custom_rom_trace.air_id); - // // Create an instance of the RISCV -> ZisK program converter - // let riscv2zisk = Riscv2zisk::new(elf_filename, String::new(), String::new(), String::new()); + RomSM::compute_custom_trace_rom(rom_path.to_path_buf(), &mut custom_rom_trace); - // // Convert program to rom - // let _rom = riscv2zisk.run().expect("RomSM::prover() failed running rom"); + let n_ext = (1 << setup.stark_info.stark_struct.n_bits_ext) as usize; + let n_cols = custom_rom_trace.num_rows(); - // // Compute the trace - // // RomSM::::prove_instance(wcm, rom, plan, buffer, trace_rows); + let buffer_ext = create_buffer_fast(n_ext * n_cols); - // // Compute LDE and Merkelize and get the root of the rom - // // TODO: Implement the logic to compute the trace - - log::info!("ROM proof successful"); + get_custom_commit_trace( + custom_rom_trace.commit_id.unwrap() as u64, + 0, + setup, + custom_rom_trace.get_buffer(), + buffer_ext, + rom_buffer_str.as_str(), + ); } diff --git a/state-machines/rom/pil/rom.pil b/state-machines/rom/pil/rom.pil index 2c2011e0..578333bc 100644 --- a/state-machines/rom/pil/rom.pil +++ b/state-machines/rom/pil/rom.pil @@ -2,19 +2,22 @@ require "std_lookup.pil" const int ROM_BUS_ID = 7890; +public rom_root[4]; + airtemplate Rom(int N = 2**21, int stack_enabled = 0, const int rom_bus_id = ROM_BUS_ID) { + commit stage(0) public(rom_root) rom; - col witness line; - col witness a_offset_imm0; - col witness a_imm1; - col witness b_offset_imm0; - col witness b_imm1; - col witness ind_width; - col witness op; - col witness store_offset; - col witness jmp_offset1; - col witness jmp_offset2; - col witness flags; + col rom line; + col rom a_offset_imm0; + col rom a_imm1; + col rom b_offset_imm0; + col rom b_imm1; + col rom ind_width; + col rom op; + col rom store_offset; + col rom jmp_offset1; + col rom jmp_offset2; + col rom flags; col witness multiplicity; diff --git a/state-machines/rom/src/rom.rs b/state-machines/rom/src/rom.rs index 18330852..2e808a39 100644 --- a/state-machines/rom/src/rom.rs +++ b/state-machines/rom/src/rom.rs @@ -1,14 +1,13 @@ -use std::sync::Arc; +use std::{path::PathBuf, sync::Arc}; use itertools::Itertools; use log::info; use p3_field::PrimeField; use sm_common::{ComponentProvider, Instance, InstanceExpanderCtx, Metrics, Plan, Planner}; -use zisk_core::{ZiskRom, SRC_IMM}; -use zisk_pil::{MainTrace, RomTrace, RomTraceRow}; - use crate::{RomCounter, RomInstance, RomPlanner}; +use zisk_core::{Riscv2zisk, ZiskRom, SRC_IMM}; +use zisk_pil::{MainTrace, RomRomTrace, RomRomTraceRow, RomTrace, RomTraceRow}; pub struct RomSM { zisk_rom: Arc, @@ -25,7 +24,7 @@ impl RomSM { rom: &ZiskRom, plan: &Plan, rom_trace: &mut RomTrace, - trace_rows: usize, + mut rom_custom_trace: &mut RomRomTrace, ) { let metadata = plan.meta.as_ref().unwrap().downcast_ref::().unwrap(); @@ -42,10 +41,7 @@ impl RomSM { // For every instruction in the rom, fill its corresponding ROM trace //for (i, inst_builder) in rom.insts.clone().into_iter().enumerate() { - let keys = rom.insts.keys(); - let sorted_keys = keys.sorted(); - let mut i = 0; - for key in sorted_keys { + for (i, key) in rom.insts.keys().sorted().enumerate() { // Get the Zisk instruction let inst = &rom.insts[key].i; @@ -66,6 +62,22 @@ impl RomSM { continue; // We skip those pc's that are not used in this execution } } + rom_trace[i].multiplicity = F::from_canonical_u64(multiplicity); + } + + // Padd with zeroes + for i in rom.insts.len()..rom_trace.num_rows() { + rom_trace[i] = RomTraceRow::default(); + } + + Self::compute_trace_rom(rom, &mut rom_custom_trace); + } + + pub fn compute_trace_rom(rom: &ZiskRom, rom_custom_trace: &mut RomRomTrace) { + // For every instruction in the rom, fill its corresponding ROM trace + for (i, key) in rom.insts.keys().sorted().enumerate() { + // Get the Zisk instruction + let inst = &rom.insts[key].i; // Convert the i64 offsets to F let jmp_offset1 = if inst.jmp_offset1 >= 0 { @@ -95,46 +107,45 @@ impl RomSM { }; // Fill the rom trace row fields - rom_trace[i].line = F::from_canonical_u64(inst.paddr); // TODO: unify names: pc, paddr, line - rom_trace[i].a_offset_imm0 = a_offset_imm0; - rom_trace[i].a_imm1 = + rom_custom_trace[i].line = F::from_canonical_u64(inst.paddr); // TODO: unify names: pc, paddr, line + rom_custom_trace[i].a_offset_imm0 = a_offset_imm0; + rom_custom_trace[i].a_imm1 = F::from_canonical_u64(if inst.a_src == SRC_IMM { inst.a_use_sp_imm1 } else { 0 }); - rom_trace[i].b_offset_imm0 = b_offset_imm0; - rom_trace[i].b_imm1 = + rom_custom_trace[i].b_offset_imm0 = b_offset_imm0; + rom_custom_trace[i].b_imm1 = F::from_canonical_u64(if inst.b_src == SRC_IMM { inst.b_use_sp_imm1 } else { 0 }); - //rom_trace[i].b_src_ind = - // F::from_canonical_u64(if inst.b_src == SRC_IND { 1 } else { 0 }); - rom_trace[i].ind_width = F::from_canonical_u64(inst.ind_width); - rom_trace[i].op = F::from_canonical_u8(inst.op); - rom_trace[i].store_offset = store_offset; - rom_trace[i].jmp_offset1 = jmp_offset1; - rom_trace[i].jmp_offset2 = jmp_offset2; - rom_trace[i].flags = F::from_canonical_u64(inst.get_flags()); - rom_trace[i].multiplicity = F::from_canonical_u64(multiplicity); - /*println!( - "ROM SM [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}], {}", - inst.paddr, - inst.a_offset_imm0, - if inst.a_src == SRC_IMM { inst.a_use_sp_imm1 } else { 0 }, - inst.b_offset_imm0, - if inst.b_src == SRC_IMM { inst.b_use_sp_imm1 } else { 0 }, - if inst.b_src == SRC_IND { 1 } else { 0 }, - inst.ind_width, - inst.op, - inst.store_offset as u64, - inst.jmp_offset1 as u64, - inst.jmp_offset2 as u64, - inst.get_flags(), - multiplicity, - );*/ - i += 1; + rom_custom_trace[i].ind_width = F::from_canonical_u64(inst.ind_width); + rom_custom_trace[i].op = F::from_canonical_u8(inst.op); + rom_custom_trace[i].store_offset = store_offset; + rom_custom_trace[i].jmp_offset1 = jmp_offset1; + rom_custom_trace[i].jmp_offset2 = jmp_offset2; + rom_custom_trace[i].flags = F::from_canonical_u64(inst.get_flags()); } // Padd with zeroes - for i in rom.insts.len()..trace_rows { - rom_trace[i] = RomTraceRow::default(); + for i in rom.insts.len()..rom_custom_trace.num_rows() { + rom_custom_trace[i] = RomRomTraceRow::default(); } } + + pub fn compute_custom_trace_rom( + rom_path: PathBuf, + rom_custom_trace: &mut RomRomTrace, + ) { + // Get the ELF file path as a string + let elf_filename: String = rom_path.to_str().unwrap().into(); + println!("Proving ROM for ELF file={}", elf_filename); + + // Load and parse the ELF file, and transpile it into a ZisK ROM using Riscv2zisk + + // Create an instance of the RISCV -> ZisK program converter + let riscv2zisk = Riscv2zisk::new(elf_filename, String::new(), String::new(), String::new()); + + // Convert program to rom + let rom = riscv2zisk.run().expect("RomSM::prover() failed converting elf to rom"); + + Self::compute_trace_rom(&rom, rom_custom_trace); + } } impl ComponentProvider for RomSM { diff --git a/state-machines/rom/src/rom_instance.rs b/state-machines/rom/src/rom_instance.rs index c074649a..60f559fc 100644 --- a/state-machines/rom/src/rom_instance.rs +++ b/state-machines/rom/src/rom_instance.rs @@ -4,24 +4,27 @@ use p3_field::PrimeField; use proofman_common::{AirInstance, FromTrace, ProofCtx}; use sm_common::{Instance, InstanceExpanderCtx, InstanceType}; use zisk_core::ZiskRom; -use zisk_pil::RomTrace; +use zisk_pil::{RomRomTrace, RomTrace}; use crate::RomSM; pub struct RomInstance { /// Instance expander context - iectx: InstanceExpanderCtx, - - /// Zisk ROM zisk_rom: Arc, - - /// ROM trace - trace: RomTrace, + iectx: InstanceExpanderCtx, + rom_trace: RomTrace, + rom_custom_trace: RomRomTrace, } impl RomInstance { - pub fn new(zisk_rom: Arc, iectx: InstanceExpanderCtx) -> Self { - Self { iectx, zisk_rom, trace: RomTrace::new() } + pub fn new( + zisk_rom: Arc, + iectx: InstanceExpanderCtx, + ) -> Self { + let rom_trace = RomTrace::new(); + let rom_custom_trace = RomRomTrace::new(); + + Self { zisk_rom, iectx, rom_trace, rom_custom_trace } } } @@ -30,11 +33,14 @@ impl Instance for RomInstance { RomSM::prove_instance( &self.zisk_rom, &self.iectx.plan, - &mut self.trace, - RomTrace::::NUM_ROWS, + &mut self.rom_trace, + &mut self.rom_custom_trace, ); - Some(AirInstance::new_from_trace(FromTrace::new(&mut self.trace))) + Some(AirInstance::new_from_trace( + FromTrace::new(&mut self.rom_trace) + .with_custom_traces(vec![&mut self.rom_custom_trace]) + )) } fn instance_type(&self) -> InstanceType {