fix(satp-hermes): return missing promise in rollback strategies#4148
Open
atharrva01 wants to merge 1 commit intohyperledger-cacti:mainfrom
Open
fix(satp-hermes): return missing promise in rollback strategies#4148atharrva01 wants to merge 1 commit intohyperledger-cacti:mainfrom
atharrva01 wants to merge 1 commit intohyperledger-cacti:mainfrom
Conversation
Signed-off-by: atharrva01 <atharvaborade568@gmail.com>
Author
|
hi @AndreAugusto11 @RafaelAPB this PR fixes missing return before context.with() calls in all four SATP rollback strategies promises were being silently discarded, causing rollbacks to appear completed before any ledger operations actually ran. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found a critical async bug across all four SATP rollback strategy files , every
context.with()call was missing areturnstatement, silently discarding the promise and letting rollback methods resolve immediately without doing any actual work.The Problem
The
execute()method awaitshandleClientSideRollback(), but since the inner promise was dropped, it resolved instantly , with an emptyrollbackLogEntriesarray. The crash manager saw no failures and marked the rollback"COMPLETED"before a single ledger operation had run.Why It Matters
This broke the entire crash recovery path. A Stage 3 failure should mint assets back on the source chain and burn them on the destination, but neither happened. In practice, this could mean permanently lost or duplicated assets, with bridge errors silently swallowed as unhandled rejections.
The Fix
One word , return` , added at 7 call sites across 4 files. No logic changes, no refactoring. Rollbacks now complete fully before status is evaluated, failed rollbacks surface correctly, and cross-ledger atomicity during crash recovery actually holds.