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

Avoid triggering empty block production #797

Merged
merged 8 commits into from
Nov 29, 2022

Conversation

Voxelot
Copy link
Member

@Voxelot Voxelot commented Nov 29, 2022

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).

…rrent_tx_submission_produces_expected_blocks"
@Voxelot Voxelot requested a review from a team November 29, 2022 02:12
xgreenx
xgreenx previously approved these changes Nov 29, 2022
…break unit tests without gas limit(and downstream crates).
fuel-client/src/client.rs Outdated Show resolved Hide resolved
@Voxelot
Copy link
Member Author

Voxelot commented Nov 29, 2022

apart from some minor nits your changes look good to me @xgreenx, thanks for the assist.

@Voxelot Voxelot requested review from xgreenx and a team November 29, 2022 22:46
Copy link
Contributor

@freesig freesig left a 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

@Voxelot Voxelot enabled auto-merge (squash) November 29, 2022 23:13
@Voxelot Voxelot merged commit b50f0a9 into master Nov 29, 2022
@Voxelot Voxelot deleted the Voxelot/ignore-txpool-events-when-empty branch November 29, 2022 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Race conditions between read and write into database
3 participants