Skip to content

Fix for tx incorrectly discarded when there is a timeout during block creation#6563

Merged
fab-10 merged 6 commits intobesu-eth:mainfrom
fab-10:fix-incorrectly-dropped-tx-after-block-creation-timeout
Feb 16, 2024
Merged

Fix for tx incorrectly discarded when there is a timeout during block creation#6563
fab-10 merged 6 commits intobesu-eth:mainfrom
fab-10:fix-incorrectly-dropped-tx-after-block-creation-timeout

Conversation

@fab-10
Copy link
Copy Markdown
Contributor

@fab-10 fab-10 commented Feb 13, 2024

PR description

In case the selection of transactions during block creation goes in timeout, it is possible that some txs are incorrectly dropped from the txpool, since marked as invalid.
When the timeout occurs the block is created with all the txs selected until that moment, after that the world state is closed, while it is possible that a tx was still processing, in that case the processing tx validation could fail due fact that is no more possible to get the account from the closed world state, and the tx is wrongly tagged as invalid with UPFRONT_COST_EXCEED_BALANCE, that cause the tx to be dropped from the pool.

This PR, improves the handling of timeout and not selected txs, avoiding that them can be incorrectly dropped in case of timeout

Fixed Issue(s)

… creation

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 13, 2024

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.
  • I thought about the changelog and included a changelog update if required.
  • If my PR includes database changes (e.g. KeyValueSegmentIdentifier) I have thought about compatibility and performed forwards and backwards compatibility tests
  • I thought about running CI.
  • If I did not run CI, I ran as much locally as possible before pushing.

@fab-10 fab-10 changed the title Fix for tx incorrectly discarded when there is a timeout during block… Fix for tx incorrectly discarded when there is a timeout during block creation Feb 13, 2024
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
@fab-10 fab-10 self-assigned this Feb 13, 2024
@fab-10 fab-10 marked this pull request as ready for review February 13, 2024 14:27
Copy link
Copy Markdown
Contributor

@gauravahuja gauravahuja left a comment

Choose a reason for hiding this comment

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

lgtm, just the one comment.

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Copy link
Copy Markdown
Contributor

@macfarla macfarla left a comment

Choose a reason for hiding this comment

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

I think it makes sense. couple of comments

@fab-10 fab-10 enabled auto-merge (squash) February 16, 2024 09:03
@fab-10 fab-10 merged commit 86d3a6c into besu-eth:main Feb 16, 2024
@fab-10 fab-10 deleted the fix-incorrectly-dropped-tx-after-block-creation-timeout branch February 16, 2024 15:48
suraneti pushed a commit to suraneti/besu that referenced this pull request Feb 24, 2024
… creation (besu-eth#6563)


Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants