Venus Upgrades for BNB Chain Lorentz Hardfork

Summary

To align with Lorentz Hardfork, Venus Protocol requires the following changes Venus Labs has prepared, taking into account the increase in the block rate on BNB Chain, from one block every 3 seconds to one block every 1.5 seconds:

Phase 1:

  • update the interest rate models of every VToken, using the CheckpointView contract, that will be able to calculate the interest rates considering when the block rate will change on BNB Chain

Phase 2:

  • Upgrade implementation of VAIController, Prime, PrimeLiquidityProvider and every VToken contract, with the new blocks per year (21,024,000)
  • Upgrade the implementation of the XVSVaultProxy, and set the blocks per year to the new value
  • Upgrade the implementation of the GovernorBravoDelegator, with a new GovernorBravoDelegate, and update the voting periods for each VIP type (these periods are defined in block numbers)
  • Update of the rewards per block on the XVS Vault, VAI Vault and Prime Liquidity Provider, halving the rewards per block. Halve the XVS emissions per block in the XVS market
  • Transfer GovernorBravoDelegator to Governance

Rationale

These changes are mandatory to accommodate the Venus Protocol to the Lorentz hardfork on BNB Chain: BEP-520: Short Block Interval Phase One: 1.5 seconds, which will happen on April 29th, at 5:05AM UTC.

The interest rate contracts of every market will be replaced with the CheckpointView contract. CheckpointView is a contract that will call a different contract (in this case, a different interest rate contract) depending on the current timestamp. This way, the VToken contracts will consider the right interest rates on every block, being transparently switched under the hood after the hardfork on the BNB Chain network.

This VIP uses an auxiliary contract SetCheckpointBscmainnet to change every interest rate contract in one transaction.

Also, VAIController, Prime, PrimeLiquidityProvider, XVSVault and every VToken contract had a constant value with the number of blocks per year. Most of the implementations have been simply redeployed using the new value. The XVSVault implementation has been redeployed adding a new function to support future changes in the blocks per year.

The different types of “rewards” are defined per block on Venus (XVS Vault, VAI Vault, Prime and emissions). They must be halved to maintain the same daily amounts.

Security and additional considerations

We applied the following security procedures for this upgrade:

  • Audits: Certik and Fairyproof have audited the deployed code
  • VIP execution simulation: in a simulation environment, validating the new implementations and interest rate models are properly set on BNB Chain, with the right parameters
  • Deployment on testnet: the same upgrade has been performed on BNB Chain testnet, and used in the Venus Protocol testnet deployment

Audit reports

2 Likes

Will the upgrade stop supplying or borrowing in Venus? If so, how long will it last?

1 Like

No. It’s planned so that it doesn’t have any impact on protocol.

1 Like