Skip to content

Commit

Permalink
[cleanup] Set execute_no_limit to always use Nones for block IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemitenkov committed Nov 12, 2024
1 parent eee36d5 commit 63040f3
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl DataCollection {
let val = debugger_state_view.get_state_value(TOTAL_SUPPLY_STATE_KEY.deref());
assert!(val.is_ok() && val.unwrap().is_some());
AptosVMBlockExecutor::new()
.execute_block_no_limit(&sig_verified_txns, debugger_state_view, None, None)
.execute_block_no_limit(&sig_verified_txns, debugger_state_view)
.map_err(|err| format_err!("Unexpected VM Error: {:?}", err))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,8 @@ impl<'a> AptosTestAdapter<'a> {
fn run_transaction(&mut self, txn: Transaction) -> Result<TransactionOutput> {
let txn_block = vec![txn];
let sig_verified_block = into_signature_verified_block(txn_block);
let mut outputs = AptosVMBlockExecutor::new().execute_block_no_limit(
&sig_verified_block,
&self.storage.clone(),
None,
None,
)?;
let mut outputs = AptosVMBlockExecutor::new()
.execute_block_no_limit(&sig_verified_block, &self.storage.clone())?;

assert_eq!(outputs.len(), 1);

Expand Down
3 changes: 1 addition & 2 deletions aptos-move/aptos-vm-profiling/src/bins/run_aptos_p2p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ fn main() -> Result<()> {
})
.collect();

let outputs =
AptosVMBlockExecutor::new().execute_block_no_limit(&txns, &state_store, None, None)?;
let outputs = AptosVMBlockExecutor::new().execute_block_no_limit(&txns, &state_store)?;
for i in 0..NUM_TXNS {
assert!(outputs[i as usize].status().status().unwrap().is_success());
}
Expand Down
7 changes: 3 additions & 4 deletions aptos-move/aptos-vm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,14 @@ pub trait VMBlockExecutor: Send + Sync {
&self,
transactions: &[SignatureVerifiedTransaction],
state_view: &(impl StateView + Sync),
parent_block: Option<&HashValue>,
current_block: Option<HashValue>,
) -> Result<Vec<TransactionOutput>, VMStatus> {
self.execute_block(
transactions,
state_view,
BlockExecutorConfigFromOnchain::new_no_block_limit(),
parent_block,
current_block,
// For all use cases, we run on an unknown state. Hence, defaulting to None here.
None,
None,
)
.map(BlockOutput::into_transaction_outputs_forced)
}
Expand Down
6 changes: 3 additions & 3 deletions aptos-move/aptos-vm/tests/sharded_block_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ mod test_utils {
.map(|t| t.into_txn())
.collect();
let unsharded_txn_output = AptosVMBlockExecutor::new()
.execute_block_no_limit(&ordered_txns, executor.data_store(), None, None)
.execute_block_no_limit(&ordered_txns, executor.data_store())
.unwrap();
compare_txn_outputs(unsharded_txn_output, sharded_txn_output);
}
Expand Down Expand Up @@ -359,7 +359,7 @@ mod test_utils {
.unwrap();

let unsharded_txn_output = AptosVMBlockExecutor::new()
.execute_block_no_limit(&execution_ordered_txns, executor.data_store(), None, None)
.execute_block_no_limit(&execution_ordered_txns, executor.data_store())
.unwrap();
compare_txn_outputs(unsharded_txn_output, sharded_txn_output);
}
Expand Down Expand Up @@ -413,7 +413,7 @@ mod test_utils {
.unwrap();

let unsharded_txn_output = AptosVMBlockExecutor::new()
.execute_block_no_limit(&execution_ordered_txns, executor.data_store(), None, None)
.execute_block_no_limit(&execution_ordered_txns, executor.data_store())
.unwrap();
compare_txn_outputs(unsharded_txn_output, sharded_txn_output);
}
Expand Down
4 changes: 2 additions & 2 deletions execution/executor-service/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ pub fn test_sharded_block_executor_no_conflict<E: ExecutorClient<FakeDataStore>>
.map(|t| t.into_txn())
.collect();
let unsharded_txn_output = AptosVMBlockExecutor::new()
.execute_block_no_limit(&txns, executor.data_store(), None, None)
.execute_block_no_limit(&txns, executor.data_store())
.unwrap();
compare_txn_outputs(unsharded_txn_output, sharded_txn_output);
sharded_block_executor.shutdown();
Expand Down Expand Up @@ -193,7 +193,7 @@ pub fn sharded_block_executor_with_conflict<E: ExecutorClient<FakeDataStore>>(
.unwrap();

let unsharded_txn_output = AptosVMBlockExecutor::new()
.execute_block_no_limit(&execution_ordered_txns, executor.data_store(), None, None)
.execute_block_no_limit(&execution_ordered_txns, executor.data_store())
.unwrap();
compare_txn_outputs(unsharded_txn_output, sharded_txn_output);
sharded_block_executor.shutdown();
Expand Down
6 changes: 0 additions & 6 deletions execution/executor/src/tests/mock_vm/mock_vm_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ fn test_mock_vm_different_senders() {
.execute_block_no_limit(
&into_signature_verified_block(txns.clone()),
&MockStateView::empty(),
None,
None,
)
.expect("MockVM should not fail to start");

Expand Down Expand Up @@ -71,8 +69,6 @@ fn test_mock_vm_same_sender() {
.execute_block_no_limit(
&into_signature_verified_block(txns),
&MockStateView::empty(),
None,
None,
)
.expect("MockVM should not fail to start");

Expand Down Expand Up @@ -111,8 +107,6 @@ fn test_mock_vm_payment() {
.execute_block_no_limit(
&into_signature_verified_block(txns),
&MockStateView::empty(),
None,
None,
)
.expect("MockVM should not fail to start");

Expand Down
2 changes: 0 additions & 2 deletions storage/db-tool/src/replay_on_archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,6 @@ impl Verifier {
&self
.arc_db
.state_view_at_version(start_version.checked_sub(1))?,
None,
None,
)?;

let mut failed_txns = Vec::new();
Expand Down

0 comments on commit 63040f3

Please sign in to comment.