-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
txpool: Respect updates to block gas limit
There is a bug in the txpool which can manifest either as a race condition, or in more novel network configurations. When a transaction is classified as either having `NotTooMuchGas` or its complement, this classification will never change unless a change to the sender account triggers reevaluation of that transaction. If the block gas limit changes upwards, then any transactions previously not marked as `NotTooMuchGas` will remain ineligible for promotion. Similarly, if the block gas limit changes downwards, then any transactions previously marked as `NotTooMuchGas` may inappropriately remain as pending. Although block gas limits may be relatively static in practice, there is additionally a race condition which can cause this bug to manifest. When the tx pool is first constructed, the gas limit is implicitly set to 0. Until the first update arrives with the configured gas limit, all transactions received will be categorized as using too much gas, and will never recover. This change adds a check in the `OnNewBlock` path which checks if the gas limit has changed, and if so triggers the re-evaluation of the `NotTooMuchGas` status for all transactions. In the normal case of consistent gas limits, this code path is not executed.
- Loading branch information
Showing
3 changed files
with
105 additions
and
2 deletions.
There are no files selected for viewing
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
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
Submodule testdata
updated
from 428f21 to 06e276