chore: rewards v2.2 upgrade scripts#1667
chore: rewards v2.2 upgrade scripts#16670xrajath wants to merge 6 commits intorelease-dev/rewards-v2.2from
Conversation
9b2b470 to
1103809
Compare
2b46d2a to
dcd304d
Compare
ypatil12
left a comment
There was a problem hiding this comment.
Might also need to add KeyRegistrar in this upgrade
| zUpdateUint32("REWARDS_COORDINATOR_MAX_REWARDS_DURATION", 63072000); | ||
|
|
||
| // Deploy RewardsCoordinator implementation with the updated MAX_REWARDS_DURATION | ||
| deployImpl({ |
There was a problem hiding this comment.
Can use the CoreContractsDeployer lib: deployRewardsCoordinator
| // Deploy the new RewardsCoordinator implementation | ||
| runAsEOA(); | ||
|
|
||
| _validateNewImplAddress(); |
There was a problem hiding this comment.
Can use the implementation validations in TestUtils.sol. Specifically:
// Run tests
TestUtils.validateProxyAdmins();
TestUtils.validateImplConstructors();
TestUtils.validateImplsNotInitializable();There was a problem hiding this comment.
Should keep upgrade specific assertions: _validateZeusEnvUpdated, _validateNewFunctionality, and _validateStorageLayout
| /// @dev Get the calldata to be sent from the timelock to the executor | ||
| function _getCalldataToExecutor() internal returns (bytes memory) { | ||
| /// forgefmt: disable-next-item | ||
| MultisigCall[] storage executorCalls = Encode.newMultisigCalls().append({ |
There was a problem hiding this comment.
Can use QueueUpgradeHelper. Example:
MultisigCall[] storage executorCalls = Encode.newMultisigCalls();
/// permissions
executorCalls.upgradeRewardsCoordinator();| execute(); | ||
| assertTrue(timelock.isOperationDone(txHash), "v1.10.0 RewardsCoordinator upgrade should be complete"); | ||
|
|
||
| // 5 - Validate the upgrade was successful |
There was a problem hiding this comment.
Can use TestUtils:
TestUtils.validateProxyAdmins();
TestUtils.validateProxyConstructors();
TestUtils.validateProxiesAlreadyInitialized();
TestUtils.validateProxyStorage();
TestUtils.validateImplAddressesMatchProxy();
TestUtils.validateProtocolRegistry();Good to keep the first and last ones though since they are upgrade-specific
| proxy: address(Env.proxy.rewardsCoordinator()), | ||
| impl: address(Env.impl.rewardsCoordinator()) | ||
| }) | ||
| }); |
There was a problem hiding this comment.
Also need a queue an update to the ProtocolRegistry via ship. Since the names and addresses and config are the same, fine to just set a semver and leave the first 3 params empty.
Motivation:
Rewards v2.2 upgrade scripts (v1.10.0)
Modifications:
v1.10.0-rewards-v2.2release script that includes 3 steps (Collectively it upgrades the RewardsCoordinator to include Rewards v2.2 functionality and also updatesMAX_REWARDS_DURATIONfrom 70 days to 2 years):1-deployRewardsCoordinatorImpl.s.sol2-queueRewardsCoordinatorUpgrade.s.sol3-executeRewardsCoordinatorUpgrade.s.solv1.9.0-slashing-uxandv1.9.0-slashing-ux-destinationrelease scripts to have a version check forv1.8.1.Result:
Rewards v2.2 upgrade.