Skip to content

Commit

Permalink
Merge branch 'main' into zi/new-type/refactoring-paranoid-mode-to-gen…
Browse files Browse the repository at this point in the history
…eric-rtt-checks
  • Loading branch information
ziaptos committed Nov 27, 2024
2 parents 573032a + 0029300 commit 341e79c
Show file tree
Hide file tree
Showing 223 changed files with 6,200 additions and 8,710 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/workflow-run-execution-performance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ on:
default: false
type: boolean
description: Whether to run or skip move-only e2e tests at the beginning.
USE_COIN_APT:
required: false
default: false
type: boolean
description: By default, FA APT is exclusively used. If set Coin APT is used instead.
SOURCE:
required: false
default: CI
Expand Down Expand Up @@ -74,13 +79,19 @@ on:
- CONTINUOUS
- MAINNET
- MAINNET_LARGE_DB
- EXECUTORS
type: choice
description: Which set of tests to run. MAINNET/MAINNET_LARGE_DB are for performance validation of mainnet nodes.
SKIP_MOVE_E2E:
required: false
default: false
type: boolean
description: Whether to skip move-only e2e tests at the beginning.
USE_COIN_APT:
required: false
default: false
type: boolean
description: By default, FA APT is exclusively used. If set Coin APT is used instead.
IGNORE_TARGET_DETERMINATION:
required: false
default: true
Expand Down Expand Up @@ -123,7 +134,7 @@ jobs:

- name: Run single node execution benchmark in performance build mode
shell: bash
run: TABULATE_INSTALL=lib-only pip install tabulate && FLOW="${{ inputs.FLOW }}" SOURCE="${{ inputs.SOURCE }}" RUNNER_NAME="${{ inputs.RUNNER_NAME }}" SKIP_MOVE_E2E="${{ inputs.SKIP_MOVE_E2E && '1' || '' }}" NUMBER_OF_EXECUTION_THREADS="${{ inputs.NUMBER_OF_EXECUTION_THREADS }}" testsuite/single_node_performance.py
run: TABULATE_INSTALL=lib-only pip install tabulate && FLOW="${{ inputs.FLOW }}" SOURCE="${{ inputs.SOURCE }}" RUNNER_NAME="${{ inputs.RUNNER_NAME }}" SKIP_MOVE_E2E="${{ inputs.SKIP_MOVE_E2E && '1' || '' }}" DISABLE_FA_APT="${{ inputs.USE_COIN_APT && '1' || '' }}" NUMBER_OF_EXECUTION_THREADS="${{ inputs.NUMBER_OF_EXECUTION_THREADS }}" testsuite/single_node_performance.py
if: ${{ (inputs.IGNORE_TARGET_DETERMINATION || needs.test-target-determinator.outputs.run_execution_performance_test == 'true') }}

- run: echo "Skipping single node execution performance! Unrelated changes detected."
Expand Down
40 changes: 13 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ members = [
"third_party/move/move-vm/transactional-tests",
"third_party/move/move-vm/types",
"third_party/move/testing-infra/module-generation",
"third_party/move/testing-infra/test-generation",
"third_party/move/testing-infra/transactional-test-runner",
"third_party/move/tools/move-bytecode-utils",
"third_party/move/tools/move-bytecode-viewer",
Expand Down
4 changes: 3 additions & 1 deletion api/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ use aptos_gas_schedule::{AptosGasParameters, FromOnChainGasSchedule};
use aptos_logger::{error, info, Schema};
use aptos_mempool::{MempoolClientRequest, MempoolClientSender, SubmissionStatus};
use aptos_storage_interface::{
state_view::{DbStateView, DbStateViewAtVersion, LatestDbStateCheckpointView},
state_store::state_view::db_state_view::{
DbStateView, DbStateViewAtVersion, LatestDbStateCheckpointView,
},
AptosDbError, DbReader, Order, MAX_REQUEST_LIMIT,
};
use aptos_types::{
Expand Down
4 changes: 3 additions & 1 deletion api/test-context/src/test_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ use aptos_sdk::{
transaction::SignedTransaction, AccountKey, LocalAccount,
},
};
use aptos_storage_interface::{state_view::DbStateView, DbReaderWriter};
use aptos_storage_interface::{
state_store::state_view::db_state_view::DbStateView, DbReaderWriter,
};
use aptos_temppath::TempPath;
use aptos_types::{
account_address::{create_multisig_account_address, AccountAddress},
Expand Down
1 change: 0 additions & 1 deletion aptos-move/aptos-aggregator/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ pub trait TAggregatorV1View {
PartialVMError::new(StatusCode::SPECULATIVE_EXECUTION_ABORT_ERROR)
.with_message("Cannot convert delta for deleted aggregator".to_string())
})?;

delta_op
.apply_to(base)
.map_err(|e| match &e {
Expand Down
4 changes: 2 additions & 2 deletions aptos-move/aptos-debugger/src/aptos_debugger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use aptos_validator_interface::{
AptosValidatorInterface, DBDebuggerInterface, DebuggerStateView, RestDebuggerInterface,
};
use aptos_vm::{
block_executor::{AptosTransactionOutput, BlockAptosVM},
block_executor::{AptosTransactionOutput, AptosVMBlockExecutorWrapper},
data_cache::AsMoveResolver,
AptosVM,
};
Expand Down Expand Up @@ -434,7 +434,7 @@ fn execute_block_no_limit(
state_view: &DebuggerStateView,
concurrency_level: usize,
) -> Result<Vec<TransactionOutput>, VMStatus> {
BlockAptosVM::execute_block::<
AptosVMBlockExecutorWrapper::execute_block::<
_,
NoOpTransactionCommitHook<AptosTransactionOutput, VMStatus>,
DefaultTxnProvider<SignatureVerifiedTransaction>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use aptos_language_e2e_tests::data_store::FakeDataStore;
use aptos_types::{
state_store::{
state_key::StateKey, state_storage_usage::StateStorageUsage, state_value::StateValue,
Result as StateViewResult, TStateView,
StateViewResult, TStateView,
},
transaction::Version,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ crate::gas_schedule::macros::define_gas_parameters!(
[
max_execution_gas_gov: InternalGas,
{ RELEASE_V1_13.. => "max_execution_gas.gov" },
4_000_000_000,
4_300_000_000,
],
[
max_io_gas: InternalGas,
Expand Down
20 changes: 11 additions & 9 deletions aptos-move/aptos-release-builder/src/simulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ use aptos_types::{
account_config::ChainIdResource,
on_chain_config::{ApprovedExecutionHashes, Features, GasScheduleV2, OnChainConfig},
state_store::{
in_memory_state_view::InMemoryStateView, state_key::StateKey,
state_storage_usage::StateStorageUsage, state_value::StateValue,
Result as StateStoreResult, StateView, TStateView,
state_key::StateKey, state_storage_usage::StateStorageUsage, state_value::StateValue,
StateView, StateViewResult as StateStoreResult, TStateView,
},
transaction::{ExecutionStatus, Script, TransactionArgument, TransactionStatus},
write_set::{TransactionWrite, WriteSet},
Expand Down Expand Up @@ -306,10 +305,6 @@ where
fn get_usage(&self) -> StateStoreResult<StateStorageUsage> {
Ok(StateStorageUsage::Untracked)
}

fn as_in_memory_state_view(&self) -> InMemoryStateView {
panic!("not supported")
}
}

/***************************************************************************************************
Expand Down Expand Up @@ -667,12 +662,19 @@ pub async fn simulate_multistep_proposal(
};
// TODO: ensure all scripts trigger reconfiguration.

println!(
"{}",
format!("Fee statement: {:#?}", vm_output.fee_statement())
.lines()
.map(|line| format!(" {}", line))
.collect::<Vec<_>>()
.join("\n")
);

let txn_output = vm_output
.try_materialize_into_transaction_output(&resolver)
.context("failed to materialize transaction output")?;

println!(" Gas used: {}", txn_output.gas_used());

let txn_status = txn_output.status();
match txn_status {
TransactionStatus::Keep(ExecutionStatus::Success) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use aptos_types::{
vm_status::VMStatus,
};
use aptos_vm::{
block_executor::{AptosTransactionOutput, BlockAptosVM},
block_executor::{AptosTransactionOutput, AptosVMBlockExecutorWrapper},
data_cache::AsMoveResolver,
sharded_block_executor::{
local_executor_shard::{LocalExecutorClient, LocalExecutorService},
Expand Down Expand Up @@ -217,7 +217,7 @@ where
) -> (Vec<TransactionOutput>, usize) {
let block_size = txn_provider.num_txns();
let timer = Instant::now();
let output = BlockAptosVM::execute_block::<
let output = AptosVMBlockExecutorWrapper::execute_block::<
_,
NoOpTransactionCommitHook<AptosTransactionOutput, VMStatus>,
DefaultTxnProvider<SignatureVerifiedTransaction>,
Expand Down Expand Up @@ -268,7 +268,7 @@ where
) -> (Vec<TransactionOutput>, usize) {
let block_size = txn_provider.num_txns();
let timer = Instant::now();
let output = BlockAptosVM::execute_block::<
let output = AptosVMBlockExecutorWrapper::execute_block::<
_,
NoOpTransactionCommitHook<AptosTransactionOutput, VMStatus>,
DefaultTxnProvider<SignatureVerifiedTransaction>,
Expand Down
2 changes: 1 addition & 1 deletion aptos-move/aptos-validator-interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use aptos_types::{
account_address::AccountAddress,
state_store::{
state_key::StateKey, state_storage_usage::StateStorageUsage, state_value::StateValue,
Result as StateViewResult, StateViewId, TStateView,
StateViewId, StateViewResult, TStateView,
},
transaction::{Transaction, TransactionInfo, Version},
};
Expand Down
6 changes: 3 additions & 3 deletions aptos-move/aptos-vm-environment/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@ impl Environment {
// If no chain ID is in storage, we assume we are in a testing environment.
let chain_id = fetch_config_and_update_hash::<ChainId>(&mut sha3_256, state_view)
.unwrap_or_else(ChainId::test);
let timestamp =
let timestamp_micros =
fetch_config_and_update_hash::<ConfigurationResource>(&mut sha3_256, state_view)
.map(|config| config.last_reconfiguration_time())
.map(|config| config.last_reconfiguration_time_micros())
.unwrap_or(0);

let mut timed_features_builder = TimedFeaturesBuilder::new(chain_id, timestamp);
let mut timed_features_builder = TimedFeaturesBuilder::new(chain_id, timestamp_micros);
if let Some(profile) = get_timed_feature_override() {
// We need to ensure the override is taken into account for the hash.
let profile_bytes = bcs::to_bytes(&profile)
Expand Down
10 changes: 5 additions & 5 deletions aptos-move/aptos-vm-types/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use aptos_aggregator::resolver::{TAggregatorV1View, TDelayedFieldView};
use aptos_types::{
serde_helper::bcs_utils::size_u32_as_uleb128,
state_store::{
errors::StateviewError,
errors::StateViewError,
state_key::StateKey,
state_storage_usage::StateStorageUsage,
state_value::{StateValue, StateValueMetadata},
Expand Down Expand Up @@ -181,9 +181,9 @@ pub trait StateStorageView {
fn id(&self) -> StateViewId;

/// Reads the state value from the DB. Used to enforce read-before-write for module writes.
fn read_state_value(&self, state_key: &Self::Key) -> Result<(), StateviewError>;
fn read_state_value(&self, state_key: &Self::Key) -> Result<(), StateViewError>;

fn get_usage(&self) -> Result<StateStorageUsage, StateviewError>;
fn get_usage(&self) -> Result<StateStorageUsage, StateViewError>;
}

/// A fine-grained view of the state during execution.
Expand Down Expand Up @@ -289,12 +289,12 @@ where
self.id()
}

fn read_state_value(&self, state_key: &Self::Key) -> Result<(), StateviewError> {
fn read_state_value(&self, state_key: &Self::Key) -> Result<(), StateViewError> {
self.get_state_value(state_key)?;
Ok(())
}

fn get_usage(&self) -> Result<StateStorageUsage, StateviewError> {
fn get_usage(&self) -> Result<StateStorageUsage, StateViewError> {
self.get_usage().map_err(Into::into)
}
}
Expand Down
Loading

0 comments on commit 341e79c

Please sign in to comment.