Skip to content

[codex] fix relay swap status tracking#174

Merged
BitHighlander merged 2 commits into
developfrom
codex/fix-relay-swap-status
May 14, 2026
Merged

[codex] fix relay swap status tracking#174
BitHighlander merged 2 commits into
developfrom
codex/fix-relay-swap-status

Conversation

@BitHighlander
Copy link
Copy Markdown
Collaborator

Summary

Fix Relay swap tracking when Pioneer remains stuck on pending after Relay has already completed the request.

Root Cause

Vault registered Relay request IDs with Pioneer, but refreshSwap still treated Pioneer as the only status authority. For the reported swap, Relay returned status: success from /intents/status/v3, while Pioneer still returned pending with zero confirmations for the same tx hash.

Changes

  • Poll Relay's execution status endpoint directly for Relay-backed swaps once a request ID is known or backfilled.
  • Map Relay terminal statuses to Vault lifecycle states.
  • Prevent stale non-terminal Pioneer responses from downgrading a locally terminal swap.
  • Expose live tracking fields through /api/v2/swap/state so REST clients can observe completion instead of only phase: submitted.
  • Add focused unit coverage for Relay status mapping and same-chain Relay fills.

Verification

  • Confirmed live Relay API for request 0xa1224d54eab34fdd118ae2c4be8884a76881a48c59fc3a8aac789ad920f3a531 returns status: success and inbound tx 0x6076966206f5baafaabd444bef3a72e634f8c8f52d1772b6b6dc40afe2533bdf.
  • Confirmed Pioneer still returns status: pending for the same tx hash, reproducing the stuck state.
  • bun test tests/relay-status.test.ts tests/swap-revert.test.ts
  • git diff --check

Note: tsc --noEmit is currently blocked by existing project-wide type errors unrelated to this patch.

@BitHighlander BitHighlander marked this pull request as ready for review May 14, 2026 20:08
@BitHighlander BitHighlander requested a review from pastaghost as a code owner May 14, 2026 20:08
@BitHighlander BitHighlander merged commit 37ef545 into develop May 14, 2026
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.

1 participant