AsgardInvariant: Since not explicitly checking IsStreaming, double-counts streaming In and Out for swaps with affiliate swaps
Example (for querier code at time of writing):
https://thornode-v1.ninerealms.com/thorchain/invariant/asgard?height=12122602
"insolvent: 22000000rune"
https://thornode-v1.ninerealms.com/thorchain/invariant/asgard?height=12122603
"insolvent: 49557581200rune"
The initial insolvency is for a known reason, fixed since block 12047519 (v1.117.0 !3032 (merged)).
The added insolvency is an AsgardInvariant
double-counting error:
https://thornode-v1.ninerealms.com/thorchain/swap/streaming/E3C2137C1E78AEB4E17F0070CCD1D177763D18E660666B86C3C53455AA0760CA?height=12122603
"out": "49535581200"
https://thornode-v1.ninerealms.com/thorchain/queue/swap?height=12122603
'E3C2137C1E78AEB4E17F0070CCD1D177763D18E660666B86C3C53455AA0760CA'
is listed twice, once with a non-zero stream_interval
(the main swap) and one without (the affiliate swap).
However, at present the streaming information is gotten from the TxID (and thus double-counted), without checking IsStreaming
.
I thus propose an explicit IsStreaming
conditional to surround the GetStreamingSwap
call.
(It might not be convenient to enclose all the streaming code as the IsNative
-specific swapCoins = swapCoins.Add(coin)
should still take place regardless of streaming.)
Specifically: !3123 (merged)
'AsgardInvariant
: Explicitly check IsStreaming
to not double-count streaming In and Out for affiliate swaps'.