Skip to content

v2.6.1

Compare
Choose a tag to compare
@prasannavl prasannavl released this 31 Jan 10:47
· 1288 commits to master since this release
cf8e454

Mandatory Upgrade

This is a mandatory update for the upcoming Fort Canning Hill chain upgrade. It contains a key fixes that upgrades the protocol.
Fort Canning Hill upgrade is set for block 1604999 (approx. ETA Feb 7, 2022 UTC) on mainnet.

Update of mainnet node to v2.6.1 before the chain upgrade block is REQUIRED.

Upgrade Notes

  • For nodes that are running <= v2.5.0, this is a drop in upgrade. No reindex or fresh sync needed.
  • For nodes that are being restored from recent snapshot, as with all updates before: -rescan for the wallet txs and additionally -spv_resync for users who hold BTC. If either isn't used, they may not be shown in the wallet until rescanned/resynced.
  • For nodes that had already upgraded to the 2.6.0 prior to 2.6.1 release, one of the following is required: a fresh sync, the most recent backup from 2.5.0, latest snapshot.

What’s Changed

v2.6.1

  • The prior 2.6.0 release was retracted due to a mismatch in calculation between 2.5.0 and 2.6.0 that in rare conditions, caused the new nodes to reject valid blocks on 2.5.0 mainnet before the Fort Canning Hill Network upgrade. This is fixed in 2.6.1 and is the required node for Fort Canning Hill upgrade. The mismatch was due to a hidden bug in how 2.5.0 calculates interestPerBlock. 2.6.1 nodes now addresses this condition recreating the calculation exactly as 2.5.0 pre-upgrade.

v2.6.0

Key Focus

  • Loans - Existing Payback
    • Issues with partial payback of loans from the previous versions are now fixed, and should work as expected after the upgrade block.
    • For extremely small loans, before FCH, the min interest per. block is 1 fi per. block (min. unit) and is calculated every block. After FCH, these smaller loans will accumulate the last 1 fi over multiple blocks until payback or fully matures.
      • interestPerBlock will continue to be at 1 fi precision, as that's still the min. unit. However, this will be the interest as per the block in which positions are closed.
      • New realizedInterestPerBlock will show higher precision interest rate that's used to accrue interest rate internally. Note the minimum unit of transactions on the blockchain still continues to be 1 fi precision. It only affects accumulation, so users aren't charged 1 fi every block.
  • Loans - Payback Capability with DFI
    • After FCH upgrade block, payback of loans with DFI instead of the dTokens at a set additional oracle fee, can be enabled. Currently, due to protocol serialisation requiring breaking changes, its capability is limited only to DUSD dToken. The internal capability is expected to be made generic and be expanded to all dTokens in the next planned upgrade. Note: however, this is just the capability. The activation and deactivation is designed to be toggled through on-chain gov.
    • When DFI payback is used, the whole amount is burned (loan token value + loan interest value + % fees).
    • New getburninfo API categories: dfipaybackfee and dfipaybacktokens
  • Loans - Withdrawal
    • From FCH, 50% DFI requirement in vault is now relaxed to 50% of the vault's active min. loan. ratio as DFI. Rest can be withdrawn freely - withdrawing other collateral tokens before DFI to maintain 50% DFI is no longer required.
  • Bi-directional DEX fees
    • DEX now has the ability to charge a % fee on both the maker and taker, if enabled.
    • This is designed to be activated, disabled and changed on the fly per pool pair through on-chain governance.
    • New getburninfo API categories: dexfeetokens
  • Built-in Supplementary Contracts
    • A new built-in system for all supplementary smart contracts (eg. DFIP related smart contracts) with the following new RPCs:
      • listsmartcontracts
      • executesmartcontract
    • dBTC-DFI swap (DFIP2201) is implemented via. this layer.
      • These contracts are designed to be activated or disabled through on-chain governance.
      • dBTC Swap: executesmartcontract dbtcdfiswap 1@BTC to swap dBTC to DFI if the contract is activated.

RPC Changes

  • Existing:
    • getburninfo adds the following additional fields:
      • dexfeetokens
      • dfipaybackfee
      • dfipaybacktokens
    • getinterest adds the following field after FCH block:
      • realizedInterestPerBlock
  • New:
    • listsmartcontracts
    • executesmartcontracts

🚀 Features

🐛 Bug Fixes

🧰 Maintenance

How to run?

Download and untar the relevant version to your operating system, run bin/defid or bin/defid.exe to start a DeFi Blockchain daemon. The client (CLI) can be found at bin/defi-cli or bin/defi-cli.exe.

DeFi App (GUI) users

If you are running the desktop DeFi App, you do not have to manually update the underlying node as the app will handle it. Check https://github.com/DeFiCh/app/releases for the latest releases.

Testnet Info

The following are informational updates that apply only for development on testnet:

  • Testnet upgrade block for FCH is set to 828900
  • Reference blockhash of testnet 827500: 1f8ae3e7881bfaf45414798824eb8c415be512cf29aea4c5316828887400db36
  • Note: Same upgrade notes as mainnet apply to testnet. Please reindex / restore as necessary.

Note: Certain test related infrastructure components (like defiscan.live) could take a while to reflect this change, due to the re-indexing constraints on the specific applications.

Testnet rollback tips (if needed):

$ defi-cli -testnet invalidateblock $(defi-cli -testnet getblockhash 827500)
$ defi-cli -testnet clearbanned
$ defi-cli -testnet reconsiderblock 1f8ae3e7881bfaf45414798824eb8c415be512cf29aea4c5316828887400db36