-
Notifications
You must be signed in to change notification settings - Fork 195
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: force thorchain swapper to wait for outbound tx confirmations on-chain #6143
Conversation
Current dependencies on/for this PR: This stack of pull requests is managed by Graphite. |
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.
First pass, this looks good to me at a conceptual level pending runtime testing
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.
Runtime testing:
Swap to RUNE

- Confirmed this is still happy and completes pretty much instantly after inbound is seen since inner swaps to RUNE are effectively instant and do not trigger L1 outbounds
Swaps to EVM chain
isEvmCoinAsset
now properly returnstrue
for EVM chains 🎉

- outbound confirmations are properly detected

- trade properly goes to confirmed state after on-chain confirmation

Swaps to UTXOs
- Trade is properly detected as complete after on-chain confirmation

Swap to ATOM

Note, I wasn't able to get to a confirmed state after outbound signed and on-chain confirmation, but logic is the same here, the issue here is there's a transient issue with unchained:

* feat: hide virtual pools in Thorchain LP "Available Pools" view * feat: thorchain LP halted pool tag * fix: force thorchain swapper to wait for outbound tx confirmations on-chain (#6143) * fix: import --------- Co-authored-by: woody <125113430+woodenfurniture@users.noreply.github.com> Co-authored-by: Apotheosis <97164662+0xApotheosis@users.noreply.github.com>
Description
Prevents thor trades from being displayed as complete until the outbound tx is confirmated on-chain.
Pull Request Type
Issue (if applicable)
closes #6086
Risk
Low risk, trade confirmation is already somewhat broken in that it completes early.
Testing
Check that thorchain trades only show as completed in the UI when they are in fact complete, not "pending outbound". Specifically thorchain trades that have an outbound tx, e.g
RUNE -> something
, orBTC -> AVAX
. Notsomething -> RUNE
.NOTE: dont use viewblock to test this, use our app tx history
App can show as complete, while viewblock shows
Pending: Outbound
. This is because they index the blockchain slower than us:And sure enough after giving them a moment to catch up, it's confirmed there too

Note @shapeshift/operations - we can also use THORNode /tx/ endpoint to test that the outbound Tx has been signed
Engineering
Operations
Screenshots (if applicable)
Outbound tx hash first seen, 0 confirmations. :

Trade continues to wait, with buy tx hash rendered and clickable. After some time, a confirmation is seen:

Trade is now shown as complete, in app and in viewblock for both txs:


