Skip to content
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

feat: improve thorchain Txs failure detection #5708

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

gomesalexandre
Copy link
Contributor

@gomesalexandre gomesalexandre commented Nov 28, 2023

Description

Relies on Midgard for failure and success detection in conjunction to our current /tx/status checks.

This allows us to more reliably detect success Txs when enforcing outbound checks by ensuring we have a succesful out Tx, as well as properly detect refunds, both succesful and failed.

Pull Request Type

  • 🐛 Bug fix (Non-breaking Change: Fixes an issue)
  • 🛠️ Chore (Non-breaking Change: Doc updates, pkg upgrades, typos, etc..)
  • 💅 New Feature (Breaking/Non-breaking Change)

Issue (if applicable)

closes #5702

Risk

  • THOR Tx status detection is still happy for Txs skipping outbound checks (e.g savers deposits or loan repayment if available for your collateral)
  • THOR Tx status detection is still happy for Txs enforcing outbound checks (e.g savers withdraws)

Testing

Engineering

  • ☝🏽
  • Remove the minimum checks in savers withdraw

if (isBelowWithdrawThreshold) {
const minLimitCryptoPrecision = bn(outboundFeeCryptoBaseUnit).div(
bn(10).pow(asset.precision),
)
const minLimit = `${minLimitCryptoPrecision} ${asset.symbol}`
return translate('trade.errors.amountTooSmall', {
minLimit,
})
}

  • Try to withdraw a very small amount of a small position e.g 1bps, or anything small enough to be lesser than fees
  • Ensure the withdraw is displayed as failed after we fetch the failed refund from Midgard

Operations

  • ☝🏽

Screenshots (if applicable)

  • Outbound checks enforced - succesful outbound Tx on savers EVM withdraw
Screenshot 2023-11-28 at 01 01 35
  • Outbound checks enforced - succesful outbound Tx on savers UTXO withdraw
image image
  • Outbound checks enforced - failed refund
Screenshot 2023-11-28 at 00 37 37
  • Outbound checks skipped - succesful deposit (note, as we skip outbound checks, we do not check for failures here and are only relying on swap_status.pending === false
image

Base automatically changed from feat_thor_outbound_detection to develop November 28, 2023 00:20
@gomesalexandre gomesalexandre force-pushed the feat_thor_outbound_detection_2 branch from ae22b1a to 05262eb Compare November 28, 2023 00:32
@gomesalexandre gomesalexandre marked this pull request as ready for review November 28, 2023 00:34
@gomesalexandre gomesalexandre requested a review from a team as a code owner November 28, 2023 00:34
@woodenfurniture woodenfurniture force-pushed the feat_thor_outbound_detection_2 branch from 28a84e0 to 8a29e3d Compare November 28, 2023 23:40
@woodenfurniture woodenfurniture enabled auto-merge (squash) November 28, 2023 23:41
@woodenfurniture woodenfurniture merged commit 17882ec into develop Nov 28, 2023
3 checks passed
@woodenfurniture woodenfurniture deleted the feat_thor_outbound_detection_2 branch November 28, 2023 23:46
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.

Add midgard fail checks to getThorchainTransactionStatus
2 participants