@@ -18,6 +18,7 @@ mod tests {
18
18
} ;
19
19
20
20
use crate :: {
21
+ preflight_simulator:: PreflightSimulation ,
21
22
stark_program_instructions:: ProgramInstructionsStark ,
22
23
vm_specs:: {
23
24
Instruction ,
@@ -52,28 +53,32 @@ mod tests {
52
53
memory_init,
53
54
} ;
54
55
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
+
55
71
// Generate the static part of the proof
56
72
let program_proof = {
57
- const D : usize = 2 ;
58
- type C = PoseidonGoldilocksConfig ;
59
- type F = <C as GenericConfig < D > >:: F ;
60
73
type S = ProgramInstructionsStark < F , D > ;
61
- type PR = StarkProofWithPublicInputs < GoldilocksField , C , 2 > ;
62
74
63
75
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 =
72
77
ProgramInstructionsStark :: < F , D > :: generate_trace ( & program) ;
73
78
let proof: Result < PR , anyhow:: Error > = prove (
74
79
stark. clone ( ) ,
75
80
& config,
76
- trace ,
81
+ trace_poly_values ,
77
82
& [ ] ,
78
83
& mut TimingTree :: default ( ) ,
79
84
) ;
@@ -84,5 +89,8 @@ mod tests {
84
89
assert ! ( verification. is_ok( ) ) ;
85
90
proof
86
91
} ;
92
+
93
+ // Simuate the program PreFlight
94
+ let simulation = PreflightSimulation :: simulate ( & program) ;
87
95
}
88
96
}
0 commit comments