-
Notifications
You must be signed in to change notification settings - Fork 457
chore: rewards v2.2 upgrade scripts #1667
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
base: release-dev/rewards-v2.2
Are you sure you want to change the base?
chore: rewards v2.2 upgrade scripts #1667
Conversation
9b2b470 to
1103809
Compare
2b46d2a to
dcd304d
Compare
ypatil12
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can use the CoreContractsDeployer lib: deployRewardsCoordinator
| // Deploy the new RewardsCoordinator implementation | ||
| runAsEOA(); | ||
|
|
||
| _validateNewImplAddress(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can use the implementation validations in TestUtils.sol. Specifically:
// Run tests
TestUtils.validateProxyAdmins();
TestUtils.validateImplConstructors();
TestUtils.validateImplsNotInitializable();There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.