Skip to content

Validator Manager V2 - Contract Decoupling

Latest
Compare
Choose a tag to compare
@cam-schultz cam-schultz released this 13 May 15:50
· 19 commits to main since this release
eb0afb7

Contract Structure

  • Validator Manager contracts are refactored to consist of multiple deployed contracts that interact via external function calls.
    • PoA Validator Managers consist of a single ValidatorManager contract instance. See the migration guide for instructions on how to safely upgrade a v1 PoA contract to the v2 contract.
    • PoS Validator Managers consist of the core ValidatorManager contract instance and a standalone StakingManager contract instance. Migration to v2 is not supported for v1 PoS contracts.

Renamed Methods

  • Validator and Delegator registration and removal initiation methods renamed from initialize to initiate
    • ex: initializeValidatorRegistration changed to initiateValidatorRegistration
  • End Validation methods renamed from endValidation to validatorRemoval
    • ex: completeEndValidation changed to completeValidatorRemoval

Changes to Reward Recipients

Reward recipients for both Validators and Delegators are now provided at registration time, rather than at removal. Reward recipients may still be updated after registration using changeValidatorRewardRecipient and changeDelegatorRewardRecipient. As such, the validator and delegator removal function overloads that specify a rewardRecipient have been removed.

initiateValidatorRegistration

  • registrationExpiry removed from initiateValidatorRegistration methods.
  • ValidatorRegistrationInput helper struct removed in favor of specifying each field as its own argument
  • rewardRecipient added as a parameter.
contract IERC20TokenStakingManager
-   struct ValidatorRegistrationInput {
-       bytes nodeID;
-       bytes blsPublicKey;
-       uint64 registrationExpiry;
-       PChainOwner remainingBalanceOwner;
-       PChainOwner disableOwner;
-   }

-   function initializeValidatorRegistration(
+   function initiateValidatorRegistration(
-       ValidatorRegistrationInput calldata registrationInput,
+       bytes memory nodeID,
+       bytes memory blsPublicKey,
+       PChainOwner memory remainingBalanceOwner,
+       PChainOwner memory disableOwner,
        uint16 delegationFeeBips,     
        uint64 minStakeDuration,
        uint256 stakeAmount,
        address rewardRecipient
    ) external returns (bytes32 validationID);
}

initiateDelegatorRegistration

  • rewardRecipient added as a parameter
-function initializeDelegatorRegistration(
+function initiateDelegatorRegistration(
    bytes32 validationID,
+   address rewardRecipient
) external payable returns (bytes32);

ACP-99 Compliance

  • The Validator Manager contracts are now compliant with ACP-99, which specifies a standard set of public and private methods that must be implemented, and corresponding events that must be emitted, to manage an L1's validator set as specified in ACP-77.
  • Many of the functions, events, error types, and struct definitions that were previously defined in IValidatorManager have been moved intact to IACP99Manager.
  • PoA validators may now update their weights by calling _initiateValidatorWeightUpdate and completeValidatorWeightUpdate as specified in ACP-99.

Bug Fixes and Feature Requests

  • Numerous bug fixes and feature requests were implemented. See the full release notes and the recent audit conducted by OpenZeppelin for details.

What's Changed

New Contributors

Full Changelog: validator-manager-v1.0.0...validator-manager-v2.0.0