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