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

sequencer: refactor app #1785

Closed
Tracked by #1810
ethanoroshiba opened this issue Nov 4, 2024 · 0 comments · Fixed by #1819
Closed
Tracked by #1810

sequencer: refactor app #1785

ethanoroshiba opened this issue Nov 4, 2024 · 0 comments · Fixed by #1819
Assignees
Labels
refactor code refactoring or maintainence sequencer pertaining to the astria-sequencer crate

Comments

@ethanoroshiba
Copy link
Contributor

ethanoroshiba commented Nov 4, 2024

There is a lot of repeated code between execute_transactions_prepare_proposal(), execute_transactions_process_proposal(), and finalize_block(). We should refactor to use shared code where possible

┆Issue Number: ENG-995

@ethanoroshiba ethanoroshiba added sequencer pertaining to the astria-sequencer crate refactor code refactoring or maintainence labels Nov 4, 2024
@ethanoroshiba ethanoroshiba self-assigned this Nov 4, 2024
github-merge-queue bot pushed a commit that referenced this issue Dec 19, 2024
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor code refactoring or maintainence sequencer pertaining to the astria-sequencer crate
Projects
None yet
1 participant