Skip to content

Commit e6123ac

Browse files
[block-executor] Remove unused executable type
1 parent 81a2f42 commit e6123ac

File tree

17 files changed

+110
-844
lines changed

17 files changed

+110
-844
lines changed

Cargo.lock

-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ members = [
177177
"storage/backup/backup-cli",
178178
"storage/backup/backup-service",
179179
"storage/db-tool",
180-
"storage/executable-store",
181180
"storage/indexer",
182181
"storage/indexer_schemas",
183182
"storage/jellyfish-merkle",
@@ -330,7 +329,6 @@ aptos-dkg = { path = "crates/aptos-dkg" }
330329
aptos-dkg-runtime = { path = "dkg" }
331330
aptos-drop-helper = { path = "crates/aptos-drop-helper" }
332331
aptos-event-notifications = { path = "state-sync/inter-component/event-notifications" }
333-
aptos-executable-store = { path = "storage/executable-store" }
334332
aptos-executor = { path = "execution/executor" }
335333
aptos-block-partitioner = { path = "execution/block-partitioner" }
336334
aptos-enum-conversion-derive = { path = "crates/aptos-enum-conversion-derive" }

aptos-move/aptos-vm/src/block_executor/mod.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use aptos_types::{
2424
},
2525
contract_event::ContractEvent,
2626
error::PanicError,
27-
executable::ExecutableTestType,
2827
fee_statement::FeeStatement,
2928
state_store::{state_key::StateKey, state_value::StateValueMetadata, StateView, StateViewId},
3029
transaction::{
@@ -438,12 +437,11 @@ impl<
438437
transaction_slice_metadata,
439438
)?;
440439

441-
let executor =
442-
BlockExecutor::<SignatureVerifiedTransaction, E, S, L, ExecutableTestType, TP>::new(
443-
config,
444-
executor_thread_pool,
445-
transaction_commit_listener,
446-
);
440+
let executor = BlockExecutor::<SignatureVerifiedTransaction, E, S, L, TP>::new(
441+
config,
442+
executor_thread_pool,
443+
transaction_commit_listener,
444+
);
447445

448446
let ret = executor.execute_block(
449447
signature_verified_block,

aptos-move/block-executor/src/captured_reads.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,6 @@ mod test {
879879
proptest_types::types::{raw_metadata, KeyType, MockEvent, ValueType},
880880
};
881881
use aptos_mvhashmap::{types::StorageVersion, MVHashMap};
882-
use aptos_types::executable::ExecutableTestType;
883882
use claims::{
884883
assert_err, assert_gt, assert_matches, assert_none, assert_ok, assert_ok_eq, assert_some_eq,
885884
};
@@ -1458,8 +1457,7 @@ mod test {
14581457
assert!(captured_reads.non_delayed_field_speculative_failure);
14591458
assert!(!captured_reads.delayed_field_speculative_failure);
14601459

1461-
let mvhashmap =
1462-
MVHashMap::<KeyType<u32>, u32, ValueType, ExecutableTestType, DelayedFieldID>::new();
1460+
let mvhashmap = MVHashMap::<KeyType<u32>, u32, ValueType, DelayedFieldID>::new();
14631461

14641462
captured_reads.non_delayed_field_speculative_failure = false;
14651463
captured_reads.delayed_field_speculative_failure = false;

aptos-move/block-executor/src/code_cache.rs

+7-13
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{
99
use ambassador::delegate_to_methods;
1010
use aptos_mvhashmap::types::TxnIndex;
1111
use aptos_types::{
12-
executable::{Executable, ModulePath},
12+
executable::ModulePath,
1313
state_store::{state_value::StateValueMetadata, TStateView},
1414
transaction::BlockExecutableTransaction as Transaction,
1515
vm::modules::AptosModuleExtension,
@@ -30,17 +30,15 @@ use move_vm_types::code::{
3030
};
3131
use std::sync::Arc;
3232

33-
impl<'a, T: Transaction, S: TStateView<Key = T::Key>, X: Executable> WithRuntimeEnvironment
34-
for LatestView<'a, T, S, X>
33+
impl<'a, T: Transaction, S: TStateView<Key = T::Key>> WithRuntimeEnvironment
34+
for LatestView<'a, T, S>
3535
{
3636
fn runtime_environment(&self) -> &RuntimeEnvironment {
3737
self.runtime_environment
3838
}
3939
}
4040

41-
impl<'a, T: Transaction, S: TStateView<Key = T::Key>, X: Executable> ModuleCodeBuilder
42-
for LatestView<'a, T, S, X>
43-
{
41+
impl<'a, T: Transaction, S: TStateView<Key = T::Key>> ModuleCodeBuilder for LatestView<'a, T, S> {
4442
type Deserialized = CompiledModule;
4543
type Extension = AptosModuleExtension;
4644
type Key = ModuleId;
@@ -64,9 +62,7 @@ impl<'a, T: Transaction, S: TStateView<Key = T::Key>, X: Executable> ModuleCodeB
6462
}
6563
}
6664

67-
impl<'a, T: Transaction, S: TStateView<Key = T::Key>, X: Executable> ModuleCache
68-
for LatestView<'a, T, S, X>
69-
{
65+
impl<'a, T: Transaction, S: TStateView<Key = T::Key>> ModuleCache for LatestView<'a, T, S> {
7066
type Deserialized = CompiledModule;
7167
type Extension = AptosModuleExtension;
7268
type Key = ModuleId;
@@ -187,9 +183,7 @@ impl<'a, T: Transaction, S: TStateView<Key = T::Key>, X: Executable> ModuleCache
187183
}
188184
}
189185

190-
impl<'a, T: Transaction, S: TStateView<Key = T::Key>, X: Executable> AptosModuleStorage
191-
for LatestView<'a, T, S, X>
192-
{
186+
impl<'a, T: Transaction, S: TStateView<Key = T::Key>> AptosModuleStorage for LatestView<'a, T, S> {
193187
fn fetch_state_value_metadata(
194188
&self,
195189
address: &AccountAddress,
@@ -206,7 +200,7 @@ impl<'a, T: Transaction, S: TStateView<Key = T::Key>, X: Executable> AptosModule
206200

207201
#[delegate_to_methods]
208202
#[delegate(ScriptCache, target_ref = "as_script_cache")]
209-
impl<'a, T: Transaction, S: TStateView<Key = T::Key>, X: Executable> LatestView<'a, T, S, X> {
203+
impl<'a, T: Transaction, S: TStateView<Key = T::Key>> LatestView<'a, T, S> {
210204
/// Returns the script cache.
211205
fn as_script_cache(
212206
&self,

aptos-move/block-executor/src/executor.rs

+16-18
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ use aptos_mvhashmap::{
3737
use aptos_types::{
3838
block_executor::config::BlockExecutorConfig,
3939
error::{code_invariant_error, expect_ok, PanicError, PanicOr},
40-
executable::Executable,
4140
on_chain_config::BlockGasLimitType,
4241
state_store::{state_value::StateValue, TStateView},
4342
transaction::{
@@ -72,22 +71,21 @@ use std::{
7271
},
7372
};
7473

75-
pub struct BlockExecutor<T, E, S, L, X, TP> {
74+
pub struct BlockExecutor<T, E, S, L, TP> {
7675
// Number of active concurrent tasks, corresponding to the maximum number of rayon
7776
// threads that may be concurrently participating in parallel execution.
7877
config: BlockExecutorConfig,
7978
executor_thread_pool: Arc<rayon::ThreadPool>,
8079
transaction_commit_hook: Option<L>,
81-
phantom: PhantomData<(T, E, S, L, X, TP)>,
80+
phantom: PhantomData<(T, E, S, L, TP)>,
8281
}
8382

84-
impl<T, E, S, L, X, TP> BlockExecutor<T, E, S, L, X, TP>
83+
impl<T, E, S, L, TP> BlockExecutor<T, E, S, L, TP>
8584
where
8685
T: Transaction,
8786
E: ExecutorTask<Txn = T>,
8887
S: TStateView<Key = T::Key> + Sync,
8988
L: TransactionCommitHook<Output = E::Output>,
90-
X: Executable + 'static,
9189
TP: TxnProvider<T> + Sync,
9290
{
9391
/// The caller needs to ensure that concurrency_level > 1 (0 is illegal and 1 should
@@ -115,7 +113,7 @@ where
115113
incarnation: Incarnation,
116114
signature_verified_block: &TP,
117115
last_input_output: &TxnLastInputOutput<T, E::Output, E::Error>,
118-
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, X, DelayedFieldID>,
116+
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, DelayedFieldID>,
119117
executor: &E,
120118
base_view: &S,
121119
global_module_cache: &GlobalModuleCache<
@@ -125,7 +123,7 @@ where
125123
AptosModuleExtension,
126124
>,
127125
runtime_environment: &RuntimeEnvironment,
128-
parallel_state: ParallelState<T, X>,
126+
parallel_state: ParallelState<T>,
129127
) -> Result<bool, PanicOr<ParallelBlockExecutionError>> {
130128
let _timer = TASK_EXECUTE_SECONDS.start_timer();
131129
let txn = signature_verified_block.get_txn(idx_to_execute);
@@ -406,7 +404,7 @@ where
406404
Module,
407405
AptosModuleExtension,
408406
>,
409-
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, X, DelayedFieldID>,
407+
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, DelayedFieldID>,
410408
scheduler: &Scheduler,
411409
) -> bool {
412410
let _timer = TASK_VALIDATE_SECONDS.start_timer();
@@ -436,7 +434,7 @@ where
436434
fn update_transaction_on_abort(
437435
txn_idx: TxnIndex,
438436
last_input_output: &TxnLastInputOutput<T, E::Output, E::Error>,
439-
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, X, DelayedFieldID>,
437+
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, DelayedFieldID>,
440438
runtime_environment: &RuntimeEnvironment,
441439
) {
442440
counters::SPECULATIVE_ABORT_COUNT.inc();
@@ -490,7 +488,7 @@ where
490488
valid: bool,
491489
validation_wave: Wave,
492490
last_input_output: &TxnLastInputOutput<T, E::Output, E::Error>,
493-
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, X, DelayedFieldID>,
491+
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, DelayedFieldID>,
494492
scheduler: &Scheduler,
495493
runtime_environment: &RuntimeEnvironment,
496494
) -> Result<SchedulerTask, PanicError> {
@@ -520,7 +518,7 @@ where
520518
/// returns false (indicating that transaction needs to be re-executed).
521519
fn validate_and_commit_delayed_fields(
522520
txn_idx: TxnIndex,
523-
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, X, DelayedFieldID>,
521+
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, DelayedFieldID>,
524522
last_input_output: &TxnLastInputOutput<T, E::Output, E::Error>,
525523
) -> Result<bool, PanicError> {
526524
let read_set = last_input_output
@@ -563,7 +561,7 @@ where
563561
&self,
564562
block_gas_limit_type: &BlockGasLimitType,
565563
scheduler: &Scheduler,
566-
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, X, DelayedFieldID>,
564+
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, DelayedFieldID>,
567565
scheduler_task: &mut SchedulerTask,
568566
last_input_output: &TxnLastInputOutput<T, E::Output, E::Error>,
569567
shared_commit_state: &ExplicitSyncWrapper<BlockGasLimitProcessor<T>>,
@@ -766,7 +764,7 @@ where
766764
Module,
767765
AptosModuleExtension,
768766
>,
769-
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, X, DelayedFieldID>,
767+
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, DelayedFieldID>,
770768
scheduler: &Scheduler,
771769
runtime_environment: &RuntimeEnvironment,
772770
) -> Result<(), PanicError> {
@@ -788,7 +786,7 @@ where
788786
fn materialize_aggregator_v1_delta_writes(
789787
txn_idx: TxnIndex,
790788
last_input_output: &TxnLastInputOutput<T, E::Output, E::Error>,
791-
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, X, DelayedFieldID>,
789+
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, DelayedFieldID>,
792790
base_view: &S,
793791
) -> Vec<(T::Key, WriteOp)> {
794792
// Materialize all the aggregator v1 deltas.
@@ -840,7 +838,7 @@ where
840838
fn materialize_txn_commit(
841839
&self,
842840
txn_idx: TxnIndex,
843-
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, X, DelayedFieldID>,
841+
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, DelayedFieldID>,
844842
scheduler: &Scheduler,
845843
start_shared_counter: u32,
846844
shared_counter: &AtomicU32,
@@ -855,7 +853,7 @@ where
855853
runtime_environment: &RuntimeEnvironment,
856854
final_results: &ExplicitSyncWrapper<Vec<E::Output>>,
857855
) -> Result<(), PanicError> {
858-
let parallel_state = ParallelState::<T, X>::new(
856+
let parallel_state = ParallelState::<T>::new(
859857
versioned_cache,
860858
scheduler,
861859
start_shared_counter,
@@ -953,7 +951,7 @@ where
953951
environment: &AptosEnvironment,
954952
block: &TP,
955953
last_input_output: &TxnLastInputOutput<T, E::Output, E::Error>,
956-
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, X, DelayedFieldID>,
954+
versioned_cache: &MVHashMap<T::Key, T::Tag, T::Value, DelayedFieldID>,
957955
scheduler: &Scheduler,
958956
// TODO: should not need to pass base view.
959957
base_view: &S,
@@ -1386,7 +1384,7 @@ where
13861384

13871385
for idx in 0..num_txns {
13881386
let txn = signature_verified_block.get_txn(idx as TxnIndex);
1389-
let latest_view = LatestView::<T, S, X>::new(
1387+
let latest_view = LatestView::<T, S>::new(
13901388
base_view,
13911389
module_cache_manager_guard.module_cache(),
13921390
runtime_environment,

aptos-move/block-executor/src/executor_utilities.rs

+8-22
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use aptos_mvhashmap::types::ValueWithLayout;
77
use aptos_types::{
88
contract_event::TransactionEvent,
99
error::{code_invariant_error, PanicError},
10-
executable::Executable,
1110
state_store::TStateView,
1211
transaction::BlockExecutableTransaction as Transaction,
1312
write_set::TransactionWrite,
@@ -199,15 +198,14 @@ pub(crate) fn gen_id_start_value(sequential: bool) -> u32 {
199198
pub(crate) fn map_id_to_values_in_group_writes<
200199
T: Transaction,
201200
S: TStateView<Key = T::Key> + Sync,
202-
X: Executable + 'static,
203201
>(
204202
finalized_groups: Vec<(
205203
T::Key,
206204
T::Value,
207205
Vec<(T::Tag, ValueWithLayout<T::Value>)>,
208206
ResourceGroupSize,
209207
)>,
210-
latest_view: &LatestView<T, S, X>,
208+
latest_view: &LatestView<T, S>,
211209
) -> Result<
212210
Vec<(
213211
T::Key,
@@ -242,13 +240,9 @@ pub(crate) fn map_id_to_values_in_group_writes<
242240

243241
// For each delayed field in resource write set, replace the identifiers with values
244242
// (ignoring other writes). Currently also checks the keys are unique.
245-
pub(crate) fn map_id_to_values_in_write_set<
246-
T: Transaction,
247-
S: TStateView<Key = T::Key> + Sync,
248-
X: Executable + 'static,
249-
>(
243+
pub(crate) fn map_id_to_values_in_write_set<T: Transaction, S: TStateView<Key = T::Key> + Sync>(
250244
resource_write_set: Vec<(T::Key, Arc<T::Value>, Arc<MoveTypeLayout>)>,
251-
latest_view: &LatestView<T, S, X>,
245+
latest_view: &LatestView<T, S>,
252246
) -> Result<Vec<(T::Key, T::Value)>, PanicError> {
253247
resource_write_set
254248
.into_iter()
@@ -262,13 +256,9 @@ pub(crate) fn map_id_to_values_in_write_set<
262256
}
263257

264258
// For each delayed field in the event, replace delayed field identifier with value.
265-
pub(crate) fn map_id_to_values_events<
266-
T: Transaction,
267-
S: TStateView<Key = T::Key> + Sync,
268-
X: Executable + 'static,
269-
>(
259+
pub(crate) fn map_id_to_values_events<T: Transaction, S: TStateView<Key = T::Key> + Sync>(
270260
events: Box<dyn Iterator<Item = (T::Event, Option<MoveTypeLayout>)>>,
271-
latest_view: &LatestView<T, S, X>,
261+
latest_view: &LatestView<T, S>,
272262
) -> Result<Vec<T::Event>, PanicError> {
273263
events
274264
.map(|(event, layout)| {
@@ -291,18 +281,14 @@ pub(crate) fn map_id_to_values_events<
291281
Ok(event)
292282
}
293283
})
294-
.collect::<std::result::Result<Vec<_>, PanicError>>()
284+
.collect::<Result<Vec<_>, PanicError>>()
295285
}
296286

297287
// Parse the input `value` and replace delayed field identifiers with corresponding values
298-
fn replace_ids_with_values<
299-
T: Transaction,
300-
S: TStateView<Key = T::Key> + Sync,
301-
X: Executable + 'static,
302-
>(
288+
fn replace_ids_with_values<T: Transaction, S: TStateView<Key = T::Key> + Sync>(
303289
value: &Arc<T::Value>,
304290
layout: &MoveTypeLayout,
305-
latest_view: &LatestView<T, S, X>,
291+
latest_view: &LatestView<T, S>,
306292
) -> Result<T::Value, PanicError> {
307293
let mut value = (**value).clone();
308294

aptos-move/block-executor/src/proptest_types/bencher.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::{
1616
};
1717
use aptos_types::{
1818
block_executor::config::BlockExecutorConfig, contract_event::TransactionEvent,
19-
executable::ExecutableTestType, state_store::MockStateView,
19+
state_store::MockStateView,
2020
};
2121
use criterion::{BatchSize, Bencher as CBencher};
2222
use num_cpus;
@@ -136,7 +136,6 @@ where
136136
MockTask<KeyType<K>, E>,
137137
MockStateView<KeyType<K>>,
138138
NoOpTransactionCommitHook<MockOutput<KeyType<K>, E>, usize>,
139-
ExecutableTestType,
140139
DefaultTxnProvider<MockTransaction<KeyType<K>, E>>,
141140
>::new(config, executor_thread_pool, None)
142141
.execute_transactions_parallel(&self.txns_provider, &state_view, &mut guard);

0 commit comments

Comments
 (0)