Skip to content

Commit 194c5b2

Browse files
committed
fix: e2e test for program inst stark gen
1 parent 14645c8 commit 194c5b2

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

.github/workflows/rust.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
- name: Build
2020
run: cargo build --verbose
2121
- name: Run tests
22-
run: cargo test --verbose
22+
run: cargo nextest run --verbose

src/e2e_tests.rs

+21-13
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ mod tests {
1818
};
1919

2020
use crate::{
21+
preflight_simulator::PreflightSimulation,
2122
stark_program_instructions::ProgramInstructionsStark,
2223
vm_specs::{
2324
Instruction,
@@ -52,28 +53,32 @@ mod tests {
5253
memory_init,
5354
};
5455

56+
// Stark specific setup
57+
58+
// D = 2 for quadratic extension
59+
const D: usize = 2;
60+
type C = PoseidonGoldilocksConfig;
61+
type F = <C as GenericConfig<D>>::F;
62+
type PR = StarkProofWithPublicInputs<GoldilocksField, C, 2>;
63+
64+
let mut config = StarkConfig::standard_fast_config();
65+
// This needs to be done for tables shorter than `1<<5`. We take
66+
// a performance hit though!
67+
config
68+
.fri_config
69+
.cap_height = 1;
70+
5571
// Generate the static part of the proof
5672
let program_proof = {
57-
const D: usize = 2;
58-
type C = PoseidonGoldilocksConfig;
59-
type F = <C as GenericConfig<D>>::F;
6073
type S = ProgramInstructionsStark<F, D>;
61-
type PR = StarkProofWithPublicInputs<GoldilocksField, C, 2>;
6274

6375
let stark = S::new();
64-
let mut config = StarkConfig::standard_fast_config();
65-
// Need to do this since our table is small. Need atleast 1<<5
66-
// sized table to not affect this
67-
config
68-
.fri_config
69-
.cap_height = 1;
70-
let program = Program::default();
71-
let trace =
76+
let trace_poly_values =
7277
ProgramInstructionsStark::<F, D>::generate_trace(&program);
7378
let proof: Result<PR, anyhow::Error> = prove(
7479
stark.clone(),
7580
&config,
76-
trace,
81+
trace_poly_values,
7782
&[],
7883
&mut TimingTree::default(),
7984
);
@@ -84,5 +89,8 @@ mod tests {
8489
assert!(verification.is_ok());
8590
proof
8691
};
92+
93+
// Simuate the program PreFlight
94+
let simulation = PreflightSimulation::simulate(&program);
8795
}
8896
}

0 commit comments

Comments
 (0)