Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[execution-pool] Create iterator on TransactionShuffler #15613

Draft
wants to merge 8 commits into
base: brian/exec-window-exec-optimize-2
Choose a base branch
from

Conversation

hariria
Copy link
Contributor

@hariria hariria commented Dec 16, 2024

Description

Context

The TransactionShuffler trait defines a customizable strategy for shuffling transactions to minimize sequential execution and promote parallelism in transaction processing. Previously the shuffler type was hard-coded in the execution pipeline as a UseCaseAwareShuffler.

Objective

The goal of this PR was two-fold:

  1. In our execution pipeline, specifically the execute_stage function, create a TransactionShufflerIterator that works with any TransactionShuffler provided in the ExecuteBlockCommand. As mentioned above, this was previously hard-coded to use a UseCaseAwareTransactionShuffler. Part of this work included extending the TransactionShuffler trait to include two new functions:
    • signed_transaction_iterator
    • signature_verified_transaction_iterator
  2. Introduce a ShuffledTransactionIterator that works on SenderAwareTransaction, a new trait that mimics functionality found in UseCaseAwareTransaction.

Additional work was done to refactor the SenderAwareShuffler to more closely resemble the UseCaseAwareShuffler for consistency.

How Has This Been Tested?

  • [✅ Passing] All pre-existing SenderAwareShuffler unit tests.
  • [✅ Passing] Lints.
  • [❌ Failing] Tests that were already failing in brian/exec-window-exec-optimize-2, i.e.,
    • quorum_store::tests::batch_proof_queue_test::test_proof_pull_proofs_with_duplicates
    • round_manager::round_manager_test::commit_pipeline_test
cargo test --package aptos-consensus --lib transaction_shuffler::sender_aware::tests

Copy link

trunk-io bot commented Dec 16, 2024

⏱️ 59m total CI duration on this PR
Job Cumulative Duration Recent Runs
rust-move-tests 13m 🟩
rust-cargo-deny 9m 🟩🟩🟩🟩🟩
rust-move-tests 7m 🟥
rust-move-tests 7m 🟥
rust-move-tests 7m 🟥
rust-move-tests 5m
check-dynamic-deps 5m 🟩🟩🟩🟩🟩
general-lints 2m 🟩🟩🟩🟩🟩
semgrep/ci 2m 🟩🟩🟩🟩🟩
file_change_determinator 53s 🟩🟩🟩🟩🟩
permission-check 11s 🟩🟩🟩🟩🟩
permission-check 11s 🟩🟩🟩🟩🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

@hariria hariria force-pushed the brian/exec-window-exec-optimize-2 branch from 4419c21 to 20a72fe Compare December 18, 2024 21:28
Also decouples logic for iterator into a separate next_to_add function that is separate from shuffle function
Moves add_transaction out of the while loop in the shuffler and inside the next_to_add function. This is to make next_to_add function more like an iterator
@hariria hariria force-pushed the andrew/shuffle-iterator-2 branch from 4b8fb04 to 58b2dbc Compare December 20, 2024 02:33
@hariria hariria force-pushed the andrew/shuffle-iterator-2 branch from 8dbf167 to 8a1ca0c Compare December 20, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant