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

Update abandon tx functionality to drop related attempts #15616

Conversation

amit-momin
Copy link
Contributor

@amit-momin amit-momin commented Dec 10, 2024

BCFR-1078

Context

The abandon transaction functionality marks unstarted, in_progress, and unconfirmed transactions as fatal_error and clears out any assigned nonces. However, attempts for in_progress or unconfirmed transactions remained in the db even though these attempts aren't needed for any other TXM process. This was causing a conflict with purged transactions that are marked as fatal with attempts that still need to be bumped and confirmed. The only difference is that purge transactions maintain their nonces

Changes

  • The abandon transaction functionality was updated to drop attempts when transactions are initially marked as fatal and the nonce is removed.
  • The query to find attempts that require a receipt fetch was updated to include a nonce null check.

@amit-momin amit-momin changed the title Updated abandon tx functionality to drop related attempts Update abandon tx functionality to drop related attempts Dec 10, 2024
@amit-momin amit-momin marked this pull request as ready for review December 10, 2024 20:57
@amit-momin amit-momin requested review from a team as code owners December 10, 2024 20:57
@amit-momin amit-momin requested a review from jmank88 December 10, 2024 20:58
Copy link
Collaborator

@dimriou dimriou Dec 11, 2024

Choose a reason for hiding this comment

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

I think a bigger underlying design problem exists with how we treat purgeable attempts. Here's what will happen if we have multiple in-flight transactions, including a purgeable attempt. Purgeable attempts are classified as fatal but still treated as in-flight. If we have two transactions with nonce 10 and 11 (the first one is unconfirmed, the second one is purgeable) if we hit Abandon then only the first one will be marked as fatal and the second one won't be impacted. When the TXM restarts, it will try to sync the nonce, look at the DB and see the nonce of the purgeable attempt. Assuming the tx with nonce 10 never made it on-chain this will effectively create a nonce-gap.

Copy link
Contributor

@huangzhen1997 huangzhen1997 left a comment

Choose a reason for hiding this comment

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

lgtm

@dimriou dimriou added this pull request to the merge queue Jan 10, 2025
Merged via the queue into develop with commit c57f910 Jan 10, 2025
172 checks passed
@dimriou dimriou deleted the BCFR-1078-Investigate-long-term-fix-for-fatal-transactions-on-the-Finalizer branch January 10, 2025 11:32
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