-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Avoid triggering empty block production #797
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rrent_tx_submission_produces_expected_blocks"
xgreenx
previously approved these changes
Nov 29, 2022
…break unit tests without gas limit(and downstream crates).
Voxelot
commented
Nov 29, 2022
Voxelot
commented
Nov 29, 2022
apart from some minor nits your changes look good to me @xgreenx, thanks for the assist. |
freesig
approved these changes
Nov 29, 2022
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.
Nice work. Yeh this makes sense and might also explain some things we saw in the block explorer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Partially fixes: #791
When a lot of txs are inserted into the txpool simultaneously, each tx creates a new "submitted" event which activates the PoA coordinator. The issue is that even if all the txs are included in the first block, each event was still triggering a block to be produced in instant mode (even though the pool was already empty). This PR updates the PoA Service to ignore txpool events if the pool is already empty, which also avoids triggering block production for other events like "SqueezedOut" or "Completed" which shouldn't impact block production signals.
Ideally, the PoA service just uses a notifier of newly submitted txs. That way we don't have to exhaust a full queue of tx status notifications which don't signal any new or meaningful data. It would also avoid extra processing of status updates like when a tx is removed from the txpool due to being included in a block (triggering an echo effect of block production).