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: from scratch scripts #335

Open
wants to merge 49 commits into
base: feat/slashing-release-branch
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
a1295fa
fix: withdrawal delay check
stevennevins Dec 12, 2024
7b1fddb
feat: from scratch script
stevennevins Dec 13, 2024
5d25124
refactor: separate reading config, deployment, and upgrade
stevennevins Dec 13, 2024
2ff4b4f
fix: add operator set strategies (#334)
stevennevins Dec 13, 2024
241a0c6
Merge branch 'feat/slashing-release-branch' into fix/slashing-release…
stevennevins Dec 13, 2024
337927b
Merge branch 'feat/slashing-release-branch' into fix/slashing-release…
stevennevins Dec 13, 2024
fe25cff
Merge branch 'feat/slashing-release-branch' into fix/slashing-release…
stevennevins Dec 13, 2024
8dc722f
test: fix test for DM withdrawal delay blocks
stevennevins Dec 13, 2024
105a06a
Merge branch 'feat/slashing-release-branch' into feat/slashing-scripts
stevennevins Dec 13, 2024
b06bb08
chore: update all pragmas to 0.8.27 (#336)
stevennevins Dec 13, 2024
94095f6
feat: custom require errors for registry coordinator (#337)
stevennevins Dec 13, 2024
877f0f8
Merge branch 'fix/slashing-release-branch-1' into feat/slashing-scripts
stevennevins Dec 13, 2024
ae145ad
Merge branch 'feat/slashing-release-branch' into feat/slashing-scripts
stevennevins Dec 16, 2024
c57bd17
Merge branch 'feat/slashing-release-branch' into feat/slashing-scripts
stevennevins Dec 16, 2024
bc64bb2
feat: add zeus output json and update parsing of addresses
stevennevins Dec 16, 2024
09de571
test: parsing zeus output
stevennevins Dec 16, 2024
b1111e0
feat: add from scratch functionality and read zeus config
stevennevins Dec 16, 2024
76de952
feat: update forge-std
stevennevins Dec 16, 2024
3b354dd
feat: scripts from scratch and prepod parsed json
stevennevins Dec 16, 2024
474a024
feat: helper lib for scripts to initialize state in test avs
stevennevins Dec 16, 2024
d2e8e31
feat: helper scripts for setting up operators
stevennevins Dec 17, 2024
b0b59e0
feat: add signing
stevennevins Dec 17, 2024
87d906d
test: add test for library
stevennevins Dec 17, 2024
35e676e
chore: remove comments
stevennevins Dec 17, 2024
bdf4f67
feat: improve ux of library
stevennevins Dec 17, 2024
815051f
feat: add remaining functions
stevennevins Dec 17, 2024
98b678f
test: operator functionality on preprod
stevennevins Dec 18, 2024
b54d400
test: register operator to operator set
stevennevins Dec 18, 2024
f9c8ee8
feat: add calculatePubkeyRegistrationMessageHash
stevennevins Dec 18, 2024
bb05b30
test: update quorum
stevennevins Dec 18, 2024
137d988
test: add e2e test for migration and slash
stevennevins Dec 18, 2024
3647e94
fix: misc getRestakeable strategies
stevennevins Dec 18, 2024
bd07f1d
chore: rename for clarity
stevennevins Dec 18, 2024
d96ad5c
chore: revert forge-std change
stevennevins Dec 18, 2024
e062196
chore: bump forge-std
stevennevins Dec 18, 2024
c270cbd
Merge branch 'feat/slashing-release-branch' into feat/slashing-scripts
stevennevins Dec 18, 2024
3d4b0b8
chore: update logging
stevennevins Dec 19, 2024
0c912a5
chore: refactor scripts to remove --via-ir need
stevennevins Dec 19, 2024
5587b67
Merge branch 'feat/slashing-release-branch' into feat/slashing-scripts
stevennevins Jan 9, 2025
df00071
Merge branch 'feat/slashing-release-branch' into feat/slashing-scripts
stevennevins Jan 15, 2025
ccebfcf
chore: refactor so via-ir not needed in e2e
stevennevins Jan 15, 2025
c3d1dac
chore: naming for CI pattern
stevennevins Jan 15, 2025
98f38d7
chore: nitt
stevennevins Jan 15, 2025
f2b2a44
fix: param on script
stevennevins Jan 15, 2025
d990a9e
chore: refactor out the proxyAdmin from config
stevennevins Jan 16, 2025
891b779
fix: ci with no match
stevennevins Jan 16, 2025
fe1313e
fix: ci ignore fork test and ffi
stevennevins Jan 16, 2025
5261bfa
feat: more ergonomic upgrade script
stevennevins Jan 16, 2025
b51ba83
chore: move file, add note, and parameterize chain
stevennevins Jan 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ jobs:
- name: Run Forge build
run: |
forge --version
forge build --sizes
forge build --sizes --skip script --skip test --via-ir
stevennevins marked this conversation as resolved.
Show resolved Hide resolved
id: build

- name: Run tests
shell: bash
run: |
forge test --no-match-contract FFI
forge test --no-match-contract FFI --via-ir

env:
RPC_MAINNET: ${{ secrets.RPC_MAINNET }}
Expand Down
6 changes: 6 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ via_ir = false
# Override the Solidity version (this overrides `auto_detect_solc`)
solc_version = '0.8.27'

[rpc_endpoints]
mainnet = "${MAINNET_RPC_URL}"
holesky = "${HOLESKY_RPC_URL}"
sepolia = "${SEPOLIA_RPC_URL}"
anvil = "${ANVIL_RPC_URL}"

[etherscan]
mainnet = { key = "${ETHERSCAN_API_KEY}" }
holesky = { key = "${ETHERSCAN_API_KEY}" }
Expand Down
87 changes: 87 additions & 0 deletions script/DeployMiddleware.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.12;

import {Script} from "forge-std/Script.sol";
import {console2 as console} from "forge-std/Test.sol";
import {UpgradeableProxyLib} from "./utils/UpgradeableProxyLib.sol";
import {CoreDeploymentLib} from "./utils/CoreDeploymentLib.sol";
import {MiddlewareDeploymentLib} from "./utils/MiddlewareDeploymentLib.sol";

contract DeployMiddleware is Script {
CoreDeploymentLib.DeploymentData internal core;
MiddlewareDeploymentLib.ConfigData internal config;
MiddlewareDeploymentLib.DeploymentData internal middlewareDeployment;
address internal deployer;

function setUp() public {
deployer = vm.rememberKey(vm.envUint("HOLESKY_PRIVATE_KEY"));
vm.label(deployer, "Deployer");

// Read core deployment data from json
core = CoreDeploymentLib.readCoreDeploymentJson("./script/config", 17000, "preprod");

config.admin = deployer;
config.numQuorums = 1;

uint256[] memory operatorParams = new uint256[](6);
operatorParams[0] = 10000; // maxOperatorCount for quorum 0
ypatil12 marked this conversation as resolved.
Show resolved Hide resolved
operatorParams[1] = 2000; // kickBIPsOfOperatorStake for quorum 0 (20%)
operatorParams[2] = 500; // kickBIPsOfTotalStake for quorum 0 (5%)
operatorParams[3] = 10000; // maxOperatorCount for quorum 1
operatorParams[4] = 2000; // kickBIPsOfOperatorStake for quorum 1 (20%)
operatorParams[5] = 500; // kickBIPsOfTotalStake for quorum 1 (5%)
config.operatorParams = operatorParams;
}

function run() external {
vm.startBroadcast(deployer);

/// TODO: Pass proxy admin instead of config
stevennevins marked this conversation as resolved.
Show resolved Hide resolved
config.proxyAdmin = UpgradeableProxyLib.deployProxyAdmin();
middlewareDeployment = MiddlewareDeploymentLib.deployContracts(core, config);

labelContracts(core, middlewareDeployment);

MiddlewareDeploymentLib.upgradeContracts(middlewareDeployment, config, core);

logDeploymentDetails(middlewareDeployment);

vm.stopBroadcast();
}

function logDeploymentDetails(MiddlewareDeploymentLib.DeploymentData memory result) internal pure {
console.log("Deployment completed");
console.log("ServiceManager:", result.serviceManager);
console.log("RegistryCoordinator:", result.registryCoordinator);
console.log("BLSApkRegistry:", result.blsapkRegistry);
console.log("IndexRegistry:", result.indexRegistry);
console.log("StakeRegistry:", result.stakeRegistry);
console.log("OperatorStateRetriever:", result.operatorStateRetriever);
console.log("Token:", result.token);
console.log("Strategy:", result.strategy);
}

function labelContracts(CoreDeploymentLib.DeploymentData memory coreData, MiddlewareDeploymentLib.DeploymentData memory middlewareData) internal {
// Label core contracts
vm.label(coreData.delegationManager, "DelegationManager");
vm.label(coreData.avsDirectory, "AVSDirectory");
vm.label(coreData.strategyManager, "StrategyManager");
vm.label(coreData.eigenPodManager, "EigenPodManager");
vm.label(coreData.rewardsCoordinator, "RewardsCoordinator");
vm.label(coreData.eigenPodBeacon, "EigenPodBeacon");
vm.label(coreData.pauserRegistry, "PauserRegistry");
vm.label(coreData.strategyFactory, "StrategyFactory");
vm.label(coreData.strategyBeacon, "StrategyBeacon");

// Label middleware contracts
vm.label(middlewareData.registryCoordinator, "RegistryCoordinator");
vm.label(middlewareData.serviceManager, "ServiceManager");
vm.label(middlewareData.operatorStateRetriever, "OperatorStateRetriever");
vm.label(middlewareData.blsapkRegistry, "BLSApkRegistry");
vm.label(middlewareData.indexRegistry, "IndexRegistry");
vm.label(middlewareData.stakeRegistry, "StakeRegistry");
vm.label(middlewareData.strategy, "Strategy");
vm.label(middlewareData.token, "Token");
vm.label(middlewareData.pauserRegistry, "PauserRegistry");
}
}
1 change: 1 addition & 0 deletions script/config/17000-preprod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ZEUS_ENV":"preprod","ZEUS_ENV_COMMIT":"26dcafff7bd304b84f81ba36fe70ef44d414a752","ZEUS_TEST":"false","ZEUS_ENV_VERSION":"1.0.0","ZEUS_VERSION":"0.3.0","ZEUS_ENV_communityMultisig":"0x42789cCdE6486b81c7D41Fa3759A8BB74D7909DB","ZEUS_ENV_executorMultisig":"0x84E5e0D6f6c3153057bd5d661Be1ff1766cEac08","ZEUS_ENV_protocolCouncilMultisig":"0x314A6B61B5CBFA79dc7b2c0416e039822E886b54","ZEUS_ENV_operationsMultisig":"0x6d609cD2812bDA02a75dcABa7DaafE4B20Ff5608","ZEUS_ENV_pauserMultisig":"0x546D3b66B27dCb94777d7eFC3825b10675FE5D95","ZEUS_ENV_pauserRegistry":"0x9Ab2FEAf0465f0eD51Fc2b663eF228B418c9Dad1","ZEUS_ENV_proxyAdmin":"0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B","ZEUS_ENV_timelockController":"0x7c66A1e862E11C4887270aBd649157ACe837A2D0","ZEUS_ENV_timelockController_BEIGEN":"0x68fa0fB9eDe34745C41d85E2766ee32eBc6cEF0e","ZEUS_ENV_beigenExecutorMultisig":"0xFbb2c01A19A85c4C648186a97d879EEA25cE1397","ZEUS_ENV_foundationMultisig":"0x9c36f012585c8bb4247eEe18C01Cdfc5f2e90336","ZEUS_ENV_ethPOS":"0x4242424242424242424242424242424242424242","ZEUS_ENV_MultiSendCallOnly":"0x40A2aCCbd92BCA938b02010E17A5b8929b49130D","ZEUS_ENV_MIN_WITHDRAWAL_DELAY":50,"ZEUS_ENV_ALLOCATION_CONFIGURATION_DELAY":75,"ZEUS_ENV_EIGENPOD_GENESIS_TIME":1695902400,"ZEUS_ENV_REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS":86400,"ZEUS_ENV_REWARDS_COORDINATOR_MAX_REWARDS_DURATION":6048000,"ZEUS_ENV_REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH":7776000,"ZEUS_ENV_REWARDS_COORDINATOR_MAX_FUTURE_LENGTH":2592000,"ZEUS_ENV_REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP":1710979200,"ZEUS_ENV_REWARDS_COORDINATOR_INIT_PAUSED_STATUS":0,"ZEUS_ENV_REWARDS_COORDINATOR_UPDATER":"0x18a0f92Ad9645385E8A8f3db7d0f6CF7aBBb0aD4","ZEUS_ENV_REWARDS_COORDINATOR_ACTIVATION_DELAY":120,"ZEUS_ENV_REWARDS_COORDINATOR_DEFAULT_OPERATOR_SPLIT_BIPS":1000,"ZEUS_ENV_REWARDS_COORDINATOR_PAUSE_STATUS":2,"ZEUS_DEPLOYED_PauserRegistry_Impl":"0x50712285cE831a6B9a11214A430f28999A5b4DAe","ZEUS_DEPLOYED_AVSDirectory_Proxy":"0x141d6995556135D4997b2ff72EB443Be300353bC","ZEUS_DEPLOYED_AVSDirectory_Impl":"0xD5597C5c574BbD4Ce76C3aaF2900525De97aD711","ZEUS_DEPLOYED_EigenPod_Beacon":"0x92Cc4a800A1513E85C481dDDf3A06C6921211eaC","ZEUS_DEPLOYED_EigenPod_Impl":"0xf53F78382a26b62A3aC3a3837a8dED2044a2103D","ZEUS_DEPLOYED_EigenPodManager_Proxy":"0xB8d8952f572e67B11e43bC21250967772fa883Ff","ZEUS_DEPLOYED_EigenPodManager_Impl":"0xe55A9EA92b1134afF44fB81e667FD5f74e6a47e5","ZEUS_DEPLOYED_DelegationManager_Proxy":"0x75dfE5B44C2E530568001400D3f704bC8AE350CC","ZEUS_DEPLOYED_DelegationManager_Impl":"0xa61d360551d05715046491eEc8a8Cb90f6867545","ZEUS_DEPLOYED_RewardsCoordinator_Proxy":"0xb22Ef643e1E067c994019A4C19e403253C05c2B0","ZEUS_DEPLOYED_RewardsCoordinator_Impl":"0x480e9045F62F20b8B8342164011305f223D48B2b","ZEUS_DEPLOYED_EigenStrategy_Proxy":"0x4e0125f8a928Eb1b9dB4BeDd3756BA3c200563C2","ZEUS_DEPLOYED_EigenStrategy_Impl":"0xdB01e5178E4745346B230fdF2d6Da2F483a71EA4","ZEUS_DEPLOYED_Eigen_Proxy":"0xD58f6844f79eB1fbd9f7091d05f7cb30d3363926","ZEUS_DEPLOYED_Eigen_Impl":"0x95a7431400F362F3647a69535C5666cA0133CAA0","ZEUS_DEPLOYED_BackingEigen_Proxy":"0xA72942289a043874249E60469F68f08B8c6ECCe8","ZEUS_DEPLOYED_BackingEigen_Impl":"0xd5FdabDac3d8ACeAB7BFfDDFA18877A4c5D5Aa82","ZEUS_DEPLOYED_StrategyBase_Beacon":"0xf2c2AcA859C685895E60ca7A14274365b64c0c2a","ZEUS_DEPLOYED_StrategyBase_Impl":"0x3Dc582A90b920AA6aa0204e0517d6767C9C8c268","ZEUS_DEPLOYED_StrategyManager_Proxy":"0xF9fbF2e35D8803273E214c99BF15174139f4E67a","ZEUS_DEPLOYED_StrategyManager_Impl":"0x158E6FBFb5FAc98894BF0Da28998efcB3Ba1C58A","ZEUS_DEPLOYED_StrategyFactory_Proxy":"0xad4a89e3ca9b3dc25aabe0aa7d72e61d2ec66052","ZEUS_DEPLOYED_StrategyFactory_Impl":"0x203654Ea1e39d00983A9cE0457B2d2efC188fC40","ZEUS_DEPLOYED_StrategyBaseTVLLimits_Impl":"0x98bD5748dc964e85400B3A5D0152c444201C577a","ZEUS_DEPLOYED_PermissionController_Impl":"0x259597c0AEc3c9978D24e892225f2F4Ac142d885","ZEUS_DEPLOYED_PermissionController_Proxy":"0xa2348c77802238Db39f0CefAa500B62D3FDD682b","ZEUS_DEPLOYED_AllocationManager_Impl":"0xc7618DC8607503C15f4393782068B79655104A24","ZEUS_DEPLOYED_AllocationManager_Proxy":"0xFdD5749e11977D60850E06bF5B13221Ad95eb6B4","ZEUS_DEPLOYED_StrategyBaseTVLLimits_0":"0x6e5d5060b33ca2090a78e9cb74fe207453b30e49","ZEUS_DEPLOYED_StrategyBaseTVLLimits_1":"0xf6a09ae03d7760aecf1626ce7df0f113bec2d9bd","ZEUS_DEPLOYED_StrategyBaseTVLLimits_2":"0x7fa77c321bf66e42eabc9b10129304f7f90c5585","ZEUS_DEPLOYED_StrategyBaseTVLLimits_3":"0x24da526f9e465c4fb6bae41e226df8aa5b34eac7","ZEUS_DEPLOYED_StrategyBaseTVLLimits_4":"0x6dc6ce589f852f96ac86cb160ab0b15b9f56dedd","ZEUS_DEPLOYED_StrategyBaseTVLLimits_5":"0x3c28437e610fb099cc3d6de4d9c707dfacd308ae","ZEUS_DEPLOYED_StrategyBaseTVLLimits_6":"0x7b6257f5caf7311b36f7416133a8499c68a83c3a","ZEUS_DEPLOYED_StrategyBaseTVLLimits_7":"0xc86382179500e8ed3e686fc4a99ed9ec72df3f56","ZEUS_DEPLOYED_StrategyBaseTVLLimits_8":"0x3cb1fd19cfb178c1098f2fc1e11090a0642b2314","ZEUS_DEPLOYED_StrategyBaseTVLLimits_9":"0x87f6c7d24b109919eb38295e3f8298425e6331d9","ZEUS_DEPLOYED_StrategyBaseTVLLimits_10":"0x5c8b55722f421556a2aafb7a3ea63d4c3e514312","ZEUS_DEPLOYED_StrategyBaseTVLLimits_11":"0xd523267698c81a372191136e477fdebfa33d9fb4"}
stevennevins marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading