-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testnet Rewards Coordinator Upgrade Script (#742)
* feat: testnet rc upgrade * test: add hopper validation * feat: dep script with sanity check * chore: update RC implementation
- Loading branch information
Showing
7 changed files
with
179 additions
and
62 deletions.
There are no files selected for viewing
58 changes: 0 additions & 58 deletions
58
script/configs/holesky/Deploy_RewardsCoordinator.holesky.config.json
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"lastUpdated": "v0.4.3-rewards-incentives", | ||
"chainInfo": { | ||
"chainId": 17000 | ||
}, | ||
"multisig_addresses": { | ||
"pauserMultisig": "0x53410249ec7d3a3F9F1ba3912D50D6A3Df6d10A7", | ||
"communityMultisig": "0xCb8d2f9e55Bc7B1FA9d089f9aC80C583D2BDD5F7", | ||
"operationsMultisig": "0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d", | ||
"executorMultisig": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", | ||
"timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" | ||
}, | ||
"strategies": { | ||
"numStrategies": 0, | ||
"MAX_PER_DEPOSIT": 115792089237316195423570985008687907853269984665640564039457584007913129639935, | ||
"MAX_TOTAL_DEPOSITS": 115792089237316195423570985008687907853269984665640564039457584007913129639935, | ||
"strategiesToDeploy": [] | ||
}, | ||
"strategyManager": { | ||
"init_strategy_whitelister": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", | ||
"init_paused_status": 0 | ||
}, | ||
"delegationManager": { | ||
"init_paused_status": 0, | ||
"init_minWithdrawalDelayBlocks": 10 | ||
}, | ||
"rewardsCoordinator": { | ||
"init_paused_status": 0, | ||
"CALCULATION_INTERVAL_SECONDS": 604800, | ||
"MAX_REWARDS_DURATION": 6048000, | ||
"MAX_RETROACTIVE_LENGTH": 7776000, | ||
"MAX_FUTURE_LENGTH": 2592000, | ||
"GENESIS_REWARDS_TIMESTAMP": 1710979200, | ||
"rewards_updater_address": "0x18a0f92Ad9645385E8A8f3db7d0f6CF7aBBb0aD4", | ||
"activation_delay": 7200, | ||
"calculation_interval_seconds": 604800, | ||
"global_operator_commission_bips": 1000 | ||
}, | ||
"avsDirectory": { | ||
"init_paused_status": 0 | ||
}, | ||
"slasher": { | ||
"init_paused_status": 0 | ||
}, | ||
"eigenPod": { | ||
"MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR": 32000000000, | ||
"GENESIS_TIME": 1695902400 | ||
}, | ||
"eigenPodManager": { | ||
"init_paused_status": 0 | ||
}, | ||
"delayedWithdrawalRouter": { | ||
"init_paused_status": 0, | ||
"init_withdrawalDelayBlocks": 10 | ||
}, | ||
"ethPOSDepositAddress": "0x4242424242424242424242424242424242424242" | ||
} |
This file contains 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
This file contains 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
This file contains 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
117 changes: 117 additions & 0 deletions
117
script/deploy/holesky/v042-upgrade_testnet_rewardsCoordinator.s.sol
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.12; | ||
|
||
import "./Deploy_Test_RewardsCoordinator.s.sol"; | ||
import "script/utils/TimelockEncoding.sol"; | ||
|
||
/** | ||
* @notice Script used for the first deployment of EigenLayer core contracts to Holesky | ||
* anvil --fork-url $RPC_HOLESKY | ||
* | ||
* Holesky testnet: Deploy/Upgrade RewardsCoordinator | ||
* forge script script/deploy/holesky/v042-upgrade_testnet_rewardsCoordinator.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv --verify --etherscan-api-key $ETHERSCAN_API_KEY | ||
* | ||
*/ | ||
contract Upgrade_Testnet_RewardsCoordinator is Deploy_Test_RewardsCoordinator, TimelockEncoding { | ||
function run() external virtual override { | ||
_parseInitialDeploymentParams("script/configs/holesky/eigenlayer_testnet.config.json"); | ||
_parseDeployedContracts("script/configs/holesky/eigenlayer_addresses_testnet.config.json"); | ||
|
||
RewardsCoordinator oldRewardsCoordinator = rewardsCoordinatorImplementation; | ||
|
||
// Deploy Rewards Coordinator | ||
vm.startBroadcast(); | ||
rewardsCoordinatorImplementation = new RewardsCoordinator( | ||
delegationManager, | ||
strategyManager, | ||
REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS, | ||
REWARDS_COORDINATOR_MAX_REWARDS_DURATION, | ||
REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH, | ||
REWARDS_COORDINATOR_MAX_FUTURE_LENGTH, | ||
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP | ||
); | ||
vm.stopBroadcast(); | ||
|
||
_sanityCheckImplementations(oldRewardsCoordinator, rewardsCoordinatorImplementation); | ||
|
||
emit log_named_address("Rewards Coordinator Implementation", address(rewardsCoordinatorImplementation)); | ||
|
||
// Create Upgrade Tx via Community Multisig | ||
bytes memory calldata_to_proxy_admin = abi.encodeWithSelector( | ||
ProxyAdmin.upgrade.selector, | ||
TransparentUpgradeableProxy(payable(address(rewardsCoordinator))), | ||
rewardsCoordinatorImplementation | ||
); | ||
|
||
bytes memory final_calldata_to_executor_multisig = encodeForExecutor( | ||
communityMultisig, //from | ||
address(eigenLayerProxyAdmin), //to | ||
0, // value | ||
calldata_to_proxy_admin, // data | ||
ISafe.Operation.Call // operation | ||
); | ||
|
||
// Simulate Transaction | ||
vm.prank(communityMultisig); | ||
(bool success, ) = address(executorMultisig).call(final_calldata_to_executor_multisig); | ||
require(success, "Transaction failed"); | ||
|
||
// Sanity Checks | ||
_verifyContractPointers(); | ||
_verifyImplementations(); | ||
_verifyContractsInitialized(); | ||
_verifyInitializationParams(); | ||
} | ||
|
||
function _sanityCheckImplementations(RewardsCoordinator oldRc, RewardsCoordinator newRc) internal { | ||
// Verify configs between both rewardsCoordinatorImplementations | ||
assertEq( | ||
address(oldRc.delegationManager()), | ||
address(newRc.delegationManager()), | ||
"DM mismatch" | ||
); | ||
assertEq( | ||
address(oldRc.strategyManager()), | ||
address(newRc.strategyManager()), | ||
"SM mismatch" | ||
); | ||
assertEq( | ||
oldRc.CALCULATION_INTERVAL_SECONDS(), | ||
newRc.CALCULATION_INTERVAL_SECONDS(), | ||
"CALCULATION_INTERVAL_SECONDS mismatch" | ||
); | ||
assertEq( | ||
oldRc.MAX_REWARDS_DURATION(), | ||
newRc.MAX_REWARDS_DURATION(), | ||
"MAX_REWARDS_DURATION mismatch" | ||
); | ||
assertEq( | ||
oldRc.MAX_RETROACTIVE_LENGTH(), | ||
newRc.MAX_RETROACTIVE_LENGTH(), | ||
"MAX_RETROACTIVE_LENGTH mismatch" | ||
); | ||
assertEq( | ||
oldRc.MAX_FUTURE_LENGTH(), | ||
newRc.MAX_FUTURE_LENGTH(), | ||
"MAX_FUTURE_LENGTH mismatch" | ||
); | ||
assertEq( | ||
oldRc.GENESIS_REWARDS_TIMESTAMP(), | ||
newRc.GENESIS_REWARDS_TIMESTAMP(), | ||
"GENESIS_REWARDS_TIMESTAMP mismatch" | ||
); | ||
} | ||
|
||
function setRewardForAllSubmitter() external { | ||
address hopper; | ||
|
||
require(hopper != address(0), "Hopper address is not set"); | ||
|
||
// Set reward for all submitters | ||
vm.startBroadcast(); | ||
rewardsCoordinator.setRewardsForAllSubmitter(hopper, true); | ||
vm.stopBroadcast(); | ||
|
||
require(rewardsCoordinator.isRewardsForAllSubmitter(hopper), "Hopper is not set as rewards for all submitter"); | ||
} | ||
} |