Skip to content

Commit

Permalink
chore(sequencer): refactor app (#1819)
Browse files Browse the repository at this point in the history
## Summary
Refactored `<prepare/process>_proposal_execute_transactions` methods.

## Background
These methods previously contained a lot of shared code. This is meant
to eliminate this code duplication and also make the steps that are
happening in the proposals clearer and easier to understand.

## Changes
- Renamed `prepare_proposal_execute_transactions` to
`prepare_proposal_tx_execution` to better represent that this is the
execution step of the larger `prepare_proposal` method.
- Renamed `process_proposal_execute_transactions` to
`process_proposal_tx_execution`.
- Refactored block size checks and tx execution to shared helper
functions, which take a new enum `Proposal` containing information
necessary for either `Prepare` or `Process`.

## Testing
Passing all tests.

## Changelogs
No updates required

## Related Issues
closes #1785
  • Loading branch information
ethanoroshiba authored Dec 19, 2024
1 parent 96ee2ed commit 4ec949c
Show file tree
Hide file tree
Showing 2 changed files with 304 additions and 187 deletions.
4 changes: 2 additions & 2 deletions crates/astria-sequencer/src/app/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl Fixture {
}

#[divan::bench(max_time = MAX_TIME)]
fn execute_transactions_prepare_proposal(bencher: divan::Bencher) {
fn prepare_proposal_tx_execution(bencher: divan::Bencher) {
let runtime = tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
Expand All @@ -105,7 +105,7 @@ fn execute_transactions_prepare_proposal(bencher: divan::Bencher) {
let (_tx_bytes, included_txs) = runtime.block_on(async {
fixture
.app
.execute_transactions_prepare_proposal(constraints)
.prepare_proposal_tx_execution(constraints)
.await
.unwrap()
});
Expand Down
Loading

0 comments on commit 4ec949c

Please sign in to comment.