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.

7 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

Thank you for the update @DeFiYaco!

I have a question regarding the fee and infrastructure:

  1. Earlier, it was discussed that the commission should be 5% to be able to join Lido on Polygon with its possible change in the future (in the next Onboarding Waves). How are things now? Will be Node Operators able to set any fee? or everyone should have the same rate?

  2. Can the Node Operator (in case, it will be approved by DAO after evaluation) run on the existing Polygon node or should it be a separate setup?

TIA!

Hey @Anna_Vareniuk,

  1. The commission fee requirement is our policy, it is not written in the code. Any commission fee between 0% and 5% is acceptable. Different LoP NOs can have different commission fees set. That will not be an issue :slight_smile:

  2. The NO can run the existing Polygon node. No need to run the separate setup. After this protocol upgrade, accepted NOs will just be added to the Node Operator Registry and that is it. No need to transfer validator ownership to Lido contract like it was required in v1.

Thanks for your questions, please wait for our announcement of the NO onboarding round that we are targeting for the beginning of the next year.

1 Like

@DeFiYaco, thank you for the quick response :hugs:

So returning to the commission fee, so do I understand it right that NOs will not be allowed to set a commission fee above 5%, let’s say 7% or 10% or whatever? Only within 0%-5% range?

We will follow up on updates, thank you!

That is the current policy, yes. We might revisit it after we receive all the applications for the second onboarding round if we see it makes sense. For now, we want to keep it capped at 5%.

Also, keep in mind that on top of these staking commission fees, Lido on Polygon NOs receive additional rewards from each reward distribution: Fees | Lido On Polygon Docs

2 Likes

Okay I see, thank you for the detailed answers!

2 Likes

Since the last proposal did not pass, we have used the extra time during the holidays to audit and upgrade stMATIC and lido nft contracts with extra logging and event data to enable easier analytics and integrations with third party protocols.
All changes are audited and the reports are publicly available on Github: polygon-contracts/audits/v2 at main · lidofinance/polygon-contracts · GitHub

{
    "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": "0x4CA459DFC8b1cACa3763C954E889e6D644984385",
    "stMATIC_proxy": "0x9ee91F9f426fA633d227f7a9b000E28b9dfd8599",
    "stMATIC_impl": "0x15152eEE59752F18C2de8fbd4Bc83Ec20c448303",
    "stMATIC_child": "0x3A58a54C066FdC0f2D55FC9C89F0415C92eBf3C4",
    "node_operator_registry_proxy": "0x216B8b78e0632138dc38907dd089aAB601ED6EDC",
    "node_operator_registry_impl": "0x1b6c71EdbdB8174420Cf9B368B38A1B52bfDd7F3",
    "fx_state_root_tunnel": "0xc7dd5c30DcA04f487c9ede0c5AC580c91587fc66",
    "fx_state_child_tunnel": "0x0833f5bD45803E05ef54E119a77E463cE6b1a963",
}

Remaining steps to conclude the upgrade process:

  1. Snapshot proposal rerun
  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
2 Likes

Snapshot vote started

We’re starting the Lido on Polygon V2 upgrade (restart) Snapshot, active till Wed, 18 Jan 2023 15:00:00 GMT . Please don’t forget to cast your vote!

1 Like

:ballot_box: Snapshot vote ended!
Results are:
For: 57,167,414.98
Against: 7,676.63

Snapshot vote ended

The Lido on Polygon V2 upgrade (restart) Snapshot has passed! :partying_face:
The results are:
For: 57.2M LDO
Against: 7.7k LDO

2 Likes

I’d just like to know how to get a code for unicorn party please