Skip to content

negative gas wanted will cause overfilled blocks by gas #2989

@ValarDragon

Description

@ValarDragon

ABCI gas wanted is an int64, therefore the app can return negative gas wanteds. In the case of the SDK, this happens since we naively cast a uint64 to int64. In the mempool reap / postcheck, we will just allow this to decrement the gas wanted, and we will in essence propose / accept blocks with too much gas.

Potential Fixes:

  • Define this as desired behavior (this isn't unreasonable, negative gas wanteds could represent free-ing gas on chain. That would be changing gas from the definition we use, which is to measure computational time due to txs). Then we must make the SDK not naively cast the gas wanted field, since that will allow very overfilled blocks.
  • Make ABCI.GasWanted a uint64
  • Make the mempool postcheck ensure that gas wanted is positive

Metadata

Metadata

Assignees

No one assigned

    Labels

    C:mempoolComponent: MempoolT:securityType: Security (specify priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions