Swap broadcast-failure message invites retry while the signed tx can still land (hung RPC) — double-execution risk inside the deadline window #359

Closed
opened 2026-06-11 03:46:52 +00:00 by Brouie · 19 comments
Brouie commented 2026-06-11 03:46:52 +00:00 (Migrated from gitlab.com)

Found during #337 ERR-00-03 (broadcast timeout) — build 3169af0, Cosmostation, EMBER/CORAL pair.

Repro (RPC hang, not refusal — the common mainnet failure mode):

  • Prepared a 1 EMBER -> CORAL swap, clicked Swap, froze the chain container (sockets hang, not refuse) before approving in the wallet, then approved.
  • Dapp showed "Could not broadcast the transaction. Check your connection and try again." and returned to ready state.
  • Chain unfrozen ~2 min later: the queued broadcast flushed and the ORIGINAL tx executed clean — 36324C8CF5C65FF9C9CC33A4ABF4B647B3286DF1A5E43823AF1A0A187AB06EBE, code 0, height 1031478, the exact 1,000,000 uEMBER swap.

So the failure copy is wrong about the state and actively invites a duplicate: after signing, the tx exists; "try again" within the deadline window = double-execution. The msg-level deadline does bound the window (this tx landed inside it), but it's minutes wide — plenty of time to retry.

Suggested handling for broadcast failure AFTER signing:

  • The client can compute the tx hash from the signed bytes. Surface "broadcast status unknown — the transaction may still confirm", poll LCD /txs/{hash} through the deadline window before re-enabling submit, then resolve to success or definitively-not-found (only then offer retry).
  • Keep the current copy for PRE-sign connection failures — those are safe to retry.

The messaging/recovery half of ERR-00-03 otherwise behaves (honest banners, usable UI, no infinite pending) — the hazard is specifically the retry invitation plus the false "could not broadcast" claim.

Found during #337 ERR-00-03 (broadcast timeout) — build 3169af0, Cosmostation, EMBER/CORAL pair. Repro (RPC hang, not refusal — the common mainnet failure mode): - Prepared a 1 EMBER -> CORAL swap, clicked Swap, froze the chain container (sockets hang, not refuse) before approving in the wallet, then approved. - Dapp showed "Could not broadcast the transaction. Check your connection and try again." and returned to ready state. - Chain unfrozen ~2 min later: the queued broadcast flushed and the ORIGINAL tx executed clean — 36324C8CF5C65FF9C9CC33A4ABF4B647B3286DF1A5E43823AF1A0A187AB06EBE, code 0, height 1031478, the exact 1,000,000 uEMBER swap. So the failure copy is wrong about the state and actively invites a duplicate: after signing, the tx exists; "try again" within the deadline window = double-execution. The msg-level deadline does bound the window (this tx landed inside it), but it's minutes wide — plenty of time to retry. Suggested handling for broadcast failure AFTER signing: - The client can compute the tx hash from the signed bytes. Surface "broadcast status unknown — the transaction may still confirm", poll LCD /txs/{hash} through the deadline window before re-enabling submit, then resolve to success or definitively-not-found (only then offer retry). - Keep the current copy for PRE-sign connection failures — those are safe to retry. The messaging/recovery half of ERR-00-03 otherwise behaves (honest banners, usable UI, no infinite pending) — the hazard is specifically the retry invitation plus the false "could not broadcast" claim.
Brouie commented 2026-06-11 04:58:09 +00:00 (Migrated from gitlab.com)

mentioned in issue #337

mentioned in issue #337
PlasticDigits commented 2026-06-11 15:33:33 +00:00 (Migrated from gitlab.com)

mentioned in commit cd178131ad

mentioned in commit cd178131adbb7309523287177500a068646e8730
PlasticDigits commented 2026-06-11 15:33:54 +00:00 (Migrated from gitlab.com)

mentioned in merge request !867

mentioned in merge request !867
ghost1 commented 2026-06-11 15:38:16 +00:00 (Migrated from gitlab.com)

mentioned in commit 839ab90a61

mentioned in commit 839ab90a612c162f5523cc1a40ff99f428cc8a53
PlasticDigits commented 2026-06-12 03:34:44 +00:00 (Migrated from gitlab.com)

mentioned in commit 748e36af7b

mentioned in commit 748e36af7b0d4d79c35ba77f49fe8159b3fbc082
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-06-12 03:34:44 +00:00
PlasticDigits commented 2026-06-12 04:21:18 +00:00 (Migrated from gitlab.com)

mentioned in issue #360

mentioned in issue #360
PlasticDigits commented 2026-06-12 04:46:02 +00:00 (Migrated from gitlab.com)

mentioned in issue #361

mentioned in issue #361
Brouie commented 2026-06-12 04:51:32 +00:00 (Migrated from gitlab.com)

mentioned in merge request !870

mentioned in merge request !870
PlasticDigits commented 2026-06-12 05:05:55 +00:00 (Migrated from gitlab.com)

mentioned in issue #368

mentioned in issue #368
PlasticDigits commented 2026-06-12 05:46:15 +00:00 (Migrated from gitlab.com)

mentioned in merge request !877

mentioned in merge request !877
PlasticDigits commented 2026-06-12 07:54:43 +00:00 (Migrated from gitlab.com)

mentioned in commit 080d0af46a

mentioned in commit 080d0af46a54dd0fa636d80547e9bdce06a63f51
ghost1 commented 2026-06-12 08:40:58 +00:00 (Migrated from gitlab.com)

mentioned in commit 1154cb6ff3

mentioned in commit 1154cb6ff3d5b22443f66524a3b7680ca6c31542
ghost1 commented 2026-06-12 08:46:37 +00:00 (Migrated from gitlab.com)

mentioned in merge request !874

mentioned in merge request !874
ghost1 commented 2026-06-12 08:49:19 +00:00 (Migrated from gitlab.com)

mentioned in commit 778813600a

mentioned in commit 778813600a9320a65a8ad4a5bce501e347685d2b
PlasticDigits commented 2026-06-12 11:16:53 +00:00 (Migrated from gitlab.com)

mentioned in commit 337f6becc2

mentioned in commit 337f6becc2afb9c8a1e94a2cdceb8b1bed1215f8
PlasticDigits commented 2026-07-25 04:33:55 +00:00 (Migrated from gitlab.com)

mentioned in merge request !1037

mentioned in merge request !1037
PlasticDigits commented 2026-07-25 04:34:11 +00:00 (Migrated from gitlab.com)

mentioned in merge request !1039

mentioned in merge request !1039
PlasticDigits commented 2026-08-18 23:53:09 +00:00 (Migrated from gitlab.com)

mentioned in issue #567

mentioned in issue #567
PlasticDigits commented 2026-08-19 01:07:34 +00:00 (Migrated from gitlab.com)

mentioned in merge request !1091

mentioned in merge request !1091
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic#359
No description provided.