Skip to content

Commit

Permalink
Remove ParsedTransactionOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
msmouse committed Oct 26, 2024
1 parent 94cf775 commit 4767333
Show file tree
Hide file tree
Showing 17 changed files with 230 additions and 310 deletions.
1 change: 0 additions & 1 deletion 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 execution/executor-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ bcs = { workspace = true }
criterion = { workspace = true }
derive_more = { workspace = true }
itertools = { workspace = true }
once_cell = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }

Expand Down
60 changes: 30 additions & 30 deletions execution/executor-types/src/execution_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@

#![forbid(unsafe_code)]

use crate::{parsed_transaction_output::TransactionsWithParsedOutput, ParsedTransactionOutput};
use crate::transactions_with_output::TransactionsWithOutput;
use aptos_drop_helper::DropHelper;
use aptos_storage_interface::{cached_state_view::StateCache, state_delta::StateDelta};
use aptos_types::{
contract_event::ContractEvent,
epoch_state::EpochState,
transaction::{
block_epilogue::BlockEndInfo, ExecutionStatus, Transaction, TransactionOutput,
TransactionStatus, Version,
block_epilogue::BlockEndInfo, ExecutionStatus, Transaction, TransactionStatus, Version,
},
};
use derive_more::Deref;
Expand All @@ -29,9 +28,9 @@ impl ExecutionOutput {
is_block: bool,
first_version: Version,
statuses_for_input_txns: Vec<TransactionStatus>,
to_commit: TransactionsWithParsedOutput,
to_discard: TransactionsWithParsedOutput,
to_retry: TransactionsWithParsedOutput,
to_commit: TransactionsWithOutput,
to_discard: TransactionsWithOutput,
to_retry: TransactionsWithOutput,
state_cache: StateCache,
block_end_info: Option<BlockEndInfo>,
next_epoch_state: Option<EpochState>,
Expand Down Expand Up @@ -68,9 +67,9 @@ impl ExecutionOutput {
is_block: false,
first_version: state.next_version(),
statuses_for_input_txns: vec![],
to_commit: TransactionsWithParsedOutput::new_empty(),
to_discard: TransactionsWithParsedOutput::new_empty(),
to_retry: TransactionsWithParsedOutput::new_empty(),
to_commit: TransactionsWithOutput::new_empty(),
to_discard: TransactionsWithOutput::new_empty(),
to_retry: TransactionsWithOutput::new_empty(),
state_cache: StateCache::new_empty(state.current.clone()),
block_end_info: None,
next_epoch_state: None,
Expand All @@ -81,14 +80,13 @@ impl ExecutionOutput {
pub fn new_dummy_with_input_txns(txns: Vec<Transaction>) -> Self {
let num_txns = txns.len();
let success_status = TransactionStatus::Keep(ExecutionStatus::Success);
let success_output = ParsedTransactionOutput::from(TransactionOutput::new_empty_success());
Self::new_impl(Inner {
is_block: false,
first_version: 0,
statuses_for_input_txns: vec![success_status; num_txns],
to_commit: TransactionsWithParsedOutput::new(txns, vec![success_output; num_txns]),
to_discard: TransactionsWithParsedOutput::new_empty(),
to_retry: TransactionsWithParsedOutput::new_empty(),
to_commit: TransactionsWithOutput::new_dummy_success(txns),
to_discard: TransactionsWithOutput::new_empty(),
to_retry: TransactionsWithOutput::new_empty(),
state_cache: StateCache::new_dummy(),
block_end_info: None,
next_epoch_state: None,
Expand All @@ -105,9 +103,9 @@ impl ExecutionOutput {
is_block: false,
first_version: self.next_version(),
statuses_for_input_txns: vec![],
to_commit: TransactionsWithParsedOutput::new_empty(),
to_discard: TransactionsWithParsedOutput::new_empty(),
to_retry: TransactionsWithParsedOutput::new_empty(),
to_commit: TransactionsWithOutput::new_empty(),
to_discard: TransactionsWithOutput::new_empty(),
to_retry: TransactionsWithOutput::new_empty(),
state_cache: StateCache::new_dummy(),
block_end_info: None,
next_epoch_state: self.next_epoch_state.clone(),
Expand Down Expand Up @@ -143,9 +141,9 @@ pub struct Inner {
// but doesn't contain StateCheckpoint/BlockEpilogue, as those get added during execution
pub statuses_for_input_txns: Vec<TransactionStatus>,
// List of all transactions to be committed, including StateCheckpoint/BlockEpilogue if needed.
pub to_commit: TransactionsWithParsedOutput,
pub to_discard: TransactionsWithParsedOutput,
pub to_retry: TransactionsWithParsedOutput,
pub to_commit: TransactionsWithOutput,
pub to_discard: TransactionsWithOutput,
pub to_retry: TransactionsWithOutput,

/// Carries the frozen base state view, so all in-mem nodes involved won't drop before the
/// execution result is processed; as well as all the accounts touched during execution, together
Expand All @@ -170,29 +168,31 @@ impl Inner {
let aborts = self
.to_commit
.iter()
.flat_map(|(txn, output)| match output.status().status() {
Ok(execution_status) => {
if execution_status.is_success() {
None
} else {
Some(format!("{:?}: {:?}", txn, output.status()))
}
.flat_map(
|(txn, output, _is_reconfig)| match output.status().status() {
Ok(execution_status) => {
if execution_status.is_success() {
None
} else {
Some(format!("{:?}: {:?}", txn, output.status()))
}
},
Err(_) => None,
},
Err(_) => None,
})
)
.collect::<Vec<_>>();

let discards_3 = self
.to_discard
.iter()
.take(3)
.map(|(txn, output)| format!("{:?}: {:?}", txn, output.status()))
.map(|(txn, output, _is_reconfig)| format!("{:?}: {:?}", txn, output.status()))
.collect::<Vec<_>>();
let retries_3 = self
.to_retry
.iter()
.take(3)
.map(|(txn, output)| format!("{:?}: {:?}", txn, output.status()))
.map(|(txn, output, _is_reconfig)| format!("{:?}: {:?}", txn, output.status()))
.collect::<Vec<_>>();

if !aborts.is_empty() || !discards_3.is_empty() || !retries_3.is_empty() {
Expand Down
3 changes: 1 addition & 2 deletions execution/executor-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use aptos_types::{
};
pub use error::{ExecutorError, ExecutorResult};
pub use ledger_update_output::LedgerUpdateOutput;
pub use parsed_transaction_output::ParsedTransactionOutput;
use state_compute_result::StateComputeResult;
use std::{
collections::{BTreeSet, HashMap},
Expand All @@ -37,9 +36,9 @@ use std::{
mod error;
pub mod execution_output;
mod ledger_update_output;
pub mod parsed_transaction_output;
pub mod state_checkpoint_output;
pub mod state_compute_result;
pub mod transactions_with_output;

pub trait ChunkExecutorTrait: Send + Sync {
/// Verifies the transactions based on the provided proofs and ledger info. If the transactions
Expand Down
186 changes: 0 additions & 186 deletions execution/executor-types/src/parsed_transaction_output.rs

This file was deleted.

20 changes: 10 additions & 10 deletions execution/executor-types/src/state_checkpoint_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#![forbid(unsafe_code)]

use crate::parsed_transaction_output::TransactionsWithParsedOutput;
use crate::transactions_with_output::TransactionsWithOutput;
use aptos_crypto::HashValue;
use aptos_drop_helper::DropHelper;
use aptos_storage_interface::state_delta::StateDelta;
Expand All @@ -18,17 +18,17 @@ pub struct TransactionsByStatus {
// but doesn't contain StateCheckpoint/BlockEpilogue, as those get added during execution
statuses_for_input_txns: Vec<TransactionStatus>,
// List of all transactions to be committed, including StateCheckpoint/BlockEpilogue if needed.
to_commit: TransactionsWithParsedOutput,
to_discard: TransactionsWithParsedOutput,
to_retry: TransactionsWithParsedOutput,
to_commit: TransactionsWithOutput,
to_discard: TransactionsWithOutput,
to_retry: TransactionsWithOutput,
}

impl TransactionsByStatus {
pub fn new(
statuses_for_input_txns: Vec<TransactionStatus>,
to_commit: TransactionsWithParsedOutput,
to_discard: TransactionsWithParsedOutput,
to_retry: TransactionsWithParsedOutput,
to_commit: TransactionsWithOutput,
to_discard: TransactionsWithOutput,
to_retry: TransactionsWithOutput,
) -> Self {
Self {
statuses_for_input_txns,
Expand All @@ -46,9 +46,9 @@ impl TransactionsByStatus {
self,
) -> (
Vec<TransactionStatus>,
TransactionsWithParsedOutput,
TransactionsWithParsedOutput,
TransactionsWithParsedOutput,
TransactionsWithOutput,
TransactionsWithOutput,
TransactionsWithOutput,
) {
(
self.statuses_for_input_txns,
Expand Down
Loading

0 comments on commit 4767333

Please sign in to comment.