Skip to content

Commit

Permalink
feat: testnet rc upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
ypatil12 committed Sep 12, 2024
1 parent decf99c commit 257a026
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 62 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"lastUpdated": "v0.4.3-rewards-incentives",
"addresses": {
"avsDirectory": "0x055733000064333CaDDbC92763c58BF0192fFeBf",
"avsDirectoryImplementation": "0xEF5BA995Bc7722fd1e163edF8Dc09375de3d3e3a",
Expand Down Expand Up @@ -58,7 +59,7 @@
"bEIGENImpl": "0x4500927874Ad41538c1bEF2F5278E7a86DF6bce8",
"eigenStrategy": "0x43252609bff8a13dFe5e057097f2f45A24387a84",
"eigenStrategyImpl": "0x94650e09a471CEF96e7966cabf26718FBf352697"
}
},
},
"chainInfo": {
"chainId": 17000,
Expand Down
57 changes: 57 additions & 0 deletions script/configs/holesky/eigenlayer_testnet.config.json
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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import "./Deploy_Test_RewardsCoordinator.s.sol";
*/
contract Deploy_Preprod_RewardsCoordinator is Deploy_Test_RewardsCoordinator {
function run(string memory deployArg) external virtual {
_parseInitialDeploymentParams("script/configs/holesky/Deploy_RewardsCoordinator.holesky.config.json");
_parseInitialDeploymentParams("script/configs/holesky/eigenlayer_preprod.config.json");
_parseDeployedContracts("script/output/holesky/M2_deploy_preprod.output.json");

// Overwrite testAddress and multisigs to be EOAowner
Expand Down
2 changes: 1 addition & 1 deletion script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ contract Deploy_Test_RewardsCoordinator is ExistingDeploymentParser {
address initOwner = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479;

function run() external virtual {
_parseInitialDeploymentParams("script/configs/holesky/Deploy_RewardsCoordinator.holesky.config.json");
_parseInitialDeploymentParams("script/configs/holesky/eigenlayer_testnet.config.json");
_parseDeployedContracts("script/configs/holesky/eigenlayer_addresses.config.json");

// START RECORDING TRANSACTIONS FOR DEPLOYMENT
Expand Down
2 changes: 1 addition & 1 deletion script/deploy/holesky/v040-holesky-pepe.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ contract PEPE_Deploy_Preprod is ExistingDeploymentParser {

function run() external virtual {
_parseInitialDeploymentParams(
"script/configs/holesky/Deploy_RewardsCoordinator.holesky.config.json"
"script/configs/holesky/eigenlayer_preprod.config.json"
);
_parseDeployedContracts(
"script/configs/holesky/eigenlayer_addresses.config.json"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// 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
*
*/
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");

// 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();

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 setRewardForAllSubmitter() external {
address hopper;

require(hopper != address(0), "Hopper address is not set");

// Set reward for all submitters
vm.startBroadcast();
rewardsCoordinator.setRewardForAllSubmitter(hopper);
vm.stopBroadcast();
}
}

0 comments on commit 257a026

Please sign in to comment.