Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement avalanche blockchain manager upgrade flow #2319

Open
meaghanfitzgerald opened this issue Nov 6, 2024 · 0 comments
Open

Implement avalanche blockchain manager upgrade flow #2319

meaghanfitzgerald opened this issue Nov 6, 2024 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@meaghanfitzgerald
Copy link
Collaborator

Goal

Enable users to upgrade Validator Manager contracts to new deployed implementations via an upgrade to the proxy contract.

Details

Both the PoA and PoS options offered in the CLI will be deployed behind a TransparentProxy contract included in genesis at the address set in ConvertSubnetToL1Tx. The admin of this TransparentProxy is a ProxyAdmin contract included in genesis at a given address (which is also set in genesis).

The owner of the ProxyAdmin contract is decided when the user selects an owner during
avalanche blockchain create, and will likely be set to an EVM address controlled by the user. This address has control over upgrading the implementation ValidatorManager referenced by the TransparentProxy through use of a ProxyAdmin.

The implementation contract for either PoA or PoS ValidatorManager(depending on the user selection) is included in genesis at a given address (which is also set in genesis).

avalanche blockchain manager upgrade should enable the user to:

Option 1. Upgrade their PoA L1 to a PoS L1
Option 2. Upgrade the proxy to point at a custom Validator Manager contract already deployed by the user

Upgrade PoA to PoS

Requirements:

  • Deploy a NativeTokenStakingManager with default values for
    • minimum stake amount
    • maximum stake amount
    • minimum stake duration
    • minimum delegation fee
    • maximum stake multiplier
    • weight to value factor
  • Deploy a ExampleRewardsCalculator with contructor args to determine rewardBasisPoints.
  • Point the TransparentProxy's implementation to the new TokenStakingManagerAddress through a call to ProxyAdmin with user's owner key set previously in avalanche blockchain create.
  • Re-initialize the validator set within the new contract

Upgrade to custom Validator Manager contract

Requirements:

  • User has already deployed a custom contract with a valid function to initialize the validator set, and a rewards calculator contract if necessary
  • User is prompted for the L1 EVM address of the new validator manager contract implementation
  • Point the TransparentProxy's implementation to the new L1 EVM address provided in the previous address through a call to ProxyAdmin with user's owner key set previously in avalanche blockchain create.
  • Upon successful execution of the previous step, advise user to re-initialize the validator set within the new contract.

To Note

A POC of the PoA -> PoS upgrade is outlined in this demo.

@meaghanfitzgerald meaghanfitzgerald added the enhancement New feature or request label Nov 6, 2024
@meaghanfitzgerald meaghanfitzgerald added this to the ACP 77 milestone Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog 🗄️
Development

No branches or pull requests

1 participant