-
Notifications
You must be signed in to change notification settings - Fork 334
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
feat: rewards v2 upgrade script #888
base: dev
Are you sure you want to change the base?
Conversation
7cf6917
to
c36c54a
Compare
c5fa5a8
to
b34c492
Compare
b34c492
to
ad4a0bc
Compare
} | ||
|
||
function testDeploy() virtual public { | ||
_execute(); |
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.
@wadealexc @nadir-akhtar @0xrajath - how/what do you envision us testing in these scripts for the multisig steps?
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.
I would like to mock approvals + timelock forwarding (if any) in these tests.
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.
Oh wait. The actual execute happens in Step 3? So then we have to test that it's been queued in the timelock here.
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.
unfortunately the zeus scripts for multisigs don't actually queue the transaction.. zeus does that. so we'd need a bit more of a lift to refactor these tests to be useful
// Test function implementation | ||
_execute(); |
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 we call this internal function run
or something? execute
can be confused with the multisig execute.
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.
_execute() is an override function, gonna push back on that. you shouldn't be confused while overriding something that has documentation IMO
{ | ||
"name": "rewards-v2", | ||
"from": "^0.0.1", | ||
"to": "0.0.1", |
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 this be 0.1.0
?
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.
yep good call
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.
Rewards release semver will be 0.5.1
(our latest was 0.4.3
)
vm.stopBroadcast(); | ||
} | ||
|
||
function testDeploy() public { |
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.
There should be an additional check/ expect revert to ensure that the the initialize
function can't be called in the implementation contract since it'll be disabled.
MultisigCall[] private _opsCalls; | ||
|
||
function _queue() internal returns (MultisigCall[] memory) { | ||
uint32 rewardsCoordinatorSplitBips = zUpdateUint32(string("REWARDS_COORDINATOR_DEFAULT_OPERATOR_SPLIT_BIPS"), uint32(1000)); |
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 we add a comment right above this explaining that we're updating the zeus param?
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 this should be a uint16
RewardsCoordinator.initialize.selector, | ||
this._executorMultisig(), | ||
this._pauserRegistry(), | ||
zUint64("REWARDS_COORDINATOR_INIT_PAUSED_STATUS"), |
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 be uint256
this._pauserRegistry(), | ||
zUint64("REWARDS_COORDINATOR_INIT_PAUSED_STATUS"), | ||
zAddress("REWARDS_COORDINATOR_UPDATER"), | ||
zUint64("REWARDS_COORDINATOR_ACTIVATION_DELAY"), |
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 be uint32
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.
does abi.encodeWithSelector
not check types? or is it just runtime downsizing implicitly
function testDeployAgain() public { | ||
_execute(); | ||
} |
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.
We should test that the new initialized variables are correct here (i.e the ones set in initialize
).
We should also test that the new storage variables added in Rewards v2 upgrade are now available.
Summary
Testing
Run tests with:
zeus test --verbose script/releases/release-template/*.s.sol --env preprod