diff --git a/aptos-move/aptos-vm/src/sharded_block_executor/sharded_executor_service.rs b/aptos-move/aptos-vm/src/sharded_block_executor/sharded_executor_service.rs index 15c627732cca0..d6b09906a50a2 100644 --- a/aptos-move/aptos-vm/src/sharded_block_executor/sharded_executor_service.rs +++ b/aptos-move/aptos-vm/src/sharded_block_executor/sharded_executor_service.rs @@ -136,13 +136,16 @@ impl ShardedExecutorService { ); }); s.spawn(move |_| { + // Since we execute blocks in parallel, we cannot share module caches, so each + // thread has its own caches. + let module_cache_manager = ModuleCacheManager::new(); + module_cache_manager.mark_ready(None, None); + let ret = BlockAptosVM::execute_block_on_thread_pool( executor_thread_pool, &signature_verified_transactions, aggr_overridden_state_view.as_ref(), - // Since we execute blocks in parallel, we cannot share module caches, so each - // thread has its own caches. - &ModuleCacheManager::new(), + &module_cache_manager, config, cross_shard_commit_sender, ) diff --git a/aptos-move/e2e-tests/src/executor.rs b/aptos-move/e2e-tests/src/executor.rs index d8a34e73cf2b1..cff14879c0c52 100644 --- a/aptos-move/e2e-tests/src/executor.rs +++ b/aptos-move/e2e-tests/src/executor.rs @@ -640,6 +640,11 @@ impl FakeExecutor { }, onchain: onchain_config, }; + + // Do not use shared module caches in tests. + let module_cache_manager = ModuleCacheManager::new(); + module_cache_manager.mark_ready(None, None); + BlockAptosVM::execute_block_on_thread_pool::< _, NoOpTransactionCommitHook, @@ -647,8 +652,7 @@ impl FakeExecutor { self.executor_thread_pool.clone(), txn_block, &state_view, - // Do not use shared module caches in tests. - &ModuleCacheManager::new(), + &module_cache_manager, config, None, ) diff --git a/execution/executor/src/db_bootstrapper/mod.rs b/execution/executor/src/db_bootstrapper/mod.rs index e69f696d48f1e..d9dcd513fe82d 100644 --- a/execution/executor/src/db_bootstrapper/mod.rs +++ b/execution/executor/src/db_bootstrapper/mod.rs @@ -137,7 +137,7 @@ pub fn calculate_genesis( } let execution_output = DoGetExecutionOutput::by_transaction_execution::( - &V::new(), + &executor, vec![genesis_txn.clone().into()].into(), base_state_view, BlockExecutorConfigFromOnchain::new_no_block_limit(),