Skip to content

[simplex] Fix phantom bid silent batch failure#1016

Merged
Wizdave97 merged 2 commits into
mainfrom
fix-phantom-bid-silent-batch-failure
Jul 2, 2026
Merged

[simplex] Fix phantom bid silent batch failure#1016
Wizdave97 merged 2 commits into
mainfrom
fix-phantom-bid-silent-batch-failure

Conversation

@Wizdave97

Copy link
Copy Markdown
Member

No description provided.

Wizdave97 added 2 commits July 2, 2026 10:02
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.
@Wizdave97
Wizdave97 merged commit b6405e2 into main Jul 2, 2026
2 checks passed
@Wizdave97
Wizdave97 deleted the fix-phantom-bid-silent-batch-failure branch July 2, 2026 10:40
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.

2 participants