@@ -26,9 +26,6 @@ use aptos_block_executor::{
2626use aptos_infallible:: Mutex ;
2727use aptos_state_view:: { StateView , StateViewId } ;
2828use aptos_types:: {
29- block_executor:: partitioner:: {
30- BlockExecutorTransactions , SubBlock , SubBlocksForShard , TransactionWithDependencies ,
31- } ,
3229 executable:: ExecutableTestType ,
3330 fee_statement:: FeeStatement ,
3431 state_store:: state_key:: StateKey ,
@@ -145,59 +142,20 @@ impl BlockExecutorTransactionOutput for AptosTransactionOutput {
145142pub struct BlockAptosVM ( ) ;
146143
147144impl BlockAptosVM {
148- fn verify_transactions (
149- transactions : BlockExecutorTransactions < Transaction > ,
150- ) -> BlockExecutorTransactions < PreprocessedTransaction > {
151- match transactions {
152- BlockExecutorTransactions :: Unsharded ( transactions) => {
153- let signature_verified_txns = transactions
154- . into_par_iter ( )
155- . with_min_len ( 25 )
156- . map ( preprocess_transaction :: < AptosVM > )
157- . collect ( ) ;
158- BlockExecutorTransactions :: Unsharded ( signature_verified_txns)
159- } ,
160- BlockExecutorTransactions :: Sharded ( sub_blocks) => {
161- let shard_id = sub_blocks. shard_id ;
162- let signature_verified_sub_blocks = sub_blocks
163- . into_sub_blocks ( )
164- . into_par_iter ( )
165- . map ( |sub_block| {
166- let start_index = sub_block. start_index ;
167- let verified_txns = sub_block
168- . into_transactions_with_deps ( )
169- . into_par_iter ( )
170- . with_min_len ( 25 )
171- . map ( |txn_with_deps| {
172- let TransactionWithDependencies {
173- txn,
174- cross_shard_dependencies,
175- } = txn_with_deps;
176- let preprocessed_txn = preprocess_transaction :: < AptosVM > ( txn) ;
177- TransactionWithDependencies :: new (
178- preprocessed_txn,
179- cross_shard_dependencies,
180- )
181- } )
182- . collect ( ) ;
183- SubBlock :: new ( start_index, verified_txns)
184- } )
185- . collect ( ) ;
186-
187- BlockExecutorTransactions :: Sharded ( SubBlocksForShard :: new (
188- shard_id,
189- signature_verified_sub_blocks,
190- ) )
191- } ,
192- }
145+ fn verify_transactions ( transactions : Vec < Transaction > ) -> Vec < PreprocessedTransaction > {
146+ transactions
147+ . into_par_iter ( )
148+ . with_min_len ( 25 )
149+ . map ( preprocess_transaction :: < AptosVM > )
150+ . collect ( )
193151 }
194152
195153 pub fn execute_block <
196154 S : StateView + Sync ,
197155 L : TransactionCommitHook < Output = AptosTransactionOutput > ,
198156 > (
199157 executor_thread_pool : Arc < ThreadPool > ,
200- transactions : BlockExecutorTransactions < Transaction > ,
158+ transactions : Vec < Transaction > ,
201159 state_view : & S ,
202160 concurrency_level : usize ,
203161 maybe_block_gas_limit : Option < u64 > ,
@@ -214,21 +172,13 @@ impl BlockAptosVM {
214172 executor_thread_pool. install ( || Self :: verify_transactions ( transactions) ) ;
215173 drop ( signature_verification_timer) ;
216174
217- let is_sharded_execution = matches ! (
218- signature_verified_block,
219- BlockExecutorTransactions :: Sharded ( _)
220- ) ;
221- let num_txns = signature_verified_block. num_txns ( ) ;
222- if !is_sharded_execution && state_view. id ( ) != StateViewId :: Miscellaneous {
175+ let num_txns = signature_verified_block. len ( ) ;
176+ if state_view. id ( ) != StateViewId :: Miscellaneous {
223177 // Speculation is disabled in Miscellaneous context, which is used by testing and
224178 // can even lead to concurrent execute_block invocations, leading to errors on flush.
225179 init_speculative_logs ( num_txns) ;
226180 }
227181
228- if is_sharded_execution {
229- aptos_vm_logging:: disable_speculative_logging ( ) ;
230- }
231-
232182 BLOCK_EXECUTOR_CONCURRENCY . set ( concurrency_level as i64 ) ;
233183 let executor = BlockExecutor :: <
234184 PreprocessedTransaction ,
@@ -254,7 +204,7 @@ impl BlockAptosVM {
254204 // Flush the speculative logs of the committed transactions.
255205 let pos = output_vec. partition_point ( |o| !o. status ( ) . is_retry ( ) ) ;
256206
257- if !is_sharded_execution && state_view. id ( ) != StateViewId :: Miscellaneous {
207+ if state_view. id ( ) != StateViewId :: Miscellaneous {
258208 // Speculation is disabled in Miscellaneous context, which is used by testing and
259209 // can even lead to concurrent execute_block invocations, leading to errors on flush.
260210 flush_speculative_logs ( pos) ;
0 commit comments