Skip to content

[fix] migration to fix module invariants

akrokr requested to merge akh/migrate_module_invariants into develop

The module balance invariants have been stable since v113, which included a fix for the only break from v112.

The endpoints are not the easiest to read, but the current over/under insolvencies can be found in the following queries:

$ curl -s https://thornode.ninerealms.com/thorchain/invariant/asgard | jq .msg | sed "s/\\\n/X/g" | tr X \\n
"oversolvent: 1000001avax/avax
oversolvent: 4581avax/usdc-0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e
oversolvent: 20529bch/bch
oversolvent: 99999bnb/bnb
oversolvent: 942067btc/btc
oversolvent: 4400752724doge/doge
oversolvent: 4455527eth/eth
oversolvent: 215666666666eth/fox-0xc770eefad204b5180df6a14ee197d99d808ee52d
oversolvent: 21884753549eth/usdc-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
oversolvent: 281542eth/usdt-0xdac17f958d2ee523a2206206994597c13d831ec7
oversolvent: 1039626gaia/atom
insolvent: 5082320319988rune
oversolvent: 2527terra/luna
oversolvent: 29955102645terra/ust

$ curl -s https://thornode.ninerealms.com/thorchain/invariant/bond
{
  "broken": true,
  "invariant": "bond",
  "msg": "oversolvent: 6936532592883rune"
}

$ curl -s https://thornode.ninerealms.com/thorchain/invariant/thorchain
{
  "broken": true,
  "invariant": "thorchain",
  "msg": "oversolvent: 100000000rune\n"
}

These accounting errors are the result of at least a dozen bugs which have been fixed, some of which are documented in #1258 (closed).

Closes #1471 (closed) Closes #1258 (closed)

Note: a new issue popped up this release but is minor and rare enough that I'd rather get these squared away and do a follow-up later if it triggers again: #1584 (closed)

Edited by akrokr

Merge request reports