Decomposition of the execute_best_transactions
method
#171
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
I've prepared a fairly significant structural revision: I turned
execute_best_transactions
into aBestTransactionsExecutor
struct, and instead of a scoped method, we now have access to all contextual data between method calls of this struct.💡 Motivation and Context
I'm pursuing several important goals:
Reduce the execution method size (split it into parts) to make it more readable
Turning the build process into an explicit finite state machine (FSM)
Additionally,
BestTransactionsExecutor
can be turned into anIterator
🔥Since the decomposition is based on method calls, it's:
This change will enable deeper decomposition of the build process and simplify runtime control, or conversely, the emission of useful data at any stage of the build, for example: we could create an iterator that yields events we can respond to - sending various data or metrics, interrupting the build, etc.
✅ I have completed the following steps:
make lint
make test