@@ -21,6 +21,7 @@ use blockifier::context::BlockContext;
21
21
use blockifier:: invoke_tx_args;
22
22
use blockifier:: state:: cached_state:: { CachedState , TransactionalState } ;
23
23
use blockifier:: state:: state_api:: State ;
24
+ use blockifier:: state:: visited_pcs:: VisitedPcsSet ;
24
25
use blockifier:: test_utils:: contracts:: FeatureContract ;
25
26
use blockifier:: test_utils:: dict_state_reader:: DictStateReader ;
26
27
use blockifier:: test_utils:: initial_test_state:: test_state;
@@ -65,7 +66,7 @@ pub fn cached_state_benchmark(c: &mut Criterion) {
65
66
}
66
67
67
68
// The state shared across all iterations.
68
- let mut cached_state: CachedState < DictStateReader > = CachedState :: default ( ) ;
69
+ let mut cached_state: CachedState < DictStateReader , VisitedPcsSet > = CachedState :: default ( ) ;
69
70
70
71
c. bench_function ( "cached_state" , move |benchmark| {
71
72
benchmark. iter_batched (
@@ -81,107 +82,107 @@ pub fn cached_state_benchmark(c: &mut Criterion) {
81
82
let mut random_arrays = Vec :: new ( ) ;
82
83
83
84
let class_hash = create_class_hash ( "a" ) ;
84
- let random_array = get_random_array ( 11393 ) . into_iter ( ) . collect ( ) ;
85
+ let random_array: Vec < usize > = get_random_array ( 11393 ) . into_iter ( ) . collect ( ) ;
85
86
class_hashes. push ( class_hash) ;
86
87
random_arrays. push ( random_array) ;
87
88
88
89
let class_hash = create_class_hash ( "a" ) ;
89
- let random_array = get_random_array ( 453 ) . into_iter ( ) . collect ( ) ;
90
+ let random_array: Vec < usize > = get_random_array ( 453 ) . into_iter ( ) . collect ( ) ;
90
91
class_hashes. push ( class_hash) ;
91
92
random_arrays. push ( random_array) ;
92
93
93
94
let class_hash = create_class_hash ( "a" ) ;
94
- let random_array = get_random_array ( 604 ) . into_iter ( ) . collect ( ) ;
95
+ let random_array: Vec < usize > = get_random_array ( 604 ) . into_iter ( ) . collect ( ) ;
95
96
class_hashes. push ( class_hash) ;
96
97
random_arrays. push ( random_array) ;
97
98
98
99
let class_hash = create_class_hash ( "a" ) ;
99
- let random_array = get_random_array ( 806 ) . into_iter ( ) . collect ( ) ;
100
+ let random_array: Vec < usize > = get_random_array ( 806 ) . into_iter ( ) . collect ( ) ;
100
101
class_hashes. push ( class_hash) ;
101
102
random_arrays. push ( random_array) ;
102
103
103
104
let class_hash = create_class_hash ( "b" ) ;
104
- let random_array = get_random_array ( 1327 ) . into_iter ( ) . collect ( ) ;
105
+ let random_array: Vec < usize > = get_random_array ( 1327 ) . into_iter ( ) . collect ( ) ;
105
106
class_hashes. push ( class_hash) ;
106
107
random_arrays. push ( random_array) ;
107
108
108
109
let class_hash = create_class_hash ( "b" ) ;
109
- let random_array = get_random_array ( 1135 ) . into_iter ( ) . collect ( ) ;
110
+ let random_array: Vec < usize > = get_random_array ( 1135 ) . into_iter ( ) . collect ( ) ;
110
111
class_hashes. push ( class_hash) ;
111
112
random_arrays. push ( random_array) ;
112
113
113
114
let class_hash = create_class_hash ( "b" ) ;
114
- let random_array = get_random_array ( 213 ) . into_iter ( ) . collect ( ) ;
115
+ let random_array: Vec < usize > = get_random_array ( 213 ) . into_iter ( ) . collect ( ) ;
115
116
class_hashes. push ( class_hash) ;
116
117
random_arrays. push ( random_array) ;
117
118
118
119
let class_hash = create_class_hash ( "b" ) ;
119
- let random_array = get_random_array ( 135 ) . into_iter ( ) . collect ( ) ;
120
+ let random_array: Vec < usize > = get_random_array ( 135 ) . into_iter ( ) . collect ( ) ;
120
121
class_hashes. push ( class_hash) ;
121
122
random_arrays. push ( random_array) ;
122
123
123
124
let class_hash = create_class_hash ( "c" ) ;
124
- let random_array = get_random_array ( 348 ) . into_iter ( ) . collect ( ) ;
125
+ let random_array: Vec < usize > = get_random_array ( 348 ) . into_iter ( ) . collect ( ) ;
125
126
class_hashes. push ( class_hash) ;
126
127
random_arrays. push ( random_array) ;
127
128
128
129
let class_hash = create_class_hash ( "c" ) ;
129
- let random_array = get_random_array ( 88 ) . into_iter ( ) . collect ( ) ;
130
+ let random_array: Vec < usize > = get_random_array ( 88 ) . into_iter ( ) . collect ( ) ;
130
131
class_hashes. push ( class_hash) ;
131
132
random_arrays. push ( random_array) ;
132
133
133
134
let class_hash = create_class_hash ( "c" ) ;
134
- let random_array = get_random_array ( 348 ) . into_iter ( ) . collect ( ) ;
135
+ let random_array: Vec < usize > = get_random_array ( 348 ) . into_iter ( ) . collect ( ) ;
135
136
class_hashes. push ( class_hash) ;
136
137
random_arrays. push ( random_array) ;
137
138
138
139
let class_hash = create_class_hash ( "c" ) ;
139
- let random_array = get_random_array ( 348 ) . into_iter ( ) . collect ( ) ;
140
+ let random_array: Vec < usize > = get_random_array ( 348 ) . into_iter ( ) . collect ( ) ;
140
141
class_hashes. push ( class_hash) ;
141
142
random_arrays. push ( random_array) ;
142
143
143
144
let class_hash = create_class_hash ( "d" ) ;
144
- let random_array = get_random_array ( 875 ) . into_iter ( ) . collect ( ) ;
145
+ let random_array: Vec < usize > = get_random_array ( 875 ) . into_iter ( ) . collect ( ) ;
145
146
class_hashes. push ( class_hash) ;
146
147
random_arrays. push ( random_array) ;
147
148
148
149
let class_hash = create_class_hash ( "d" ) ;
149
- let random_array = get_random_array ( 450 ) . into_iter ( ) . collect ( ) ;
150
+ let random_array: Vec < usize > = get_random_array ( 450 ) . into_iter ( ) . collect ( ) ;
150
151
class_hashes. push ( class_hash) ;
151
152
random_arrays. push ( random_array) ;
152
153
153
154
let class_hash = create_class_hash ( "d" ) ;
154
- let random_array = get_random_array ( 255 ) . into_iter ( ) . collect ( ) ;
155
+ let random_array: Vec < usize > = get_random_array ( 255 ) . into_iter ( ) . collect ( ) ;
155
156
class_hashes. push ( class_hash) ;
156
157
random_arrays. push ( random_array) ;
157
158
158
159
let class_hash = create_class_hash ( "d" ) ;
159
- let random_array = get_random_array ( 210 ) . into_iter ( ) . collect ( ) ;
160
+ let random_array: Vec < usize > = get_random_array ( 210 ) . into_iter ( ) . collect ( ) ;
160
161
class_hashes. push ( class_hash) ;
161
162
random_arrays. push ( random_array) ;
162
163
163
164
let class_hash = create_class_hash ( "d" ) ;
164
- let random_array = get_random_array ( 1403 ) . into_iter ( ) . collect ( ) ;
165
+ let random_array: Vec < usize > = get_random_array ( 1403 ) . into_iter ( ) . collect ( ) ;
165
166
class_hashes. push ( class_hash) ;
166
167
random_arrays. push ( random_array) ;
167
168
168
169
let class_hash = create_class_hash ( "d" ) ;
169
- let random_array = get_random_array ( 210 ) . into_iter ( ) . collect ( ) ;
170
+ let random_array: Vec < usize > = get_random_array ( 210 ) . into_iter ( ) . collect ( ) ;
170
171
class_hashes. push ( class_hash) ;
171
172
random_arrays. push ( random_array) ;
172
173
173
174
let class_hash = create_class_hash ( "d" ) ;
174
- let random_array = get_random_array ( 210 ) . into_iter ( ) . collect ( ) ;
175
+ let random_array: Vec < usize > = get_random_array ( 210 ) . into_iter ( ) . collect ( ) ;
175
176
class_hashes. push ( class_hash) ;
176
177
random_arrays. push ( random_array) ;
177
178
178
179
let class_hash = create_class_hash ( "e" ) ;
179
- let random_array = get_random_array ( 2386 ) . into_iter ( ) . collect ( ) ;
180
+ let random_array: Vec < usize > = get_random_array ( 2386 ) . into_iter ( ) . collect ( ) ;
180
181
class_hashes. push ( class_hash) ;
181
182
random_arrays. push ( random_array) ;
182
183
183
184
let class_hash = create_class_hash ( "e" ) ;
184
- let random_array = get_random_array ( 3602 ) . into_iter ( ) . collect ( ) ;
185
+ let random_array: Vec < usize > = get_random_array ( 3602 ) . into_iter ( ) . collect ( ) ;
185
186
class_hashes. push ( class_hash) ;
186
187
random_arrays. push ( random_array) ;
187
188
@@ -202,7 +203,8 @@ pub fn cached_state_benchmark(c: &mut Criterion) {
202
203
203
204
pub fn execution_benchmark ( c : & mut Criterion ) {
204
205
/// This function sets up and returns all the objects required to execute an invoke transaction.
205
- fn prepare_account_tx ( ) -> ( AccountTransaction , CachedState < DictStateReader > , BlockContext ) {
206
+ fn prepare_account_tx ( )
207
+ -> ( AccountTransaction , CachedState < DictStateReader , VisitedPcsSet > , BlockContext ) {
206
208
let block_context = block_context ( ) ;
207
209
let max_resource_bounds = max_resource_bounds ( ) ;
208
210
let cairo_version = CairoVersion :: Cairo1 ;
0 commit comments