Dev Update #120-#121
THORChain Dev Update for Weeks 120–121, 05 Dec — 19 Dec; RoadMap, Liquidity Cap Changes, Stagenet Update, MCCN Updates, Community Updates!
Dev Update #120-#121
THORChain Dev Update for Weeks 120–121, 05 Dec — 19 Dec; RoadMap, Liquidity Cap Changes, Stagenet Update, MCCN Updates, Community Updates!
Summary
It has been a big year with MCCN being launched 8 months ago. There have been a few challenges along the way however, THORChain, the devs and the community have pushed through, and now the network has over one month of clean operation. The focus now is on stability and will turn to growth in the new year. Liquidity caps will be raised, Stagenet will soon be launched, the Router will be upgraded to position THORChain for the new year. There are also MCCN updates, big community updates and new chains to be added.
Liquidity Cap Definitions
Within THORChain, there are currently two types of liquidity cap; a soft cap known as the liquidity cap (#RAISETHECAPS) and a hard cap within the code.
Soft Cap — a pool liquidity limit set in Mimir (MAXIMUMLIQUIDITYRUNE). This has pros and cons for the network.
Pros
- Ensures Liquidity Provider’s Liquidity (Pooled Liquidity) is protected.
- Fixes the Incentive Pendulum in an optimal state so rewards flow to both Liquidity Providers and Node Operators.
- Allows for progressive relaxation of the guardrails used during Chaosnet.
Cons
- Holds the Incentive Pendulum in place preventing it from doing what it is designed to do.
- Doesn’t allow the flow of rewards based on the network’s state (over or under bonded).
Hard Cap — hard-coded constraint to stop the total pooled from exceeding the total bonded. This is enforced in the code and tested every time liquidity is added.
This ensures the network cannot move past the Unsafe state (dangerously under-bonded) and is the limit of swing the Incentive Pendulum can have to Node Operators. Ideally, the network should never reach this state.
Liquidity Cap Changes
The Liquidity Cap (the soft cap) will be progressively lifted up and away from the optimal state, towards the under-bonded state allowing the Incentive Pendulum to work as intended. The first cap raise will happen before the end of the year, shortly after the Ethereum Router is upgraded.
The hard cap will always remain in place.
Stagenet Update
Stagenet is a staging environment that is a clone of THORChain using real assets, has set validators (nodes), liquidity caps and connections to every chain THORChain currently has. It will closely mimic Chaosnet and is designed to rapidly iterate through wargaming/testing of new features such as Vault Nodes and Synths.
Stagenet will run on a separate Blockchain using sRUNE instead of RUNE. In order for Stagenet to work with real assets, sRUNE will have value and will initially be created from upgraded BNB.RUNE and will only reside in Stagenet. While the validator set will be closed, anyone will be able to use Stagenet with real assets.
Stagenet will pay greater dividends through 2022 with a focus on stability, scalability, and increasing the rate of new chain connections.
The validator set is currently syncing and should be ready this week. Doge and Terra are ready for testing and expected to be in Chaosnet by the end of Q1 2022.
Relevant PRs:
- Stagenet — https://gitlab.com/thorchain/thornode/-/merge_requests/2019 and https://gitlab.com/thorchain/devops/node-launcher/-/merge_requests/392
- Whitelist for Validators — https://gitlab.com/thorchain/thornode/-/merge_requests/2032/
Mainnet RFC and RoadMap
An RFC for Mainnet was created with a follow-up zoom call with the community to better understand the definition of Mainnet.
The definition and timing of Mainnet is still under discussion and more information will be released when ready. As Mainnet is being discussed, below is the THORChain roadmap in 3 phases.
1. Network Stability (this is the phase that is wrapping up now)
Objectives for this phase.
- Shipping 0.77.2 to re-enable Churns
- Deploy Stagenet
- No hacks, halts or other major issues.
- Ethereum Router V3 Upgrade
- Last Cap Raise of the year (before Dec 31st)
- Node Mimir, so Node Operators can control Mimir — https://gitlab.com/thorchain/thornode/-/merge_requests/2023
2. Network Growth
In Q1 2022, the focus will be on increasing bonds which will allow the deepening of existing L1 pools (BTC, ETH, etc.) and new chain integration.
Once Mimir is handed to nodes, the community can increase bonds in 2 ways:
- Increase the soft cap, as described above.
- Reducing minimum bond (300k to 200k to lower the bar for new validators to join the network).
The following features are in progress to increase bonds:
- Make Node rewards relative to bond instead of flat rewards per node — https://gitlab.com/thorchain/thornode/-/issues/1187.
- Pooled or Team Nodes to allow 4 bonders to pool bond with 1 skilled node operator — https://gitlab.com/thorchain/thornode/-/issues/1067.
- Vault Nodes — https://gitlab.com/thorchain/thornode/-/issues/1150 (Economic design needs to be fully fleshed out first).
3. Expand the Network
Q2 and beyond will focus on adding new chains, continuing network growth, adding chains. 2022 will also see the launch of THORFi. More details will be released next year.
Retiring of ETH.RUNE and BNB.RUNE
One of RUNE’s primary purposes is to be a settlement asset within THORChain — this means RUNE’s needs to be native. It is time to plan the retirement of non-native RUNE. This will serve several purposes:
- Accelerate conversion of IOU RUNE
- Remove dependencies of those chains on the network
- Fix the Native RUNE discount problem
- Force exchanges to adopt Native RUNE
- Increase liquidity of RUNE within THORChain
Draft Plan Outlined:
- Beginning from planned obsolescence, the SWITCH rate drops from 1:1 to 0:1 over the course of 5256000 blocks (1 year), dropping by 1/5256000 = 0.00000019 RUNE each block.
- After 1 year, no more switch is possible, remove the switch handler, never handle IOU RUNE ever again.
- The total supply of RUNE will likely be reduced.
ETH.RUNE will likely be targeted first. Specifics are being discussed by the community now.
Major TSS Bug Disclosure and Bounty Paid
A major bug was disclosed within the GG18 and GG20 implementations of ECDSA Threshold Signature Scheme (TSS), THORChain uses the GG20 Implementation to secure its Asgard Vault.
“Key Extraction Attacks on Threshold ECDSA Implementation” paper was published detailing 2 possible attacks with a follow-up paper on the outcome. In Summary:
“Both attacks lead to a complete secret key extraction by exploiting different parts of the Multiplicative-to-Additive (MtA) sub-protocol the parties run during signing.”
The fix within THORChain was released in v0.71.0 — https://gitlab.com/thorchain/thornode/-/merge_requests/1962
THORChain paid a $500,000 bounty for the bug.
The Immunefi Bounty Program for THORChain remains open, details at https://immunefi.com/bounty/thorchain/.
Audit Reports Update
- Audit Report of the State Machine by Halborn Released.
- TSS Audit Report by Halborn made Finalised.
All THORChain Audit Reports can be found at https://github.com/thorchain/Resources/tree/master/Audits
MCCN Updates
UPDATE bitcoin client & ETH client
1) Update GETH client to 1.10.13 PR: https://gitlab.com/thorchain/devops/node-launcher/-/merge_requests/380
2) Update BTC client to 22.0 + 1TB mainnet PR: https://gitlab.com/thorchain/devops/node-launcher/-/merge_requests/381
THORNODE UPDATE 0.76.0
1) [ADD] remove validatorRate functions and make sure marking happens during. PR: https://gitlab.com/thorchain/thornode/-/merge_requests/2021
2) [ADD] Update BTC client to 22.0. PR: https://gitlab.com/thorchain/thornode/-/merge_requests/2018
3) [ADD] Update GETH client dev to 1.10.13. PR: https://gitlab.com/thorchain/thornode/-/merge_requests/2017
4) [ADD] Fill withdraw event fields on pool suspension. PR: https://gitlab.com/thorchain/thornode/-/merge_requests/2016
5) [ADD] Changes to upgrade router contract to v3. PR: https://gitlab.com/thorchain/thornode/-/merge_requests/2015
6) [ADD] Validate asset address / rune address is match with the asset. PR: https://gitlab.com/thorchain/thornode/-/merge_requests/2014
7) [BUG] fix fullnode seeds. PR: https://gitlab.com/thorchain/thornode/-/merge_requests/2013
8) [BUG]Ignore error when transaction is not signed by bifrost. PR: https://gitlab.com/thorchain/thornode/-/merge_requests/2010
9) [ADD] When node request to leave and churn out , set the node to standby. PR: https://gitlab.com/thorchain/thornode/-/merge_requests/2009
10) [ADD] Allow node to leave / unbond if fund left in yggdrasil vault is less than 10x the max gas. PR: https://gitlab.com/thorchain/thornode/-/merge_requests/2008
11) [BUG] ILP Attack Vector For Staged Pools. PR: https://gitlab.com/thorchain/thornode/-/merge_requests/2006
12) [ADD] Add mimir to enable / disable ILP per pool. PR: https://gitlab.com/thorchain/thornode/-/merge_requests/2005
release: https://gitlab.com/thorchain/thornode/-/tags/v0.76.0
ETH Router Upgrade
https://gitlab.com/thorchain/thornode/-/merge_requests/2015 prepared for the Ethereum Router Contract upgrade. Updated Router contract address served at https://thornode.thorchain.info/thorchain/inbound_addresses.
Community Updates
THORNoob
Weekly Community Recap #17-#18: THORChain
DevOps Major Update
node-launcher
- Rescale load balancer for hcloud
cluster-launcher
- Hetzner bare metal [WIP]
- Update dependencies on hcloud
- hetznercloud/hcloud 1.32
- hetznercloud/hcloud-csi-driver:1.6.0
- hetznercloud/hcloud-cloud-controller-manager:v1.12.1
- Kubespray 2.17.1
- ansible 3.4.0
- mitogen 0.3.0
- python 3.9
- devsec.hardening 7.13.2
- Kubernets 1.21.6
- Prepare kubespray git submodule to be used by multiple systems, hcloud & hrobot.
- Add suppport for Apple Silicon (for now terraform works only on x86, due to unavailable dependencies).
Adjust docs and add section about setting the location of the THORNode gateway LB allowing for optimization for the new network zone us-east. Yep, Hetzner in USA.
THORmon
DevOps
- Make historic API endpoints accessible
Frontend
- Fix bug when switching network in history mode
- Calculate blocktime on a churn cycle basis (more accurate)
- Show churning progress in blocks as well
- Maintain and fix premature 100% churn progress
- Make entire history accessible block for block
- Improve styling of history controls
- Fix score display
- Fix churn clock
- Add churn clock to history mode
- Add full-fledged history controls
- Add churn progress percentage indicator
- Refactor RUNE ticker information
- Refactor raw controls
- Refactor functions
- Add total locked bond metric
- Make chain comparison independent from attached chains
- Fix observed chains with null value bug showing for 5 blocks after churn
- Fix churn out highlighter and make expanded status name searchable
- Update dependencies
- Fix block traversal for hours backwards
- Store historic node fetches
- Fix churn indicator oldest node
- Change history button position
- Change timezone to UTC
- Add history mode slider
- Add full-fledged history mode
- Add history mode scaffold
- Fix keyboard controls display
- Update dependencies and change blocktime unit display
- Add Average/Median for score and slashes

Backend
- Update dependencies
Churn Clock FEATURE Improvements
- Churn Clock calculates on a cycle basis and is super accurate now.
- Also giving you a percent progress indicating completion of the cycle the current block is in.
NEW FEATURE — HISTORY MODE
You can now browse the entire history the THORNode network along the entire chain, in history mode. Block for block, churn for churn, or second, minute, hour, day, week and month for second, minute, hour, day, week and month. With a built in multiplier, history controls give you all the control in the world to navigate through historic events. Plus a slider to give you an overview where in history you’re at, or just for sliding around Or go to the current tip Or edit the URL to get to a specific block and those can be shared
Switch back and forth between live streaming and closer inspection with the press of a button. All functionality is for both buttons and keyboard keys alike, check help for more info
Don’t forget there’s much info in stats, much more readable than in the header, check it out if you haven’t yet.
https://thorchain.network/block/2938915
https://thorchain.network/block/3682
https://thorchain.network/block/3312864


THORChain Monitoring bot
- Discord integration
- Forwarding all kinds of notifications to Discord channels
- Transforming HTML into Discord format
- Automatic Telegram-sticker downloading and caching
It is now being tested in our RuneAnalytics Discord community.
• Liquidity Cap notification bugfix
Next to do:
• Discord: Rune holder/LP provider verification system (like Collab.land)
• Discord: Additional bots for price/cap monitoring
• Slack integration
THORCasino (working title)
We started developing an app to bring gamification to THORChain, motivating new members to add funds to the liquidity pools. As for me, I am prototyping a simple lottery on the native blockchain which scans blocks and periodically draws small prizes among participants who have provided liquidity. More details will be published soon.

Midgard Quarterly Update 01/10–17/12
Not all of this is code change, Include also iswhat Midgard team members were negotiating with other teams.
- BlockStore
o generated by Midgard, read by Midgard.
o A static copy of the blocks from ThorNode.
o Can be copied from a remote location on first startup (with hash checks)
o Speeds up greatly the resync.
o Will allow Midgard working after a fork, and it will even keep historical data.
- Analyzing the gains and losses.
o LUV metric for value / pool unit. It should always go up. ThorNode slightly changed to keep this invariant. Alerts added.
o PriceShift metric for Impermanent Losses. Gains = LUF*PriceShift. Good candidate for dashboards to display gains.
- Identified issues around ILP, raised and followed up on them with relevant teams.
- Investigated ThorNode / Midgard depth & unit divergences. Raised underlying issues, corrected divergences.
- Rewrite of v2/actions for serving speedup. (precalculated table with the result json format in generated in sql)
- Fixed v2/actions logic issues around status.
- React to Midgard outage with quick fix and a proper speed up later. (indexing fell behind thornode)
- Statechecks performance improvements.
- Big refactorings around ChainId management, health status, improved logging, goroutine management and overal code simplicity
TRX1’s Weekly Dev Report (13/12–19/12)
• Slack bot: work in progress
— Registered developer account and set up an application for Slack
— Created a couple of prototypes to play with API
— OAuth workflow for app distribution
— Forwarding messages from the alert channel to Slack channel (formatting is poor yet)
Bridge Status
Immediate Focus
- DOGE — Completed, Awaiting Stagenet and node operator approval. https://gitlab.com/thorchain/devops/node-launcher/-/merge_requests/392
- ATOM — Completed, Awaiting Stagenet and Node Operator approval. Will use Cosmos Hub (Gaia) after DOGE is live. Latest PRs are https://gitlab.com/thorchain/devops/node-launcher/-/merge_requests/338 and https://gitlab.com/thorchain/thornode/-/tree/cosmos-gaia-client
- Terra — Completed, Awaiting Stagenet Node Operator approval. will follow after ATOM on the same path.
Upcoming in 2022
- Decred — https://gitlab.com/thorchain/thornode/-/issues/991
- Dash — https://gitlab.com/thorchain/thornode/-/issues/982
- Solana — https://gitlab.com/thorchain/thornode/-/merge_requests/1514. Reach
- Monero —
- https://gitlab.com/thorchain/tss/go-tss/-/tree/moneroTss, https://gitlab.com/thorchain/tss/monero-sign, https://gitlab.com/thorchain/tss/monero-wallet-rpc
Want to see bridges built quicker, get involved on our Discord Server!
Community
To keep up to date, please monitor community channels, particularly Telegram and Twitter:
- Twitter: https://twitter.com/thorchain_org
- Telegram Community: https://t.me/thorchain_org
- Telegram Announcements: https://t.me/thorchain
- Dev Discord https://discord.gg/kvZhpEtHAw
- Reddit: https://reddit.com/r/thorchain
- Gitlab (primary): https://gitlab.com/thorchain
- Github (secondary): https://github.com/thorchain
- Medium: https://medium.com/thorchain