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

fix(txpool): missing condition that tx gas limit equal to block gas l… #5858

Merged
merged 3 commits into from
Dec 26, 2023
Merged

Conversation

hsyodyssey
Copy link
Contributor

I found the following issue when I was doing a one block one transaction test (for benchmarking).

In short, the insert transaction function does not mark a transaction as TxState::NOT_TOO_MUCH_GAS when its gas limit is equal to the Block gas limit.

  • I tried on Geth to do a test and found that this kind of transaction seems to be legal since the constraint is only not to exceed the Block Gas Limit, test here
  • I found that the ensure_valid function already handles the case where the transaction's gas limit is greater than the block's gas limit. Therefore, passing through ensure_valid transactions could be all be marked as TxState::NOT_TOO_MUCH_GAS.
  • It also make the logic for the evaluation here seemed a bit redundant, so I made some modifications and added a new unit test.

@rkrasiuk rkrasiuk added the A-tx-pool Related to the transaction mempool label Dec 26, 2023
@rkrasiuk
Copy link
Member

@mattsse do we need this state flag at all?

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, this check was indeed redundant because already checked in ensure_valid.

perhaps we don't even need the state flag at all and we should consider removing that

@mattsse mattsse added this pull request to the merge queue Dec 26, 2023
Merged via the queue into paradigmxyz:main with commit 9b12f4f Dec 26, 2023
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tx-pool Related to the transaction mempool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants