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 feature to TXM to detect and purge stuck transactions #12881

Merged

Conversation

amit-momin
Copy link
Contributor

@amit-momin amit-momin commented Apr 18, 2024

  • Introduces a new StuckTxDetector component that can detect stuck transaction either with a chain specific method or through a heuristic
  • The Confirmer uses the new StuckTxDetector component to know which transactions to purge which includes the following:
    • Sending an empty transaction with higher gas price to replace the stuck transaction
    • Marks the transaction attempt in the TXM DB for purge
  • The Confirmer marks purged transactions as fatal error with an appropriate error message when it receives a receipt for a purge attempt

@amit-momin amit-momin changed the title Add feature to TXM to detect and purge stuck transactions due to ZK overflow [WIP] Add feature to TXM to detect and purge stuck transactions due to ZK overflow Apr 18, 2024
# Enabled enables or disables automatically purging transactions that have been idenitified as terminally stuck (will never be included on-chain). This feature is only expected to be used by ZK chains.
Enabled = false # Default
# DetectionApiUrl configures the base url of a custom endpoint used to identify terminally stuck transactions.
DetectionApiUrl = 'https://venus.scroll.io' # Example
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's not use an actual Scroll API for the example doc.

Suggested change
DetectionApiUrl = 'https://venus.scroll.io' # Example
DetectionApiUrl = 'https://example.api.io' # Example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call! Updated in the new commit

dimriou
dimriou previously approved these changes May 23, 2024
Copy link
Collaborator

@dimriou dimriou left a comment

Choose a reason for hiding this comment

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

I'm approving, although I've expressed my concerns about this implementation. I think it introduces certain complexity that will make our efforts to maintain and debug the node a bit harder. For future work, I'd suggest to explore a potentially simpler way to sync the nonce based on the on-chain mined nonce instead of tracking txs in the db.

@prashantkumar1982 prashantkumar1982 added this pull request to the merge queue May 27, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 27, 2024
@dimriou dimriou added this pull request to the merge queue May 27, 2024
Merged via the queue into develop with commit d675d86 May 27, 2024
107 checks passed
@dimriou dimriou deleted the BCI-2941-Implement-auto-purge-stuck-transaction-feature-in-TXM branch May 27, 2024 15:53
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.

4 participants