Miscellaneous Ragnarok Fixes
The following tweaks are included based on observations from stagenet
test of BNB ragnarok and re-audit while making changes:
- Only allow synth exit swaps of synth to the corresponding L1 during ragnarok
- Disallow streaming synth exits during ragnarok
- Withdraw savers as non-streaming during ragnarok
- Clear all corresponding loan records during ragnarok
- Also remove corresponding synth and derived asset pools for gas assets
The separate fixes are organized into commits so this can be merged without squash to preserve clear history without independent reviews.
Merge request reports
Activity
added priority0 label
added 4 commits
Toggle commit listremoved priority0 label
added priority1 label
changed milestone to %Release-1.129.0
- Resolved by Pluto
- Resolved by Ursa (9R)
- Resolved by Asmund THORSec
added 5 commits
- aaa50541 - [fix] Pause All Swaps on Pool Ragnarok Except Exiting Synths
- 0d362ef4 - [fix] Disable Streaming Synth Exits on Ragnarok Pools
- a3db49f1 - [fix] Ragnarok Savers as Non-Streaming
- d7bea0f5 - [fix] Zero Loans and Remove Gas Asset Synth and Derived Pools on Ragnarok
- ba4aaf15 - Ragnarok Info Logs
Toggle commit listreset approvals from @AsmundTHORSec by pushing to the branch
- Resolved by Multipartite
Thank you for the explicit 'merged without squash' explanation.
Could I ask for the reasoning behind
"Only allow synth exit swaps of synth to the corresponding L1 during ragnarok"
? That is (for example) why not allowing swapping (burning) to RUNE
(/swapping to anything that can be double-swapped to through RUNE)
?Namely, current-diff
IsTradingHalt
case *MsgSwap: // regardless ragnarok, synth to equivalent layer1 asset is allowed source := m.Tx.Coins[0].Asset if !(source.IsSyntheticAsset() && m.TargetAsset.Equals(source.GetLayer1Asset())) { checkAssets = []common.Asset{m.Tx.Coins[0].Asset, m.TargetAsset} }
rather than for example
case *MsgSwap: // regardless of ragnarok, synth withdraw is allowed source := m.Tx.Coins[0].Asset if !source.IsSyntheticAsset() { checkAssets = []common.Asset{source} } // regardless of ragnarok, synth withdraw to equivalent layer 1 asset is allowed if !source.MimirString != m.TargetAsset.MimirString() { checkAssets = append(checkAssets, m.TargetAsset)} }
.
(MimirString
comparison in that if it's already added (L1->Synth),
no reason to add it again
(unless perhaps wanting to check forRAGNAROK-THOR-RUNE
, however never a THOR.RUNE pool?)
, and if not added (Synth->L1)
then similarly no reason to add it.)--Similarly, would it be meaningful to add a
if checkAssets[i].IsRune() { continue }
to the checkAssets
range
so THORChain doesn't undesirably do a KVStoreGetMimir
forRAGNAROK-THOR-RUNE
whenever any MsgSwap involves a Native Asset?
(Also, a minor note that the current diff has both
source := m.Tx.Coins[0].Asset
and
checkAssets = []common.Asset{m.Tx.Coins[0].Asset, m.TargetAsset}
whereas the second line could instead be
checkAssets = []common.Asset{source, m.TargetAsset}
.)Edited by Multipartite
mentioned in issue mayachain/mayanode#87