refactor(sequencer): refactor app #1793
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Large refactoring of the sequencer app.
Background
The sequencer app had a lot of duplicated code due to methods which did similar things slightly differently. In addition to this, naming of these different methods was confusing, with some using the outdated
begin_block
andend_block
ABCI methods, and others just being helper methods. This refactor is meant to make the sequencer app clearer in its design and eliminate duplicated code.Changes
AppAbci
trait for housing all of the app's methods which correspond to ABCI methods.app::begin_block
andapp::end_block
with their corresponding calling methods.begin_block
andend_block
fromComponent
, since they were largely unimplemented. Moved all implementations of these toprepare_state_for_execution
(formerlypre_execute_transactions
) andupdate_state_and_end_block
(formerlypost_execute_transasctions
).Component
toGenesis
to reflect its only remaining method,init_chain
.execute_transactions_prepare_proposal
andexecute_transactions_process_proposal
to utilize shared code, and renamed themprepare_proposal_tx_execution
andprocess_proposal_tx_execution
for clarity as to how they fit in with the ABCI methods.Testing
Fixed all tests which depended upon this code, now all passing.
Changelogs
Ensure all relevant changelog files are updated as necessary. See
keepachangelog for change
categories. Replace this text with e.g. "Changelogs updated." or "No updates
required." to acknowledge changelogs have been considered.
Related Issues
closes #1785