-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: it aint over till its over streaming swaps completion #7831
Conversation
packages/swapper/src/swappers/ThorchainSwapper/utils/getLatestThorTxStatusMessage.ts
Show resolved
Hide resolved
src/components/MultiHopTrade/components/MultiHopTradeConfirm/components/StreamingSwap.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Killer PR ser. Tested locally against develop, noticed one regression WRT "inbound Tx pending" state missing, which is more obvious with slow L1s (e.g UTXOs) but is happening both with RUNE and L1s ad inbound Txs.
Unable to test actual streaming swaps here, but logic looks sane to me and honours THOR docs, so happy to have ops test the streaming case (which has been confirmed working with two swaps/Jams in this PR) after this smolish regression is fixed 🙏🏽
- DOGE -> RUNE (no outbound Tx)
https://jam.dev/c/a002e844-8036-4cd0-9214-2882e72bb25e
While swap status detection was happy after inbound, noticed we're now missing the inbound pending state i.e this guy:
- RUNE -> DOGE (no L1 inbound, this is happening directly in THOR)
https://jam.dev/c/01261386-4242-4f62-9177-75b36b230c5d
Ditto, happy against develop except for inbound pending state missing
- Streaming swap: unable to test, will defer to @shapeshift/operations
src/components/MultiHopTrade/components/MultiHopTradeConfirm/components/StreamingSwap.tsx
Outdated
Show resolved
Hide resolved
e170f69
to
7c5d92c
Compare
src/components/MultiHopTrade/components/MultiHopTradeConfirm/hooks/useThorStreamingProgress.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retested locally, still noting the same issue re: "Inbound transaction pending" missed until L1 Tx is confirmed and observed.
However, all next stages perform as expected - to be retested and stamped with actual streaming swaps once fixed after getting the Foxcrypt'd seed back again
RUNE -> DOGE (non-streaming) 🚫
https://jam.dev/c/c8716f58-ba79-4764-9613-6a9f4525326e
- Still seeing "Inbound transaction pending" missing here, though not super visible with RUNE as it's pretty fast and goes to the first stage of akschual polling in a few seconds
ETH -> DOGE (non-streaming) 🚫
https://jam.dev/c/c22ea5d7-1627-4436-9e95-919fb4f0edfb
- Same issue as above
DOGE -> RUNE (fake streaming of sorts i.e low amount but streaming swap) 🚫
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested streaming swaps locally:
- RUNE -> FOX
https://jam.dev/c/c210100a-c6f3-49ad-b54e-10cf4b82bfeb
- FOX -> RUNE
https://jam.dev/c/2541cac8-c010-41cb-832d-d3efaa2ae030
Confirmed this guy does what it says on the box!
- The spotted issue re: "fake swaps" having indeterminate progress bar is a non-blocker and can be tackled in a follow-up if we want to, though definitely edge-case.
- Also non-blocking, as can be seen on the first jam at around 1:17, seeing some "Outbound transaction scheduled" but 1 out of 2 swaps which sounds off, and we should probably tackle as a follow-up i.e if outbound is scheduled, streaming is complete
Description
In #7371, and issue was reported where streaming swaps UI were progressed to "trade complete" when streaming is still in progress (see #7371 (comment)). This PR addresses that.
Root causes:
swap_finalised
to trigger completion state, which is not validSolutions:
stages
reported by the thornode API asPending
. This prevents convoluted logic returningConfirmed
state when tx is still being streamed.tx/{hash}
endpoint to determine completed status for all thorchain swapper txs. This works for both streaming and non-streaming txs.Notable changes:
Issue (if applicable)
closes #7371
Risk
Moderate risk. This solves an issue with UI displaying the status of tx execution and does not affect user funds or ability for users to complete trades.
THORChain swapper, both streaming and non-streaming swaps.
Testing
Engineering
Operations
Screenshots (if applicable)
With outbound tx (buy asset not RUNE)
https://jam.dev/c/b9660984-a567-46bc-ba6f-e9e037d07037
Without outbound tx (buy asset is RUNE)
https://jam.dev/c/99c865a0-df13-47dd-87fc-568de47323b7
Regular trade (no streaming)
https://jam.dev/c/f64594e2-0d96-44a6-8106-b9586831fa5b