-
Notifications
You must be signed in to change notification settings - Fork 38
feat(wip): continuous block building #303
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
Conversation
|
|
||
| /// The arena in which multiple [`FlashblockCandidate`] are competing for a specific flashblock interval batch. | ||
| /// It contains context of the building job, and shared precomputed elements that are required in each candidate. | ||
| struct BatchArena { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather keep it more lean, have best_flashblock variable, implement Ord for FlashblockPayload
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or custom function for comparison
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see but best_flashblock will have multiple fields (new_payload, fb_payload)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| ) -> eyre::Result<FlashblockCandidate> { | ||
| // Collect candidate best txs without updates | ||
| // This is not using best_txn to be able to bound number of txs to execute and collect them, so we need to remove commited txs | ||
| let candidate_best_txs: Vec<Arc<ValidPoolTransaction<Pool::Transaction>>> = self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use BestTransactionIterator wrapper we use in current code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't directly used it to be able to first collect all best transactions in a vec, so the iterator is consumed at once and not updated anymore. It allows to allocate correctly execution info size and then only update main BestTransactionIterator best_txns after.
I could potentially modify a bit BestTransactionIterator to make it works similarly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| }; | ||
|
|
||
| // build block | ||
| let build_result = build_block( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's interesting piece, ideally i don't want to seal block until we spent enough time builder flashblocks
So we should somehow determine how good flashblocks is without this, i suggest using cumulative_gas for flashblocks, or something like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or i would be coinbase profit + gas used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But as the same time we don't want to build it too late so that when interval is reached we can send best as soon as possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used execution info after executing txns and only build block if the cumulative gas is greater than previous best.
Co-authored-by: Solar Mithril <[email protected]>
Co-authored-by: Solar Mithril <[email protected]>
338886f to
8b3ac6a
Compare
8b3ac6a to
c0371dc
Compare
|
To close in favor of #311 |
π Summary
π‘ Motivation and Context
β I have completed the following steps:
make lintmake test