Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Don't remove a transaction from the txpool if it's maxFeePerGas < baseFeePerGas #2831

Open
jeffsmale90 opened this issue Apr 6, 2022 · 0 comments

Comments

@jeffsmale90
Copy link
Contributor

If a transaction's maxFeePerGas is too low (< baseFeePerGas for the pending block) after the transaction is removed from the "pending" queue, an error will be thrown within the vm:

During analysis of the behaviour in Geth, we discovered that the transaction will stay "pending" until the baseFeePerGas reduces sufficiently for the transaction to be included in a block.

We should update Ganache to ensure that a pending transaction with insufficient gas fee remains in the "pending" queue.

In order to reproduce this behaviour in Geth:

  • Create a "future nonce" transaction with relatively low maxFeePerGas (ie. the baseBlockFee of the pending block)
  • Create a large number of high-maxFeePerGas transactions to fill the first block (from a different address to the "future nonce" transaction above)
  • Start the miner in order to create the block 1 (this will drive up the baseBlockFee)
  • Stop the miner immediately
  • Create a "filler" transaction in order to make the "future nonce" transaction valid
  • Create a large number of high-maxFeePerGas transactions to fill up the block and ensure that the `baseBlockFee increases further
  • Start the miner in order to create the block 2 (which will contain the "filler" transaction, but not the "future nonce" transaction (as per Include future nonce transactions in the same block as the nonce gap filling transaction (instamine mode) #2526 (comment))
  • Wait for the "future nonce" transaction to eventually be mined

There should be a number of empty blocks created after block 2, before the "future nonce" transaction is included (ie the baseBlockFee reduces sufficiently)

@jeffsmale90 jeffsmale90 changed the title Don't reject a transaction from the txpool if it's maxFeePerGas < baseFeePerGas Don't remove a transaction from the txpool if it's maxFeePerGas < baseFeePerGas Apr 6, 2022
jeffsmale90 added a commit that referenced this issue Apr 6, 2022
jeffsmale90 added a commit that referenced this issue Apr 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant