@@ -7,15 +7,14 @@ use std::{
7
7
8
8
use derive_more:: derive:: From ;
9
9
use getset:: Getters ;
10
- use itertools:: Itertools ;
11
10
#[ cfg( feature = "bench-metrics" ) ]
12
11
use metrics:: counter;
13
12
use openvm_circuit_derive:: { AnyEnum , InstructionExecutor } ;
14
13
use openvm_circuit_primitives:: {
15
14
utils:: next_power_of_two_or_zero,
16
15
var_range:: { SharedVariableRangeCheckerChip , VariableRangeCheckerBus } ,
17
16
} ;
18
- use openvm_circuit_primitives_derive:: { BytesStateful , Chip , ChipUsageGetter } ;
17
+ use openvm_circuit_primitives_derive:: { Chip , ChipUsageGetter } ;
19
18
use openvm_instructions:: {
20
19
program:: Program , LocalOpcode , PhantomDiscriminant , PublishOpcode , SystemOpcode , VmOpcode ,
21
20
} ;
@@ -25,7 +24,7 @@ use openvm_stark_backend::{
25
24
p3_field:: { FieldAlgebra , PrimeField32 } ,
26
25
p3_matrix:: Matrix ,
27
26
prover:: types:: { AirProofInput , CommittedTraceData , ProofInput } ,
28
- AirRef , Chip , ChipUsageGetter , Stateful ,
27
+ AirRef , Chip , ChipUsageGetter ,
29
28
} ;
30
29
use rustc_hash:: FxHashMap ;
31
30
use serde:: { Deserialize , Serialize } ;
@@ -39,7 +38,6 @@ use crate::metrics::VmMetrics;
39
38
use crate :: system:: {
40
39
connector:: VmConnectorChip ,
41
40
memory:: {
42
- interface:: MemoryInterface ,
43
41
merkle:: { DirectCompressionBus , MemoryMerkleBus } ,
44
42
offline_checker:: { MemoryBridge , MemoryBus } ,
45
43
online:: MemoryLogEntry ,
@@ -406,26 +404,6 @@ impl<E, P> VmInventory<E, P> {
406
404
}
407
405
}
408
406
409
- impl < E : Stateful < Vec < u8 > > , P : Stateful < Vec < u8 > > > Stateful < VmInventoryState > for VmInventory < E , P > {
410
- fn load_state ( & mut self , state : VmInventoryState ) {
411
- for ( e, s) in self . executors . iter_mut ( ) . zip_eq ( state. executors ) {
412
- e. load_state ( s)
413
- }
414
- for ( p, s) in self . periphery . iter_mut ( ) . zip_eq ( state. periphery ) {
415
- p. load_state ( s)
416
- }
417
- }
418
-
419
- fn store_state ( & self ) -> VmInventoryState {
420
- let executors = self . executors . iter ( ) . map ( |e| e. store_state ( ) ) . collect ( ) ;
421
- let periphery = self . periphery . iter ( ) . map ( |p| p. store_state ( ) ) . collect ( ) ;
422
- VmInventoryState {
423
- executors,
424
- periphery,
425
- }
426
- }
427
- }
428
-
429
407
impl VmInventoryTraceHeights {
430
408
/// Round all trace heights to the next power of two. This will round trace heights of 0 to 1.
431
409
pub fn round_to_next_power_of_two ( & mut self ) {
@@ -548,37 +526,13 @@ impl<F: PrimeField32> SystemBase<F> {
548
526
}
549
527
}
550
528
551
- impl < F : PrimeField32 > Stateful < SystemBaseState < F > > for SystemBase < F > {
552
- fn load_state ( & mut self , state : SystemBaseState < F > ) {
553
- self . range_checker_chip . load_state ( state. range_checker_chip ) ;
554
- if let Some ( initial_memory) = state. initial_memory {
555
- self . memory_controller . set_initial_memory ( initial_memory) ;
556
- }
557
- self . memory_controller . set_memory_logs ( state. memory_logs ) ;
558
- self . connector_chip . load_state ( state. connector_chip ) ;
559
- self . program_chip . load_state ( state. program_chip ) ;
560
- }
561
- fn store_state ( & self ) -> SystemBaseState < F > {
562
- SystemBaseState {
563
- range_checker_chip : self . range_checker_chip . store_state ( ) ,
564
- initial_memory : match & self . memory_controller . interface_chip {
565
- MemoryInterface :: Volatile { .. } => None ,
566
- MemoryInterface :: Persistent { initial_memory, .. } => Some ( initial_memory. clone ( ) ) ,
567
- } ,
568
- memory_logs : self . memory_controller . get_memory_logs ( ) ,
569
- connector_chip : self . connector_chip . store_state ( ) ,
570
- program_chip : self . program_chip . store_state ( ) ,
571
- }
572
- }
573
- }
574
-
575
- #[ derive( ChipUsageGetter , Chip , AnyEnum , From , InstructionExecutor , BytesStateful ) ]
529
+ #[ derive( ChipUsageGetter , Chip , AnyEnum , From , InstructionExecutor ) ]
576
530
pub enum SystemExecutor < F : PrimeField32 > {
577
531
PublicValues ( PublicValuesChip < F > ) ,
578
532
Phantom ( RefCell < PhantomChip < F > > ) ,
579
533
}
580
534
581
- #[ derive( ChipUsageGetter , Chip , AnyEnum , From , BytesStateful ) ]
535
+ #[ derive( ChipUsageGetter , Chip , AnyEnum , From ) ]
582
536
pub enum SystemPeriphery < F : PrimeField32 > {
583
537
/// Poseidon2 chip with direct compression interactions
584
538
Poseidon2 ( Poseidon2PeripheryChip < F > ) ,
@@ -1122,22 +1076,6 @@ impl<F: PrimeField32, E, P> VmChipComplex<F, E, P> {
1122
1076
}
1123
1077
}
1124
1078
1125
- impl < F : PrimeField32 , E : Stateful < Vec < u8 > > , P : Stateful < Vec < u8 > > > Stateful < VmChipComplexState < F > >
1126
- for VmChipComplex < F , E , P >
1127
- {
1128
- fn load_state ( & mut self , state : VmChipComplexState < F > ) {
1129
- self . base . load_state ( state. base ) ;
1130
- self . inventory . load_state ( state. inventory ) ;
1131
- }
1132
-
1133
- fn store_state ( & self ) -> VmChipComplexState < F > {
1134
- VmChipComplexState {
1135
- base : self . base . store_state ( ) ,
1136
- inventory : self . inventory . store_state ( ) ,
1137
- }
1138
- }
1139
- }
1140
-
1141
1079
struct VmProofInputBuilder < SC : StarkGenericConfig > {
1142
1080
curr_air_id : usize ,
1143
1081
proof_input_per_air : Vec < ( usize , AirProofInput < SC > ) > ,
0 commit comments