feat(UpgradeUSDat): route USDat upgrade through SaturnTimelock#3
Open
PierrickGT wants to merge 1 commit into
Open
Conversation
The USDat ProxyAdmin was handed to SaturnTimelock at block 25,284,032, so broadcasting Upgrades.upgradeProxy as the owner EOA now reverts: ProxyAdmin.upgradeAndCall is onlyOwner and the owner is the timelock. Replace the single-shot script with the real flow. ProposeUSDatUpgrade deploys the implementation and schedules the upgrade as the proposer; ExecuteUSDatUpgrade executes it once the 5-day delay matures, from any EOA since EXECUTOR_ROLE is held by address(0). Both scripts build the payload via UpgradeUSDatBase so their operation ids match. Propose dry-runs the exact scheduled bytes as the timelock before broadcasting: scheduling only stores inert calldata, so a broken payload would otherwise surface after the full delay had already elapsed. Drop the claimYield() pre-call. migrate() already calls stopEarning() and mints any surplus to the yield recipient, which is what absorbs the yield accruing across the delay. Move the fork test to block 25,284,032, the first block under timelock ownership, and model schedule -> warp -> execute. The same handover moved the token's DEFAULT_ADMIN_ROLE to the timelock, so the proposer EOA no longer holds it. BREAKING CHANGE: `make upgrade-local` and `make upgrade-mainnet` are replaced by `make propose-upgrade` and `make execute-upgrade`, and PROXY_ADMIN_OWNER_PRIVATE_KEY by PROPOSER_PRIVATE_KEY plus NEW_IMPLEMENTATION. See .env.example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The USDat ProxyAdmin was handed to SaturnTimelock at block 25,284,032, so broadcasting Upgrades.upgradeProxy as the owner EOA now reverts: ProxyAdmin.upgradeAndCall is onlyOwner and the owner is the timelock.
Replace the single-shot script with the real flow. ProposeUSDatUpgrade deploys the implementation and schedules the upgrade as the proposer; ExecuteUSDatUpgrade executes it once the 5-day delay matures, from any EOA since EXECUTOR_ROLE is held by address(0).
Both scripts build the payload via UpgradeUSDatBase so their operation ids match. Propose dry-runs the exact scheduled bytes as the timelock before broadcasting: scheduling only stores inert calldata, so a broken payload would otherwise surface after the full delay had already elapsed.
Drop the claimYield() pre-call. migrate() already calls stopEarning() and mints any surplus to the yield recipient, which is what absorbs the yield accruing across the delay.
Move the fork test to block 25,284,032, the first block under timelock ownership, and model schedule -> warp -> execute. The same handover moved the token's DEFAULT_ADMIN_ROLE to the timelock, so the proposer EOA no longer holds it.