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

txpool: Respect updates to block gas limit #9363

Commits on Feb 23, 2024

  1. 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.
    jyellick committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    4108182 View commit details
    Browse the repository at this point in the history