From e870331df0ca67459f70b7c2061e9acfe206e5c5 Mon Sep 17 00:00:00 2001 From: wadealexc Date: Wed, 14 Aug 2024 15:24:00 +0000 Subject: [PATCH] feat: wip refactor of deploy scripts --- release/DeployAll.s.sol | 10 ++ release/README.md | 32 +++++ release/config/holesky.json | 0 release/config/mainnet.json | 5 + release/config/preprod.json | 115 ++++++++++++++++++ release/scripts/preprod-ddf5gh.s.sol | 31 +++++ .../eigenlayer_addresses_preprod.config.json | 54 ++++---- .../holesky/eigenlayer_preprod.config.json | 31 +---- .../mainnet/M1_deploy_mainnet.config.json | 61 ---------- 9 files changed, 224 insertions(+), 115 deletions(-) create mode 100644 release/DeployAll.s.sol create mode 100644 release/README.md create mode 100644 release/config/holesky.json create mode 100644 release/config/mainnet.json create mode 100644 release/config/preprod.json create mode 100644 release/scripts/preprod-ddf5gh.s.sol delete mode 100644 script/configs/mainnet/M1_deploy_mainnet.config.json diff --git a/release/DeployAll.s.sol b/release/DeployAll.s.sol new file mode 100644 index 000000000..5fd5da67b --- /dev/null +++ b/release/DeployAll.s.sol @@ -0,0 +1,10 @@ +pragma solidity ^0.8.12; + +/** + * @notice Deploy the entire EigenLayer system to a target environment + * @dev This deploys the current branch's contracts + */ +contract DeployAll { + + // TODO +} \ No newline at end of file diff --git a/release/README.md b/release/README.md new file mode 100644 index 000000000..f629250c6 --- /dev/null +++ b/release/README.md @@ -0,0 +1,32 @@ +Use Cases: +1. Fork a current deployment on any network, given a config file + * Use - simulating upgrades/changes to a current deployment +2. Deploy entire system from the current branch to any network + * Use - integration tests (mainly want to deploy locally) +3. Easily deploy/upgrade _specific_ contracts on any ENV + * Use - writing deploy/upgrade scripts + * Note: this should also update that env's config with new addresses + +## Mock Command - Release/Upgrade Scripting + +``` +make release preprod +``` + +* Generates a script file (`preprod-.s.sol`) that automatically loads the config for the `preprod` environment +* `make release preprod --test preprod-.s.sol`: + * Run the script in "test mode", forking preprod locally via anvil and simulating the deploy and upgrade steps specified in the script. + * Aside from helpful console output, this should generate an output file (to a `.gitignored` directory) that shows what the new config values will be after running for real. +* `make release preprod --run preprod-.s.sol`: + * Run the script for real, submitting both deploy and upgrade transactions to preprod, then updating the preprod config with the new addresses + * If `holesky` or `mainnet` environments are used here, the `upgrade` step should generate multisig transactions that can be signed + +## Mock Command - Deploying + +``` +make deploy preprod +``` + +* Deploys the entire system to `preprod` using the `DeployAll` script +* Generates an output file that gives the config for this new system. This is generated to a `.gitignored` directory, but if moved into the `config` folder, it can become a named, usable environment + diff --git a/release/config/holesky.json b/release/config/holesky.json new file mode 100644 index 000000000..e69de29bb diff --git a/release/config/mainnet.json b/release/config/mainnet.json new file mode 100644 index 000000000..d83697778 --- /dev/null +++ b/release/config/mainnet.json @@ -0,0 +1,5 @@ +{ + "addresses": { + + } +} \ No newline at end of file diff --git a/release/config/preprod.json b/release/config/preprod.json new file mode 100644 index 000000000..1f5772432 --- /dev/null +++ b/release/config/preprod.json @@ -0,0 +1,115 @@ +{ + "environment": { + "chainid": 17000, + "name": "holesky-preprod", + "deployType": "EOA", + "upgradeType": "EOA" + }, + // Addresses for multisigs, pauser, etc + "admin": { + "communityMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "executorMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "operationsMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "pauserRegistry": "0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1", + "proxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B", + "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" + }, + // Addresses for core contracts + "addresses": { + "avsDirectory": { + "proxy": "0x141d6995556135D4997b2ff72EB443Be300353bC", + "impl": "0x357978adC03375BD6a3605DE055fABb84695d79A", + "config": { + "init_paused_status": 0 + } + }, + "delegationManager": { + "proxy": "0x75dfE5B44C2E530568001400D3f704bC8AE350CC", + "impl": "0x56E88cb4f0136fC27D95499dE4BE2acf47946Fa1", + "config": { + "init_paused_status": 0, + "init_minWithdrawalDelayBlocks": 10 + } + }, + "delayedWithdrawalRouter": { + "proxy": "0xC4BC46a87A67a531eCF7f74338E1FA79533334Fa", + "impl": "0x0011FA2c512063C495f77296Af8d195F33A8Dd38", + "config": { + "init_paused_status": 0, + "init_withdrawalDelayBlocks": 10 + } + }, + "eigenPod": { + "beacon": "0x92Cc4a800A1513E85C481dDDf3A06C6921211eaC", + "impl": "0x8Da4b953cbFb715624D98C0D2b4a7978462eFd38", + "config": { + "GENESIS_TIME": 1695902400 + } + }, + "eigenPodManager": { + "proxy": "0xB8d8952f572e67B11e43bC21250967772fa883Ff", + "impl": "0x10EBa780CCd9E5e9FFBe529C25046c076Be91048", + "config": { + "init_paused_status": 0 + } + }, + "rewardsCoordinator": { + "proxy": "0xb22Ef643e1E067c994019A4C19e403253C05c2B0", + "impl": "0x7C80B0d3aFBeF9Bbd03Aab72cD2d90a12c11D394", + "config": { + "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": 120, + "calculation_interval_seconds": 604800, + "global_operator_commission_bips": 1000 + } + }, + "slasher": { + "proxy": "0x12699471dF8dca329C76D72823B1b79d55709384", + "impl": "0x9460fCe11E1e0365419fa860599903B4E5097cf0", + "config": { + "init_paused_status": 0 + } + }, + "strategyManager": { + "proxy": "0xF9fbF2e35D8803273E214c99BF15174139f4E67a", + "impl": "0x1a26B23a004C512350d7Dd89056655A80b850199", + "config": { + "init_paused_status": 0, + "init_strategy_whitelister": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348" + } + } + }, + "strategies": { + "impl": "0x62450517EfA1CE60d79801daf8f95973865e8D40", + "config": { + "numStrategies": 0, + "MAX_PER_DEPOSIT": 115792089237316195423570985008687907853269984665640564039457584007913129639935, + "MAX_TOTAL_DEPOSITS": 115792089237316195423570985008687907853269984665640564039457584007913129639935, + }, + "addrs": [] + }, + "token": { + "bEIGEN": { + "proxy": "0xA72942289a043874249E60469F68f08B8c6ECCe8", + "impl": "0xd5FdabDac3d8ACeAB7BFfDDFA18877A4c5D5Aa82" + }, + "EIGEN": { + "proxy": "0xD58f6844f79eB1fbd9f7091d05f7cb30d3363926", + "impl": "0x95a7431400F362F3647a69535C5666cA0133CAA0" + }, + "eigenStrategy": { + "proxy": "0xdcCF401fD121d8C542E96BC1d0078884422aFAD2", + "impl": "0x59D13E7Fb0bC0e57c1fc6594ff701592A6e4dD2B" + } + }, + "misc": { + "beaconOracle": "0x4C116BB629bff7A8373c2378bBd919f8349B8f25", + "ethPOS": "0x4242424242424242424242424242424242424242" + } +} \ No newline at end of file diff --git a/release/scripts/preprod-ddf5gh.s.sol b/release/scripts/preprod-ddf5gh.s.sol new file mode 100644 index 000000000..96f64b71d --- /dev/null +++ b/release/scripts/preprod-ddf5gh.s.sol @@ -0,0 +1,31 @@ +pragma solidity ^0.8.12; + +import "src/*"; + +contract preprod_ddf5gh is DeploymentUtils { + + function deploy() external { + // Deploy contracts + EigenPod newPodImpl = new EigenPod( + cfg.ethPOS, + cfg.eigenPodManager.proxy, + cfg.eigenPod.GENESIS_TIME + ); + + EigenPodManager newPodManagerImpl = new EigenPodManager( + cfg.ethPOS, + cfg.eigenPod.beacon, + cfg.strategyManager.proxy, + cfg.slasher.proxy, + cfg.delegationManager.proxy + ); + + // Update preprod cfg + cfg.setImpl(EIGENPOD, address(newPodImpl)); + cfg.setImpl(EIGENPODMANAGER, address(newPodManagerImpl)); + } + + function upgrade() external { + cfg.upgradeImpl(EIGENPOD); + } +} \ No newline at end of file diff --git a/script/configs/holesky/eigenlayer_addresses_preprod.config.json b/script/configs/holesky/eigenlayer_addresses_preprod.config.json index b515f7abc..3ac12d3b5 100644 --- a/script/configs/holesky/eigenlayer_addresses_preprod.config.json +++ b/script/configs/holesky/eigenlayer_addresses_preprod.config.json @@ -1,37 +1,37 @@ { "addresses": { - "avsDirectory": "0x141d6995556135D4997b2ff72EB443Be300353bC", - "avsDirectoryImplementation": "0x357978adC03375BD6a3605DE055fABb84695d79A", + "avsDirectory": "", + "avsDirectoryImplementation": "", "baseStrategyImplementation": "0x62450517EfA1CE60d79801daf8f95973865e8D40", - "beaconOracle": "0x4C116BB629bff7A8373c2378bBd919f8349B8f25", - "delayedWithdrawalRouter": "0xC4BC46a87A67a531eCF7f74338E1FA79533334Fa", - "delayedWithdrawalRouterImplementation": "0x0011FA2c512063C495f77296Af8d195F33A8Dd38", - "delegationManager": "0x75dfE5B44C2E530568001400D3f704bC8AE350CC", - "delegationManagerImplementation": "0x56E88cb4f0136fC27D95499dE4BE2acf47946Fa1", - "eigenLayerPauserReg": "0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1", - "eigenLayerProxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B", - "eigenPodBeacon": "0x92Cc4a800A1513E85C481dDDf3A06C6921211eaC", - "eigenPodImplementation": "0x8Da4b953cbFb715624D98C0D2b4a7978462eFd38", - "eigenPodManager": "0xB8d8952f572e67B11e43bC21250967772fa883Ff", - "eigenPodManagerImplementation": "0x10EBa780CCd9E5e9FFBe529C25046c076Be91048", + "beaconOracle": "", + "delayedWithdrawalRouter": "", + "delayedWithdrawalRouterImplementation": "", + "delegationManager": "", + "delegationManagerImplementation": "", + "eigenLayerPauserReg": "", + "eigenLayerProxyAdmin": "", + "eigenPodBeacon": "", + "eigenPodImplementation": "", + "eigenPodManager": "", + "eigenPodManagerImplementation": "", "emptyContract": "0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2", - "rewardsCoordinator": "0xb22Ef643e1E067c994019A4C19e403253C05c2B0", - "rewardsCoordinatorImplementation": "0x7C80B0d3aFBeF9Bbd03Aab72cD2d90a12c11D394", - "slasher": "0x12699471dF8dca329C76D72823B1b79d55709384", - "slasherImplementation": "0x9460fCe11E1e0365419fa860599903B4E5097cf0", + "rewardsCoordinator": "", + "rewardsCoordinatorImplementation": "", + "slasher": "", + "slasherImplementation": "", "numStrategiesDeployed": 0, "strategies": {}, "strategyAddresses": [], - "strategyManager": "0xF9fbF2e35D8803273E214c99BF15174139f4E67a", - "strategyManagerImplementation": "0x1a26B23a004C512350d7Dd89056655A80b850199", + "strategyManager": "", + "strategyManagerImplementation": "", "token": { - "EIGEN": "0xD58f6844f79eB1fbd9f7091d05f7cb30d3363926", - "EIGENImpl": "0x95a7431400F362F3647a69535C5666cA0133CAA0", - "bEIGEN": "0xA72942289a043874249E60469F68f08B8c6ECCe8", - "bEIGENImpl": "0xd5FdabDac3d8ACeAB7BFfDDFA18877A4c5D5Aa82", - "eigenStrategy": "0xdcCF401fD121d8C542E96BC1d0078884422aFAD2", - "eigenStrategyImpl": "0x59D13E7Fb0bC0e57c1fc6594ff701592A6e4dD2B", - "tokenProxyAdmin": "0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B" + "EIGEN": "", + "EIGENImpl": "", + "bEIGEN": "", + "bEIGENImpl": "", + "eigenStrategy": "", + "eigenStrategyImpl": "", + "tokenProxyAdmin": "" } }, "chainInfo": { @@ -43,6 +43,6 @@ "executorMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", "operationsMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", "pauserMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", - "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" + "timelock": "" } } \ No newline at end of file diff --git a/script/configs/holesky/eigenlayer_preprod.config.json b/script/configs/holesky/eigenlayer_preprod.config.json index 7552f49f4..f8ae689f2 100644 --- a/script/configs/holesky/eigenlayer_preprod.config.json +++ b/script/configs/holesky/eigenlayer_preprod.config.json @@ -16,41 +16,18 @@ "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": 120, - "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" + "ethPOSDepositAddress": "" } \ No newline at end of file diff --git a/script/configs/mainnet/M1_deploy_mainnet.config.json b/script/configs/mainnet/M1_deploy_mainnet.config.json deleted file mode 100644 index e5b43e804..000000000 --- a/script/configs/mainnet/M1_deploy_mainnet.config.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "multisig_addresses": { - "communityMultisig": "0xFEA47018D632A77bA579846c840d5706705Dc598", - "operationsMultisig": "0xBE1685C81aA44FF9FB319dD389addd9374383e90", - "pauserMultisig": "0x5050389572f2d220ad927CcbeA0D406831012390", - "executorMultisig": "0x369e6F597e22EaB55fFb173C6d9cD234BD699111", - "timelock": "0xA6Db1A8C5a981d1536266D2a393c5F8dDb210EAF" - }, - "strategies": [ - { - "token_address": "0xBe9895146f7AF43049ca1c1AE358B0541Ea49704", - "token_name": "Coinbase Wrapped Staked ETH", - "token_symbol": "cbETH", - "max_per_deposit": 0, - "max_deposits": 0 - }, - { - "token_address": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84", - "token_name": "Liquid staked Ether 2.0", - "token_symbol": "stETH", - "max_per_deposit": 0, - "max_deposits": 0 - }, - { - "token_address": "0xae78736Cd615f374D3085123A210448E74Fc6393", - "token_name": "Rocket Pool ETH", - "token_symbol": "rETH", - "max_per_deposit": 0, - "max_deposits": 0 - } - ], - "strategyManager": - { - "init_paused_status": 0, - "init_withdrawal_delay_blocks": 50400 - }, - "eigenPod": - { - "PARTIAL_WITHDRAWAL_FRAUD_PROOF_PERIOD_BLOCKS": 50400, - "REQUIRED_BALANCE_WEI": "32000000000000000000" - }, - "eigenPodManager": - { - "max_pods": 0, - "init_paused_status": 30 - }, - "delayedWithdrawalRouter": - { - "init_paused_status": 0, - "init_withdrawal_delay_blocks": 50400 - }, - "slasher": - { - "init_paused_status": "115792089237316195423570985008687907853269984665640564039457584007913129639935" - }, - "delegation": - { - "init_paused_status": "115792089237316195423570985008687907853269984665640564039457584007913129639935" - }, - "ethPOSDepositAddress": "0x00000000219ab540356cBB839Cbe05303d7705Fa" - } \ No newline at end of file