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

Add logging to catch scenario when processing of transactions is aborted due to New Head event #1220

Conversation

SatpalSandhu61
Copy link
Contributor

This PR is to allow detection of an issue that can occur on Istanbul/Clique. The issue occurs if the block gas is set sufficiently high that transactions fitting into a block take longer to process than the block period.
In this case, a New Head event is received during processing of pending transaction, which aborts the transaction processing loop.
As a result, the transactions remain stuck on txpool and are never included in a block.

Original issue ticket has now been lost due to archival of that repo. However, here is an extract from the Slack discussion:

"I've reproduced the issue and can confirm that the behaviour is as discussed on the call, i.e. if the pending transactions take less than the block gasLimit to process, but take greater than the blockTime to process, then they will be stuck in pending.
The reason this happens is that during processing of the transactions, a 'New Head' event occurs which aborts the processing of the transactions.
You can see the code for this in worker.go::commitTransactions() where the loop to process transactions will complete when any of the following occurs:

  • no more pending txns
  • block gasLimit is reached
  • 'new head' event occurs

Therefore you do need to ensure that the block gasLimit is not excessive in comparison to the block period."

@ricardolyn ricardolyn assigned ricardolyn and unassigned ricardolyn Jun 29, 2021
@ricardolyn ricardolyn self-requested a review June 29, 2021 07:51
@ricardolyn ricardolyn merged commit ce32f98 into Consensys:master Jun 29, 2021
@ricardolyn ricardolyn added this to the v21.4.X (Future Patch) milestone Jun 29, 2021
@SatpalSandhu61 SatpalSandhu61 deleted the add-logging-for-aborted-transactions branch August 9, 2021 13:00
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.

None yet

2 participants