From b45470b4218fede9d7451f4894b8326483b7a3d2 Mon Sep 17 00:00:00 2001 From: Igor Date: Tue, 29 Oct 2024 09:54:25 -0700 Subject: [PATCH] adding another executor mode --- .../aptos-framework/doc/fungible_asset.md | 34 ++-- .../sources/fungible_asset.move | 34 ++-- execution/executor-benchmark/src/lib.rs | 8 +- execution/executor-benchmark/src/main.rs | 6 +- .../src/native_executor_task.rs | 11 +- .../src/native_loose_block_executor.rs | 163 +++++++++++++++++- .../src/native_transaction.rs | 1 + testsuite/single_node_performance.py | 85 ++++++--- 8 files changed, 271 insertions(+), 71 deletions(-) diff --git a/aptos-move/framework/aptos-framework/doc/fungible_asset.md b/aptos-move/framework/aptos-framework/doc/fungible_asset.md index 17ee3056667da..a7fd696d9d8fe 100644 --- a/aptos-move/framework/aptos-framework/doc/fungible_asset.md +++ b/aptos-move/framework/aptos-framework/doc/fungible_asset.md @@ -3468,23 +3468,25 @@ Decrease the supply of a fungible asset by burning. }; let metadata_address = object::object_address(metadata); - if (exists<ConcurrentSupply>(metadata_address)) { - let supply = borrow_global_mut<ConcurrentSupply>(metadata_address); + if (amount == 0) { + if (exists<ConcurrentSupply>(metadata_address)) { + let supply = borrow_global_mut<ConcurrentSupply>(metadata_address); - assert!( - aggregator_v2::try_sub(&mut supply.current, (amount as u128)), - error::out_of_range(ESUPPLY_UNDERFLOW) - ); - } else if (exists<Supply>(metadata_address)) { - assert!(exists<Supply>(metadata_address), error::not_found(ESUPPLY_NOT_FOUND)); - let supply = borrow_global_mut<Supply>(metadata_address); - assert!( - supply.current >= (amount as u128), - error::invalid_state(ESUPPLY_UNDERFLOW) - ); - supply.current = supply.current - (amount as u128); - } else { - assert!(false, error::not_found(ESUPPLY_NOT_FOUND)); + assert!( + aggregator_v2::try_sub(&mut supply.current, (amount as u128)), + error::out_of_range(ESUPPLY_UNDERFLOW) + ); + } else if (exists<Supply>(metadata_address)) { + assert!(exists<Supply>(metadata_address), error::not_found(ESUPPLY_NOT_FOUND)); + let supply = borrow_global_mut<Supply>(metadata_address); + assert!( + supply.current >= (amount as u128), + error::invalid_state(ESUPPLY_UNDERFLOW) + ); + supply.current = supply.current - (amount as u128); + } else { + assert!(false, error::not_found(ESUPPLY_NOT_FOUND)); + } } } diff --git a/aptos-move/framework/aptos-framework/sources/fungible_asset.move b/aptos-move/framework/aptos-framework/sources/fungible_asset.move index 50a77348c630c..7e3791c5cea91 100644 --- a/aptos-move/framework/aptos-framework/sources/fungible_asset.move +++ b/aptos-move/framework/aptos-framework/sources/fungible_asset.move @@ -1098,23 +1098,25 @@ module aptos_framework::fungible_asset { }; let metadata_address = object::object_address(metadata); - if (exists(metadata_address)) { - let supply = borrow_global_mut(metadata_address); + if (amount == 0) { + if (exists(metadata_address)) { + let supply = borrow_global_mut(metadata_address); - assert!( - aggregator_v2::try_sub(&mut supply.current, (amount as u128)), - error::out_of_range(ESUPPLY_UNDERFLOW) - ); - } else if (exists(metadata_address)) { - assert!(exists(metadata_address), error::not_found(ESUPPLY_NOT_FOUND)); - let supply = borrow_global_mut(metadata_address); - assert!( - supply.current >= (amount as u128), - error::invalid_state(ESUPPLY_UNDERFLOW) - ); - supply.current = supply.current - (amount as u128); - } else { - assert!(false, error::not_found(ESUPPLY_NOT_FOUND)); + assert!( + aggregator_v2::try_sub(&mut supply.current, (amount as u128)), + error::out_of_range(ESUPPLY_UNDERFLOW) + ); + } else if (exists(metadata_address)) { + assert!(exists(metadata_address), error::not_found(ESUPPLY_NOT_FOUND)); + let supply = borrow_global_mut(metadata_address); + assert!( + supply.current >= (amount as u128), + error::invalid_state(ESUPPLY_UNDERFLOW) + ); + supply.current = supply.current - (amount as u128); + } else { + assert!(false, error::not_found(ESUPPLY_NOT_FOUND)); + } } } diff --git a/execution/executor-benchmark/src/lib.rs b/execution/executor-benchmark/src/lib.rs index 8c86cec29ab61..756d078252cc8 100644 --- a/execution/executor-benchmark/src/lib.rs +++ b/execution/executor-benchmark/src/lib.rs @@ -751,7 +751,7 @@ fn log_total_supply(db_reader: &Arc) { mod tests { use std::fs; - use crate::{db_generator::bootstrap_with_genesis, init_db_and_executor, native_executor_task::NativeVMBlockExecutor, native_loose_block_executor::{NativeNoStorageLooseSpeculativeBlockExecutor, NativeLooseSpeculativeBlockExecutor}, native_transaction::NativeConfig, pipeline::PipelineConfig, transaction_executor::BENCHMARKS_BLOCK_EXECUTOR_ONCHAIN_CONFIG, transaction_generator::TransactionGenerator, BenchmarkWorkload}; + use crate::{db_generator::bootstrap_with_genesis, init_db_and_executor, native_executor_task::NativeVMBlockExecutor, native_loose_block_executor::{NativeLooseSpeculativeBlockExecutor, NativeNoStorageLooseSpeculativeBlockExecutor, NativeValueCacheLooseSpeculativeBlockExecutor}, native_transaction::NativeConfig, pipeline::PipelineConfig, transaction_executor::BENCHMARKS_BLOCK_EXECUTOR_ONCHAIN_CONFIG, transaction_generator::TransactionGenerator, BenchmarkWorkload}; use aptos_config::config::NO_OP_STORAGE_PRUNER_CONFIG; use aptos_crypto::HashValue; use aptos_executor::block_executor::{AptosVMBlockExecutor, TransactionBlockExecutor}; @@ -866,7 +866,7 @@ mod tests { features.enable(FeatureFlag::NEW_ACCOUNTS_DEFAULT_TO_FA_APT_STORE); features.enable(FeatureFlag::OPERATIONS_DEFAULT_TO_FA_APT_STORE); - crate::db_generator::create_db_with_accounts::( + crate::db_generator::create_db_with_accounts::( 100, /* num_accounts */ // TODO(Gas): double check if this is correct 100_000_000_000, /* init_account_balance */ @@ -924,8 +924,8 @@ mod tests { AptosVM::set_concurrency_level_once(1); AptosVM::set_processed_transactions_detailed_counters(); NativeConfig::set_concurrency_level_once(1); - test_generic_benchmark::( - Some(TransactionTypeArg::NoOp), + test_generic_benchmark::( + Some(TransactionTypeArg::AptFaTransfer), true, ); } diff --git a/execution/executor-benchmark/src/main.rs b/execution/executor-benchmark/src/main.rs index 3c22ff772dab5..872f670f80e22 100644 --- a/execution/executor-benchmark/src/main.rs +++ b/execution/executor-benchmark/src/main.rs @@ -14,7 +14,7 @@ use aptos_config::config::{ EpochSnapshotPrunerConfig, LedgerPrunerConfig, PrunerConfig, StateMerklePrunerConfig, }; use aptos_executor::block_executor::{AptosVMBlockExecutor, TransactionBlockExecutor}; -use aptos_executor_benchmark::{native_executor_task::NativeVMBlockExecutor, native_loose_block_executor::{NativeNoStorageLooseSpeculativeBlockExecutor, NativeLooseSpeculativeBlockExecutor}, native_transaction::NativeConfig, pipeline::PipelineConfig, BenchmarkWorkload}; +use aptos_executor_benchmark::{native_executor_task::NativeVMBlockExecutor, native_loose_block_executor::{NativeLooseSpeculativeBlockExecutor, NativeNoStorageLooseSpeculativeBlockExecutor, NativeValueCacheLooseSpeculativeBlockExecutor}, native_transaction::NativeConfig, pipeline::PipelineConfig, BenchmarkWorkload}; use aptos_executor_service::remote_executor_client; use aptos_experimental_ptx_executor::PtxBlockExecutor; #[cfg(target_os = "linux")] @@ -213,6 +213,7 @@ enum BlockExecutorTypeOpt { NativeVMWithBlockSTM, NativeLooseSpeculative, NativeNoStorageLooseSpeculative, + NativeValueCacheLooseSpeculative, PtxExecutor, } @@ -594,6 +595,9 @@ fn main() { BlockExecutorTypeOpt::NativeLooseSpeculative => { run::(opt); }, + BlockExecutorTypeOpt::NativeValueCacheLooseSpeculative => { + run::(opt); + } BlockExecutorTypeOpt::NativeNoStorageLooseSpeculative => { run::(opt); }, diff --git a/execution/executor-benchmark/src/native_executor_task.rs b/execution/executor-benchmark/src/native_executor_task.rs index f881f7770df84..7be2be238a159 100644 --- a/execution/executor-benchmark/src/native_executor_task.rs +++ b/execution/executor-benchmark/src/native_executor_task.rs @@ -207,8 +207,9 @@ impl NativeExecutorTask { Self::check_and_set_sequence_number(sender, sequence_number, view, &mut resource_write_set)?; Self::withdraw_fa_apt_from_signer(sender, amount, view, gas, &mut resource_write_set, &mut events)?; - Self::check_or_create_account(recipient, fail_on_account_existing, fail_on_account_missing, view, &mut resource_write_set)?; - Self::deposit_fa_apt(recipient, amount, view, gas, &mut resource_write_set, &mut events)?; + if !Self::deposit_fa_apt(recipient, amount, view, gas, &mut resource_write_set, &mut events)? { + Self::check_or_create_account(recipient, fail_on_account_existing, fail_on_account_missing, view, &mut resource_write_set)?; + } }, NativeTransaction::BatchTransfer { .. } => { todo!("to implement"); @@ -341,7 +342,7 @@ impl NativeExecutorTask { gas: u64, resource_write_set: &mut BTreeMap, events: &mut Vec<(ContractEvent, Option)>, - ) -> Result<(), ()> { + ) -> Result { let recipient_store_address = primary_apt_store(recipient_address); let recipient_fa_store_object_key = DbAccessUtil::new_state_key_object_resource_group(&recipient_store_address); let fungible_store_rg_tag = FungibleStoreResource::struct_tag(); @@ -356,7 +357,7 @@ impl NativeExecutorTask { store: recipient_store_address, amount: transfer_amount, }.create_event_v2(), None)); - Ok(()) + Ok(true) }, None => { let receipeint_fa_store = FungibleStoreResource::new(AccountAddress::TEN, transfer_amount, false); @@ -367,7 +368,7 @@ impl NativeExecutorTask { store: recipient_store_address, amount: transfer_amount, }.create_event_v2(), None)); - Ok(()) + Ok(false) }, } } diff --git a/execution/executor-benchmark/src/native_loose_block_executor.rs b/execution/executor-benchmark/src/native_loose_block_executor.rs index 3371dec69e683..df661072dc508 100644 --- a/execution/executor-benchmark/src/native_loose_block_executor.rs +++ b/execution/executor-benchmark/src/native_loose_block_executor.rs @@ -8,9 +8,10 @@ use crate::{ use anyhow::Result; use aptos_executor::{block_executor::TransactionBlockExecutor, metrics::BLOCK_EXECUTOR_INNER_EXECUTE_BLOCK}; use aptos_executor_types::execution_output::ExecutionOutput; +use aptos_logger::info; use aptos_storage_interface::cached_state_view::CachedStateView; use aptos_types::{ - account_address::AccountAddress, account_config::{deposit::DepositEvent, primary_apt_store, withdraw::WithdrawEvent, DepositFAEvent, FungibleStoreResource, WithdrawFAEvent}, block_executor::{config::BlockExecutorConfigFromOnchain, partitioner::ExecutableTransactions}, contract_event::ContractEvent, event::EventKey, fee_statement::FeeStatement, move_event_v2::MoveEventV2, on_chain_config::{FeatureFlag, Features}, state_store::state_key::StateKey, transaction::{ + account_address::AccountAddress, account_config::{account, deposit::DepositEvent, primary_apt_store, withdraw::WithdrawEvent, DepositFAEvent, FungibleStoreResource, WithdrawFAEvent}, block_executor::{config::BlockExecutorConfigFromOnchain, partitioner::ExecutableTransactions}, contract_event::ContractEvent, event::EventKey, fee_statement::FeeStatement, move_event_v2::MoveEventV2, on_chain_config::{FeatureFlag, Features}, state_store::state_key::StateKey, transaction::{ signature_verified_transaction::SignatureVerifiedTransaction, ExecutionStatus, Transaction, TransactionAuxiliaryData, TransactionOutput, TransactionStatus }, vm_status::AbortLocation, write_set::{WriteOp, WriteSet, WriteSetMut} }; @@ -602,14 +603,17 @@ impl TransactionBlockExecutor for NativeNoStorageLooseSpeculativeBlockExecutor native_transactions .into_par_iter() .map(|txn| { + let gas_units = 4; + let gas = gas_units * 100; match txn { NativeTransaction::Nop { sender, sequence_number } => { self.seq_nums.insert(sender, sequence_number); + *self.balances.entry(sender).or_insert(100_000_000_000_000_000) -= gas; }, NativeTransaction::FaTransfer { sender, sequence_number, recipient, amount } | NativeTransaction::Transfer { sender, sequence_number, recipient, amount, .. } => { self.seq_nums.insert(sender, sequence_number); - *self.balances.entry(sender).or_insert(100_000_000_000_000_000) -= amount; + *self.balances.entry(sender).or_insert(100_000_000_000_000_000) -= amount + gas; *self.balances.entry(recipient).or_insert(100_000_000_000_000_000) += amount; }, NativeTransaction::BatchTransfer { sender, sequence_number, recipients, amounts, .. } => { @@ -648,3 +652,158 @@ impl TransactionBlockExecutor for NativeNoStorageLooseSpeculativeBlockExecutor }) } } + +enum CachedResource { + Account(Account), + FungibleStore(FungibleStoreResource), +} + +pub struct NativeValueCacheLooseSpeculativeBlockExecutor { + cache: DashMap, +} + +impl TransactionBlockExecutor for NativeValueCacheLooseSpeculativeBlockExecutor { + fn new() -> Self { + Self { + cache: DashMap::new(), + } + } + + fn execute_transaction_block( + &self, + transactions: ExecutableTransactions, + state_view: CachedStateView, + _onchain_config: BlockExecutorConfigFromOnchain, + ) -> Result { + info!("Starting with execute_transaction_block"); + let transactions = match transactions { + ExecutableTransactions::Unsharded(txns) => txns, + _ => todo!("sharded execution not yet supported"), + }; + let native_transactions = NATIVE_EXECUTOR_POOL.install(|| { + transactions + .par_iter() + .map(NativeTransaction::parse) + .collect::>() + }); + + let timer = BLOCK_EXECUTOR_INNER_EXECUTE_BLOCK.start_timer(); + + let transaction_outputs = NATIVE_EXECUTOR_POOL.install(|| { + native_transactions + .into_par_iter() + .map(|txn| { + let gas_units = 4; + let gas = gas_units * 100; + + info!("Starting on {:?}", txn); + match txn { + NativeTransaction::Nop { sender, sequence_number } => { + self.update_sequence_number(sender, &state_view, sequence_number); + self.update_fa_balance(sender, &state_view, 0, gas, true); + }, + NativeTransaction::FaTransfer { sender, sequence_number, recipient, amount } => { + self.update_sequence_number(sender, &state_view, sequence_number); + self.update_fa_balance(sender, &state_view, 0, gas + amount, true); + self.update_fa_balance(recipient, &state_view, amount, 0, false); + }, + NativeTransaction::Transfer { sender, sequence_number, recipient, amount, fail_on_account_existing, fail_on_account_missing } => { + self.update_sequence_number(sender, &state_view, sequence_number); + self.update_fa_balance(sender, &state_view, 0, gas + amount, true); + + if !self.update_fa_balance(recipient, &state_view, amount, 0, fail_on_account_missing) { + self.check_or_create_account(recipient, &state_view, fail_on_account_existing, fail_on_account_missing); + } + }, + NativeTransaction::BatchTransfer { .. } => { + todo!("") + }, + } + info!("Ending with {:?}", txn); + + TransactionOutput::new( + Default::default(), + vec![], + 0, + TransactionStatus::Keep(ExecutionStatus::Success), + TransactionAuxiliaryData::default(), + ) + }) + .collect::>() + }); + + drop(timer); + info!("Ending with execute_transaction_block"); + + Ok(ExecutionOutput { + transactions: transactions.into_iter().map(|t| t.into_inner()).collect(), + transaction_outputs, + state_cache: state_view.into_state_cache(), + block_end_info: None, + }) + } +} + +impl NativeValueCacheLooseSpeculativeBlockExecutor { + fn update_sequence_number(&self, sender: AccountAddress, state_view: &CachedStateView, sequence_number: u64) { + let sender_account_key = DbAccessUtil::new_state_key_account(sender); + match self.cache.entry(sender_account_key.clone()).or_insert_with(|| { + CachedResource::Account(DbAccessUtil::get_account(&sender_account_key, state_view).unwrap().unwrap()) + }).value_mut() { + CachedResource::Account(account) => { + account.sequence_number = sequence_number + } + CachedResource::FungibleStore(_) => panic!("wrong type"), + }; + } + + fn check_or_create_account(&self, sender: AccountAddress, state_view: &CachedStateView, fail_on_existing: bool, fail_on_missing: bool) { + let sender_account_key = DbAccessUtil::new_state_key_account(sender); + let mut missing = false; + self.cache.entry(sender_account_key.clone()).or_insert_with(|| { + CachedResource::Account(match DbAccessUtil::get_account(&sender_account_key, state_view).unwrap() { + Some(account) => account, + None => { + missing = true; + assert!(!fail_on_missing); + Account { + authentication_key: sender.to_vec(), + ..Default::default() + } + }, + }) + }); + if fail_on_existing { + assert!(missing); + } + } + + fn update_fa_balance(&self, sender: AccountAddress, state_view: &CachedStateView, increment: u64, decrement: u64, fail_on_missing: bool) -> bool { + let sender_store_address = primary_apt_store(sender); + let fungible_store_rg_tag = FungibleStoreResource::struct_tag(); + let cache_key = StateKey::resource(&sender_store_address, &fungible_store_rg_tag).unwrap(); + + let mut exists = false; + match self.cache.entry(cache_key).or_insert_with(|| { + let sender_fa_store_object_key = DbAccessUtil::new_state_key_object_resource_group(&sender_store_address); + let rg_opt = DbAccessUtil::get_resource_group( &sender_fa_store_object_key, state_view).unwrap(); + CachedResource::FungibleStore(match rg_opt { + Some(mut rg) => { + exists = true; + bcs::from_bytes(&rg.remove(&fungible_store_rg_tag).unwrap()).unwrap() + }, + None => { + assert!(!fail_on_missing); + FungibleStoreResource::new(AccountAddress::TEN, 0, false) + }, + }) + }).value_mut() { + CachedResource::FungibleStore(fungible_store_resource) => { + fungible_store_resource.balance += increment; + fungible_store_resource.balance -= decrement; + }, + CachedResource::Account(_) => panic!("wrong type"), + }; + exists + } +} diff --git a/execution/executor-benchmark/src/native_transaction.rs b/execution/executor-benchmark/src/native_transaction.rs index cb46a3bb11c73..5b2cced5553c8 100644 --- a/execution/executor-benchmark/src/native_transaction.rs +++ b/execution/executor-benchmark/src/native_transaction.rs @@ -8,6 +8,7 @@ use once_cell::sync::{Lazy, OnceCell}; use rayon::{ThreadPool, ThreadPoolBuilder}; +#[derive(Debug)] pub enum NativeTransaction { Nop { sender: AccountAddress, sequence_number: u64, }, FaTransfer { sender: AccountAddress, sequence_number: u64, recipient: AccountAddress, amount: u64}, diff --git a/testsuite/single_node_performance.py b/testsuite/single_node_performance.py index 98f0b58f6a74b..5a4b1d39885c4 100755 --- a/testsuite/single_node_performance.py +++ b/testsuite/single_node_performance.py @@ -53,7 +53,7 @@ class Flow(Flag): DEFAULT_MAX_BLOCK_SIZE = "30000" MAX_BLOCK_SIZE = int(os.environ.get("MAX_BLOCK_SIZE", default=DEFAULT_MAX_BLOCK_SIZE)) -NUM_BLOCKS = int(os.environ.get("NUM_BLOCKS_PER_TEST", default=15)) +NUM_BLOCKS = int(os.environ.get("NUM_BLOCKS_PER_TEST", default=30)) NUM_BLOCKS_DETAILED = 10 NUM_ACCOUNTS = max( [ @@ -128,6 +128,7 @@ class RunGroupKeyExtra: sig_verify_num_threads_override: Optional[int] = field(default=None) execution_num_threads_override: Optional[int] = field(default=None) split_stages_override: bool = field(default=False) + single_block_dst_working_set: bool = field(default=False) @dataclass @@ -167,10 +168,12 @@ class RunGroupConfig: apt_fa_transfer_by_stages 1 VM 57 0.762 1.070 30000. apt_fa_transfer_by_stages 1 NativeVM 57 0.762 1.070 30000. apt_fa_transfer_by_stages 1 NativeSpeculative 57 0.762 1.070 30000. +apt_fa_transfer_by_stages 1 NativeValueCacheSpeculative 57 0.762 1.070 30000. apt_fa_transfer_by_stages 1 NativeNoStorageSpeculative 57 0.762 1.070 30000. apt_fa_transfer_sequential_by_stages 1 VM 57 0.762 1.070 10000. apt_fa_transfer_sequential_by_stages 1 NativeVM 57 0.762 1.070 10000. apt_fa_transfer_sequential_by_stages 1 NativeSpeculative 57 0.762 1.070 10000. +apt_fa_transfer_sequential_by_stages 1 NativeValueCacheSpeculative 57 0.762 1.070 10000. apt_fa_transfer_sequential_by_stages 1 NativeNoStorageSpeculative 57 0.762 1.070 10000. account-generation 1 VM 57 0.774 1.055 23332.3 account-resource32-b 1 VM 57 0.799 1.084 35822.6 @@ -217,57 +220,82 @@ class RunGroupConfig: DEFAULT_MODULE_WORKING_SET_SIZE = 100 TESTS = [ - # RunGroupConfig(key=RunGroupKey("no-op"), included_in=LAND_BLOCKING_AND_C), - # RunGroupConfig(key=RunGroupKey("no-op", module_working_set_size=1000), included_in=LAND_BLOCKING_AND_C), - RunGroupConfig(key=RunGroupKey("apt-fa-transfer"), included_in=LAND_BLOCKING_AND_C | Flow.REPRESENTATIVE | Flow.MAINNET), - # RunGroupConfig(key=RunGroupKey("apt-fa-transfer", executor_type="NativeVM"), included_in=LAND_BLOCKING_AND_C), - RunGroupConfig(key=RunGroupKey("apt_fa_transfer_by_stages"), key_extra=RunGroupKeyExtra( + + RunGroupConfig(key=RunGroupKey("apt_fa_transfer_sequential_by_stages"), key_extra=RunGroupKeyExtra( transaction_type_override="apt-fa-transfer", + sig_verify_num_threads_override=1, + execution_num_threads_override=1, split_stages_override=True, - sig_verify_num_threads_override=NUMBER_OF_EXECUTION_THREADS, + single_block_dst_working_set=True, ), included_in=LAND_BLOCKING_AND_C), - RunGroupConfig(key=RunGroupKey("apt_fa_transfer_by_stages", executor_type="NativeVM"), key_extra=RunGroupKeyExtra( + RunGroupConfig(key=RunGroupKey("apt_fa_transfer_sequential_by_stages", executor_type="NativeVM"), key_extra=RunGroupKeyExtra( transaction_type_override="apt-fa-transfer", + sig_verify_num_threads_override=1, + execution_num_threads_override=1, split_stages_override=True, - sig_verify_num_threads_override=NUMBER_OF_EXECUTION_THREADS, + single_block_dst_working_set=True, ), included_in=LAND_BLOCKING_AND_C), - RunGroupConfig(key=RunGroupKey("apt_fa_transfer_by_stages", executor_type="NativeSpeculative"), key_extra=RunGroupKeyExtra( + RunGroupConfig(key=RunGroupKey("apt_fa_transfer_sequential_by_stages", executor_type="NativeSpeculative"), key_extra=RunGroupKeyExtra( transaction_type_override="apt-fa-transfer", + sig_verify_num_threads_override=1, + execution_num_threads_override=1, split_stages_override=True, - sig_verify_num_threads_override=NUMBER_OF_EXECUTION_THREADS, + single_block_dst_working_set=True, ), included_in=LAND_BLOCKING_AND_C), - RunGroupConfig(key=RunGroupKey("apt_fa_transfer_by_stages", executor_type="NativeNoStorageSpeculative"), key_extra=RunGroupKeyExtra( + RunGroupConfig(key=RunGroupKey("apt_fa_transfer_sequential_by_stages", executor_type="NativeNoStorageSpeculative"), key_extra=RunGroupKeyExtra( transaction_type_override="apt-fa-transfer", + sig_verify_num_threads_override=1, + execution_num_threads_override=1, split_stages_override=True, - sig_verify_num_threads_override=NUMBER_OF_EXECUTION_THREADS, + single_block_dst_working_set=True, ), included_in=LAND_BLOCKING_AND_C), - - - RunGroupConfig(key=RunGroupKey("apt_fa_transfer_sequential_by_stages"), key_extra=RunGroupKeyExtra( + RunGroupConfig(key=RunGroupKey("apt_fa_transfer_sequential_by_stages", executor_type="NativeValueCacheSpeculative"), key_extra=RunGroupKeyExtra( transaction_type_override="apt-fa-transfer", sig_verify_num_threads_override=1, execution_num_threads_override=1, split_stages_override=True, + single_block_dst_working_set=True, ), included_in=LAND_BLOCKING_AND_C), - RunGroupConfig(key=RunGroupKey("apt_fa_transfer_sequential_by_stages", executor_type="NativeVM"), key_extra=RunGroupKeyExtra( + + + RunGroupConfig(key=RunGroupKey("apt_fa_transfer_by_stages"), key_extra=RunGroupKeyExtra( transaction_type_override="apt-fa-transfer", - sig_verify_num_threads_override=1, - execution_num_threads_override=1, split_stages_override=True, + single_block_dst_working_set=True, + sig_verify_num_threads_override=NUMBER_OF_EXECUTION_THREADS, ), included_in=LAND_BLOCKING_AND_C), - RunGroupConfig(key=RunGroupKey("apt_fa_transfer_sequential_by_stages", executor_type="NativeSpeculative"), key_extra=RunGroupKeyExtra( + RunGroupConfig(key=RunGroupKey("apt_fa_transfer_by_stages", executor_type="NativeVM"), key_extra=RunGroupKeyExtra( transaction_type_override="apt-fa-transfer", - sig_verify_num_threads_override=1, - execution_num_threads_override=1, split_stages_override=True, + single_block_dst_working_set=True, + sig_verify_num_threads_override=NUMBER_OF_EXECUTION_THREADS, ), included_in=LAND_BLOCKING_AND_C), - RunGroupConfig(key=RunGroupKey("apt_fa_transfer_sequential_by_stages", executor_type="NativeNoStorageSpeculative"), key_extra=RunGroupKeyExtra( + RunGroupConfig(key=RunGroupKey("apt_fa_transfer_by_stages", executor_type="NativeSpeculative"), key_extra=RunGroupKeyExtra( transaction_type_override="apt-fa-transfer", - sig_verify_num_threads_override=1, - execution_num_threads_override=1, split_stages_override=True, + single_block_dst_working_set=True, + sig_verify_num_threads_override=NUMBER_OF_EXECUTION_THREADS, ), included_in=LAND_BLOCKING_AND_C), + RunGroupConfig(key=RunGroupKey("apt_fa_transfer_by_stages", executor_type="NativeNoStorageSpeculative"), key_extra=RunGroupKeyExtra( + transaction_type_override="apt-fa-transfer", + split_stages_override=True, + single_block_dst_working_set=True, + sig_verify_num_threads_override=NUMBER_OF_EXECUTION_THREADS, + ), included_in=LAND_BLOCKING_AND_C), + RunGroupConfig(key=RunGroupKey("apt_fa_transfer_by_stages", executor_type="NativeValueCacheSpeculative"), key_extra=RunGroupKeyExtra( + transaction_type_override="apt-fa-transfer", + split_stages_override=True, + single_block_dst_working_set=True, + sig_verify_num_threads_override=NUMBER_OF_EXECUTION_THREADS, + ), included_in=LAND_BLOCKING_AND_C), + + + # RunGroupConfig(key=RunGroupKey("no-op"), included_in=LAND_BLOCKING_AND_C), + # RunGroupConfig(key=RunGroupKey("no-op", module_working_set_size=1000), included_in=LAND_BLOCKING_AND_C), + RunGroupConfig(key=RunGroupKey("apt-fa-transfer"), included_in=LAND_BLOCKING_AND_C | Flow.REPRESENTATIVE | Flow.MAINNET), + # RunGroupConfig(key=RunGroupKey("apt-fa-transfer", executor_type="NativeVM"), included_in=LAND_BLOCKING_AND_C), + # RunGroupConfig(key=RunGroupKey("account-generation"), included_in=LAND_BLOCKING_AND_C | Flow.REPRESENTATIVE | Flow.MAINNET), # RunGroupConfig(key=RunGroupKey("account-generation", executor_type="native"), included_in=Flow.CONTINUOUS), @@ -782,9 +810,12 @@ def print_table( pipeline_extra_args_str = " ".join(pipeline_extra_args) - ADDITIONAL_DST_POOL_ACCOUNTS = 2 * MAX_BLOCK_SIZE * NUM_BLOCKS + if test.key_extra.single_block_dst_working_set: + additional_dst_pool_accounts = MAX_BLOCK_SIZE + else: + additional_dst_pool_accounts = 2 * MAX_BLOCK_SIZE * NUM_BLOCKS - common_command_suffix = f"{executor_type_str} {pipeline_extra_args_str} --block-size {cur_block_size} {DB_CONFIG_FLAGS} {DB_PRUNER_FLAGS} run-executor {FEATURE_FLAGS} {workload_args_str} --module-working-set-size {test.key.module_working_set_size} --main-signer-accounts {MAIN_SIGNER_ACCOUNTS} --additional-dst-pool-accounts {ADDITIONAL_DST_POOL_ACCOUNTS} --data-dir {tmpdirname}/db --checkpoint-dir {tmpdirname}/cp" + common_command_suffix = f"{executor_type_str} {pipeline_extra_args_str} --block-size {cur_block_size} {DB_CONFIG_FLAGS} {DB_PRUNER_FLAGS} run-executor {FEATURE_FLAGS} {workload_args_str} --module-working-set-size {test.key.module_working_set_size} --main-signer-accounts {MAIN_SIGNER_ACCOUNTS} --additional-dst-pool-accounts {additional_dst_pool_accounts} --data-dir {tmpdirname}/db --checkpoint-dir {tmpdirname}/cp" number_of_threads_results = {}