Skip to content
Snippets Groups Projects

Miscellaneous Ragnarok Fixes

Merged Ursa (9R) requested to merge ursa/ragnarok into develop
All threads resolved!

The following tweaks are included based on observations from stagenet test of BNB ragnarok and re-audit while making changes:

  1. Only allow synth exit swaps of synth to the corresponding L1 during ragnarok
  2. Disallow streaming synth exits during ragnarok
  3. Withdraw savers as non-streaming during ragnarok
  4. Clear all corresponding loan records during ragnarok
  5. 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

Merge request pipeline #1210935028 passed

Merge request pipeline passed for ba4aaf15

Test coverage 51.90% (-0.10%) from 1 job
Deployed to integ‎ration‎ 1 year ago

Merged by PlutoPluto 1 year ago (Mar 12, 2024 8:41pm UTC)

Merge details

  • Changes merged into develop with ba4aaf15 (commits were squashed).
  • Deleted the source branch.

Pipeline #1210976071 passed

Pipeline passed for ba4aaf15 on develop

Test coverage 51.90% (-0.10%) from 1 job
Deployed to integ‎ration‎ 1 year ago

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Pluto
  • Asmund THORSec
  • Asmund THORSec approved this merge request

    approved this merge request

  • Ursa (9R) added 5 commits

    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

    Compare with previous version

  • Ursa (9R) reset approvals from @AsmundTHORSec by pushing to the branch

    reset approvals from @AsmundTHORSec by pushing to the branch

  • Ursa (9R) resolved all threads

    resolved all threads

  • Pluto approved this merge request

    approved this merge request

  • Asmund THORSec approved this merge request

    approved this merge request

  • merged

    • 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 for RAGNAROK-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 KVStore GetMimir for RAGNAROK-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
  • Multipartite resolved all threads

    resolved all threads

  • Please register or sign in to reply
    Loading