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

feat: rewards v2 upgrade script #888

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

feat: rewards v2 upgrade script #888

wants to merge 2 commits into from

Conversation

jbrower95
Copy link
Contributor

@jbrower95 jbrower95 commented Nov 13, 2024

Summary

  • Rewards V2 will be deployed using Zeus, across all environments.
  • All deploy parameters and contract addresses are injected via Zeus.

Testing

Run tests with:
image
zeus test --verbose script/releases/release-template/*.s.sol --env preprod

@jbrower95 jbrower95 changed the title [RFC] Rewards V2 Protocol Upgrade wip: rewards v2 upgrade script Nov 13, 2024
@jbrower95 jbrower95 changed the title wip: rewards v2 upgrade script feat: rewards v2 upgrade script Nov 19, 2024
@jbrower95 jbrower95 force-pushed the jb/rewards-v2 branch 2 times, most recently from 7cf6917 to c36c54a Compare November 20, 2024 21:15
foundry.toml Show resolved Hide resolved
}

function testDeploy() virtual public {
_execute();
Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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();
Copy link
Contributor

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.

Copy link
Contributor Author

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",
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep good call

Copy link
Collaborator

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 {
Copy link
Contributor

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));
Copy link
Contributor

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?

Copy link
Contributor

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"),
Copy link
Contributor

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"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be uint32

Copy link
Contributor Author

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

Comment on lines 33 to 35
function testDeployAgain() public {
_execute();
}
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants