Lido on Polygon protocol upgrade

Lido on Polygon V2 upgrade proposal

Reasoning:

Following the successful launch of Lido on Polygon V1, we’ve been working hard incorporating stakeholder feedback to make marked improvements in reducing both staker as well as node operator friction. As a result, we’ve come up with a V2 of Lido on Polygon that makes fewer compromises, eases operator entry and exit, and provides a smoother flow for users and network participants. This version not only brings nice-to-have features for node operators participating in the Lido on Polygon protocol, but also reduces the gas needed for depositing and withdrawing tokens.

As we are committed to the values put forward by the community and the DAO, this upgrade will enable us to onboard a new set of node operators and further decentralise the Polygon network while providing options for more top tier node operators to join the Lido family.

Security:

As Lido takes pride in its dedication to security and this upgrade is no exception. A full smart contract code audit was done by Oxorio and is available for you to read here.

TL;DR change log:

  • Rebalancing stake among validators on deposits and withdrawals

  • Simplified logic for node operator registry

  • No need to transfer validator ownership to Lido’s smart contracts

  • Finer role based access control

  • Gas optimizations for delegations/withdrawals and node operator controls

  • Code refactoring for readability and maintenance

  • Small fixes and code improvements

Full Technical Changelog:

NodeOperatorRegistry

  • New logic for NodeOperatorRegistry contract.

  • The validatorFactory Contract is no longer used by the NodeOperatorRegistry logic.

  • Removed validator proxy logic, the validator can join the protocol without transferring the validator slot to the protocol.

  • Added logic to rebalance delegations.

  • Added logic to delegate tokens between validators.

  • Improved the logic to request a withdrawal from validators.

  • Added ADD_NODE_OPERATOR_ROLE and REMOVE_NODE_OPERATOR_ROLE roles to manage operator life cycle

  • Split the pause role into 2 sub roles PAUSE_ROLE and UNPAUSE_ROLE

  • Added possibility to remove a validator by any wallet if its status is in UNSTAKE or EJECTED

  • Added getProtocolStats function which allows to get info about if the system is balanced or not.

stMATIC

  • The requestWithdraw algorithm was changed to a new one that keeps the validators balanced.

  • Each requestWithdraw will generate 1 NFT token even if the request will be distributed between multiple validators.

  • Added token2WithdrawRequests to map 1 NFT token with multiple withdrawal requests.

  • Added PAUSE_ROLE and UNPAUSE_ROLE

  • The delegate function algorithm was improved to automatically do rebalance and delegate to the validators who have less delegation.

  • The claimTokens function is compatible with NFTs generated by the requestWithdraw in V1 and V2.

  • Added protocolFee setter.

  • Added rebalanceDelegatedTokens; it rebalances the system.

LidoNFT

  • Delete the NFT from token2Index after request withdrawal, in V1 it was set to ZERO.

  • Delete the NFT from tokenId2ApprovedIndex after approving the NFT, in V1 it was set to ZERO.

1.0.0

Action plan

Snapshot voting

A snapshot vote will be started next week to measure the DAO sentiment towards the proposed changes.

Deployment:

Deployment will go in 2 phases.

Phase one: Testnet release
Phase two. Mainnet release (approx 2 weeks after the testnet launch)

Marketing

Content will be released to inform the community about the upgrade and downtime of staking services and to address concerns with timely release.

Node Operator Operations

  • Validator slots will be retrieved by existing Lido on Polygon Node Operators from the contract

  • Existing Node operators will be registered in the V2 contract

Validator onboarding

Additions to the Lido on Polygon validator will be onboarded in Q4 or early Q1/2023. Depending on the TVL at a time, the Lido Node Operator Subgovernance Group (LNOSG) will decide on the number of node operators to be onboarded in the next round.

6 Likes

To allow the community and governance to check this proposal in more details and improve transparency, we are going to first deploy our contracts, verify them on Etherscan and post those addresses here and inside the snapshot proposal itself.

Testnet smart contracts have already been live for some time and were verified on Goerli Etherscan.
All addresses are visible here:

{
  "network": 5,
  "dao": "0x3E46BEFDA7112d8954b923ea6bd9f07c2e615e10",
  "treasury": "0x3E46BEFDA7112d8954b923ea6bd9f07c2e615e10",
  "matic_erc20_address": "0x499d11E0b6eAC7c0593d8Fb292DCBbF815Fb29Ae",
  "matic_stake_manager_proxy": "0x00200eA4Ee292E253E6Ca07dBA5EdC07c8Aa37A3",
  "proxy_admin": "0x13b954d5FC225eF64650A7D723de763F03e1dbD2",
  "lido_nft_proxy": "0xb7f0F701473458549768753F3176411105ec9693",
  "lido_nft_impl": "0xDfB4A0f4C1f39CCEad3851E4C99EB0DC32c8CdaF",
  "stMATIC_proxy": "0x9A7c69A167160C507602ecB3Df4911e8E98e1279",
  "stMATIC_impl": "0x54428212123c5de67ee776eefeb09ad44186d875",
  "node_operator_registry_proxy": "0xbba726ffc99828c7eaa1e4fE1Ed9115f178cD69B",
  "node_operator_registry_impl": "0x304acD621d4B394AdE4c805Cb7dC778756c79926",
  "fx_state_root_tunnel": "0x5C0e4a60Cb0cC9271994d834510e196e3985b616",
  "fx_state_child_tunnel": "0x2071947Fa4f823b7F9B21C78B0afD5EfFc2D968e"
}

The mainnet deployment is scheduled for this week.

3 Likes

Lido on Polygon V2 contracts are deployed on Ethereum mainnet and verified on Etherscan.

{
    "network": 1,
    "dao": "0xd65Fa54F8DF43064dfd8dDF223A446fc638800A9",
    "treasury": "0xd65Fa54F8DF43064dfd8dDF223A446fc638800A9",
    "matic_erc20_address": "0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0",
    "matic_stake_manager_proxy": "0x5e3Ef299fDDf15eAa0432E6e66473ace8c13D908",
    "proxy_admin": "0x0833f5bD45803E05ef54E119a77E463cE6b1a963",
    "lido_nft_proxy": "0x60a91E2B7A1568f0848f3D43353C453730082E46",
    "lido_nft_impl": "0x8B747A13D2Af956Ea7B9a36E659807Ea5cF5E04A",
    "stMATIC_proxy": "0x9ee91F9f426fA633d227f7a9b000E28b9dfd8599",
    "stMATIC_impl": "0xCa7fB9581f1EFC89455D6B5B792E80726AC1Caaa",
    "stMATIC_child": "0x3A58a54C066FdC0f2D55FC9C89F0415C92eBf3C4",
    "node_operator_registry_proxy": "0x216B8b78e0632138dc38907dd089aAB601ED6EDC",
    "node_operator_registry_impl": "0x1b6c71EdbdB8174420Cf9B368B38A1B52bfDd7F3",
    "fx_state_root_tunnel": "0xc7dd5c30DcA04f487c9ede0c5AC580c91587fc66",
    "fx_state_child_tunnel": "0x0833f5bD45803E05ef54E119a77E463cE6b1a963",
}

All the existing node operators are added to the new Node Operator Registry, and that can be checked by calling this function: getValidatorIds

Remaining steps to conclude the upgrade process:

  1. Snapshot proposal
  2. Upgrade implementations from V1 to V2 after successful Snapshot voting
  3. Coordinate with node operators to migrate staking NFTs back to their reward addresses
3 Likes

Lido on Polygon V2 upgrade snapshot voting is now live and ends on December 12 at 4PM UTC.
The voting reaches a quorum if more than 50 million LDOs vote for one of the options and is supported if more votes choose the “For” option.
https://snapshot.org/#/lido-snapshot.eth/proposal/0xbb5c7f1b0ae30b502ec207cffa324b05f69d6024cc56d94b0ea8df69216de1c4

1 Like