fix(swap): reject THORChain all-zero outbound-hash sentinel in tracker#344
Merged
Merged
Conversation
Midgard reports out_hash as 64 hex zeros when the outbound leg hasn't been scheduled/observed yet. The tracker ingestion guards only tested truthiness, and a non-empty zero string is truthy — so the sentinel entered state and the UI rendered it as a real OUTPUT TX (with copy + explorer link) and flipped the header to '2 hashes'. Add isRealHash() and guard both ingestion points (live update + resume) so the zero hash never becomes a displayed txid.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The swap tracker displayed an OUTPUT TX of
0000…0000(with copy button + explorer link) and a "2 hashes" header for a swap that had no outbound leg yet — a phantom second transaction.Cause
THORChain/Midgard reports
out_hashas 64 hex zeros when the outbound leg hasn't been scheduled/observed yet — a "no tx" sentinel. The ingestion guards inSwapDialog.tsxonly tested truthiness, and a non-empty zero string is truthy::905(liveswap-update) —if (update.outboundTxid) setLiveOutboundTxid(...):1317(resume from persisted swap) — sameOnce in state, it drove
liveOutboundTxid ? '2 hashes' : '1 hash', the OUTPUT TX row, and an explorer link to a nonexistent tx.Fix
Add
isRealHash()and guard both ingestion points so the zero-hash sentinel never enters state. All downstream rendering (header count, output row, explorer, persisted snapshot) is then correct by construction.Out of scope
The same screenshot showed
GAS 112,387,787,618,779 gason the input tx — a fee-in-wei value mislabeled as gasUsed. That's a Pioneer-side data-mapping issue, tracked separately.