[simplex] Fix phantom bid silent batch failure#1016
Merged
Conversation
submitBidWithRetraction batched [retractBid, placeBid]. Bids are never pruned on-chain, so retracting a previous commitment whose bid was already gone (or never placed) fails with BidNotFound. utility.batch is non-atomic and stops at the first failing call, so the trailing placeBid was skipped and the new bid never landed. Worse, the next interval then retracted that never-placed commitment and failed the same way — a self-sustaining cascade. The failure was silent: a utility.batch extrinsic is itself Ok even when an inner call fails (the failure is a BatchInterrupted event, not a top-level dispatchError), and sendWithTimeout only inspected dispatchError — so every dropped bid was reported as "submitted". Two fixes: - Order the batch [placeBid, retractBid]. placeBid is the primary op and runs first, so the bid always lands; the deposit retraction is best-effort and a BatchInterrupted after it leaves the placed bid intact. This also self-heals the stuck cascade after one interval. - sendWithTimeout now detects BatchInterrupted: an interruption at index 0 (the primary call) is reported as failure with the decoded module error; a later index means the primary call succeeded and only a trailing best-effort call was skipped, still a success. Adds intentsCoprocessorBatch.test.ts covering batch ordering and the BatchInterrupted success/failure reporting for both index positions.
seunlanlege
approved these changes
Jul 2, 2026
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.
No description provided.