From 8d7c5968381449ed44a02b0aab78d0a9994945e8 Mon Sep 17 00:00:00 2001 From: Yuri Tkachenko Date: Mon, 18 Mar 2024 15:54:09 +0100 Subject: [PATCH 1/7] feat: add sepolia setup --- README.md | 11 +++++--- configs/config_sepolia.py | 57 +++++++++++++++++++++++++++++++++++++++ network-config.yaml | 20 ++++++++++++++ 3 files changed, 85 insertions(+), 3 deletions(-) create mode 100644 configs/config_sepolia.py diff --git a/README.md b/README.md index 811401ee7..7ac71e729 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,8 @@ pipx install poetry==1.5.0 Ensure that poetry bin path is added to your `$PATH` env variable. Usually it's `$HOME/.local/bin` for most Unix-like systems. -This is a workaround related `brownie` deps `pyyaml` issue https://github.com/eth-brownie/brownie/issues/1701 +This is a workaround related `brownie` deps `pyyaml` issue + ```shell poetry run pip install "cython<3.0" pyyaml==5.4.1 --no-build-isolation ``` @@ -85,21 +86,23 @@ poetry shell ### Network setup By default, you should start composing new scripts and test using forked networks. -You have two forked networks to work with: +You have three forked networks to work with: - `mainnet-fork` - `goerli-fork` +- `sepolia-fork` To start new voting on the live networks you could proceed with: - `mainnet` - `goerli` +- `sepolia` >Note: you can't run tests on the live networks. In a typical weekly omnibus workflow, you need only `mainnet-fork` and `mainnet` networks. In case of large test campaign on Lido upgrades, -it also could be useful to go with `goerli` and `goerli-fork` testnets first. +it also could be useful to go with `goerli`/`sepolia` and `goerli-fork`/`sepolia-fork` testnets first. ### Environment variables setup @@ -121,12 +124,14 @@ provide the etherscan API token: ```bash export ETHERSCAN_TOKEN= ``` + To upload Markdown vote description for a new vote to IPFS you should provide the [web3.storage](https://web3.storage/tokens/) API token: ```bash export WEB3_STORAGE_TOKEN= ``` + See [here](utils/README.md#ipfs) to learn more Markdown description To skip events decoding while testing set the following var: diff --git a/configs/config_sepolia.py b/configs/config_sepolia.py new file mode 100644 index 000000000..45f6ce7f7 --- /dev/null +++ b/configs/config_sepolia.py @@ -0,0 +1,57 @@ +# Use this config as address book only +CHAIN_NETWORK_NAME = "sepolia" +# DAO +ARAGON_KERNEL = "0x6155bD199ECcc79Ff4e8B392f6cBD9c9874E8916" +LDO_TOKEN = "0xd06dF83b8ad6D89C86a187fba4Eae918d497BdCB" +# Standard (or forked) Aragon apps +ACL = "0x8A1AA86d35b2EE8C9369618E7D7b40000cCD3295" +AGENT = "0x32A0E5828B62AAb932362a4816ae03b860b65e83" +FINANCE = "0x75c7b1D23f1cad7Fb4D60281d7069E46440BC179" +VOTING = "0x39A0EbdEE54cB319f4F42141daaBDb6ba25D341A" +TOKEN_MANAGER = "0xC73cd4B2A7c1CBC5BF046eB4A7019365558ABF66" +# Our custom Aragon apps +LIDO = "0x3e3FE7dBc6B4C189E7128855dD526361c49b40Af" +LIDO_LEGACY_ORACLE = "0x3483c140EF7F2716460198Ff831a8e53F05F1606" +LIDO_NODE_OPERATORS_REGISTRY = "0x33d6E15047E8644F8DDf5CD05d202dfE587DA6E3" +# Aragon APM Repos +VOTING_REPO = "" +LIDO_LIDO_REPO = "" +LIDO_NODE_OPERATORS_REGISTRY_REPO = "" +LIDO_LEGACY_ORACLE_REPO = "" + +DEPOSIT_SECURITY_MODULE_V1 = "0x6885E36BFcb68CB383DfE90023a462C03BCB2AE5" +LIDO_DEPOSIT_SECURITY_MODULE = "0x6885E36BFcb68CB383DfE90023a462C03BCB2AE5" + +DUMMY_IMPL = "" + +LIDO_LOCATOR = "0x8f6254332f69557A72b0DA2D5F0Bc07d4CA991E7" +BURNER = "0x61Bb0Ef69262d5EF1cc2873cf61766751D99B699" +EXECUTION_LAYER_REWARDS_VAULT = "0x94B1B8e2680882f8652882e7F196169dE3d9a3B2" +HASH_CONSENSUS_FOR_AO = "0x758D8c3CE794b3Dfe3b3A3482B7eD33de2109D95" +ACCOUNTING_ORACLE = "0xd497Be005638efCf09F6BFC8DAFBBB0BB72cD991" +HASH_CONSENSUS_FOR_VEBO = "0x098a952BD200005382aEb3229e38ae39A7616F56" +LIDO_VALIDATORS_EXIT_BUS_ORACLE = "0x7637d44c9f2e9cA584a8B5D2EA493012A5cdaEB6" +ORACLE_REPORT_SANITY_CHECKER = "0xbac2A471443F18aC5C31078b96C5797A78fCc680" +LIDO_WITHDRAWAL_QUEUE = "0x1583C7b3f4C3B008720E6BcE5726336b0aB25fdd" +GATE_SEAL = "" +EIP712_STETH = "0x9726CA9AEFF4BC8FB8C084BdAbdB71608248E3f8" +WITHDRAWAL_VAULT = "0xDe7318Afa67eaD6d6bbC8224dfCe5ed6e4b86d76" +STAKING_ROUTER = "0x4F36aAEb18Ab56A4e380241bea6ebF215b9cb12c" +ORACLE_DAEMON_CONFIG = "0x7bC76076b0f3879b4A750450C0Ccf02c6Ca11220" + +INSURANCE_FUND = "" +RELAY_ALLOWED_LIST = "" + +LDO_HOLDER_ADDRESS_FOR_TESTS = "0x8360927B5BC431771C21E347eA29529b6eE94b78" +LDO_VOTE_EXECUTORS_FOR_TESTS = [ + "0x32A0E5828B62AAb932362a4816ae03b860b65e83", + "0x8360927B5BC431771C21E347eA29529b6eE94b78", + "0xaa6bfBCD634EE744CB8FE522b29ADD23124593D3", +] + +ORACLE_COMMITTEE = [] + +DSM_GUARDIANS = [] + +WSTETH_TOKEN = "0xB82381A3fBD3FaFA77B3a7bE693342618240067b" +CHAIN_DEPOSIT_CONTRACT = "0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D" diff --git a/network-config.yaml b/network-config.yaml index a57a33a3a..df472c6b3 100644 --- a/network-config.yaml +++ b/network-config.yaml @@ -1,4 +1,6 @@ development: + + # Mainnet Fork - cmd: ./ganache.sh cmd_settings: accounts: 10 @@ -12,6 +14,8 @@ development: timeout: 360 # https://github.com/mds1/multicall#multicall2-contract-addresses multicall2: "0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696" + + # Goerli Fork - cmd: ./ganache.sh cmd_settings: accounts: 10 @@ -24,6 +28,22 @@ development: id: goerli-fork name: goerli-fork timeout: 360 + + # Sepolia Fork + - cmd: ./ganache.sh + cmd_settings: + accounts: 10 + chain_id: 11155111 + fork: sepolia + gas_limit: 30000000 + mnemonic: brownie + port: 8545 + host: http://127.0.0.1 + id: sepolia-fork + name: sepolia-fork + timeout: 360 + + # Local Fork - cmd: ./ganache.sh cmd_settings: accounts: 10 From cbcd343d9b6af1d6b233b2c9d8cd5eeeb659db12 Mon Sep 17 00:00:00 2001 From: Yuri Tkachenko Date: Mon, 18 Mar 2024 16:42:17 +0100 Subject: [PATCH 2/7] fix: sepolia network config --- network-config.yaml | 2 +- utils/config.py | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/network-config.yaml b/network-config.yaml index df472c6b3..a60f9e6ef 100644 --- a/network-config.yaml +++ b/network-config.yaml @@ -34,7 +34,7 @@ development: cmd_settings: accounts: 10 chain_id: 11155111 - fork: sepolia + fork: $SEPOLIA_RPC_URL gas_limit: 30000000 mnemonic: brownie port: 8545 diff --git a/utils/config.py b/utils/config.py index 05852ff0b..eb7374f71 100644 --- a/utils/config.py +++ b/utils/config.py @@ -29,13 +29,24 @@ def network_name() -> Optional[str]: if network_name() in ("goerli", "goerli-fork"): print(f'Using {color("cyan")}config_goerli.py{color} addresses') from configs.config_goerli import * +elif network_name() in ("sepolia", "sepolia-fork"): + print(f'Using {color("yellow")}config_sepolia.py{color} addresses') + from configs.config_sepolia import * else: print(f'Using {color("magenta")}config_mainnet.py{color} addresses') from configs.config_mainnet import * def get_is_live() -> bool: - dev_networks = ["development", "hardhat", "hardhat-fork", "goerli-fork", "local-fork", "mainnet-fork"] + dev_networks = [ + "development", + "hardhat", + "hardhat-fork", + "goerli-fork", + "local-fork", + "mainnet-fork", + "sepolia-fork", + ] return network.show_active() not in dev_networks @@ -87,8 +98,10 @@ def get_pinata_cloud_token(silent=False) -> str: def get_infura_io_keys(silent=False) -> Tuple[str, str]: is_live = get_is_live() - if is_live and not silent and ( - "WEB3_INFURA_IPFS_PROJECT_ID" not in os.environ or "WEB3_INFURA_IPFS_PROJECT_SECRET" not in os.environ + if ( + is_live + and not silent + and ("WEB3_INFURA_IPFS_PROJECT_ID" not in os.environ or "WEB3_INFURA_IPFS_PROJECT_SECRET" not in os.environ) ): raise EnvironmentError( "Please set WEB3_INFURA_IPFS_PROJECT_ID and WEB3_INFURA_IPFS_PROJECT_SECRET env variable " @@ -120,6 +133,10 @@ def get_config_params() -> Dict[str, str]: import configs.config_goerli ret = {x: globals()[x] for x in dir(configs.config_goerli) if not x.startswith("__")} + elif network_name() in ("sepolia", "sepolia-fork"): + import configs.config_sepolia + + ret = {x: globals()[x] for x in dir(configs.config_sepolia) if not x.startswith("__")} else: import configs.config_mainnet From a09c2bdf6aac27885c3cef78a75ac26531152373 Mon Sep 17 00:00:00 2001 From: Eugene M Date: Tue, 19 Mar 2024 14:56:25 +0300 Subject: [PATCH 3/7] fix: live sepolia support --- README.md | 6 ++++++ network-config.yaml | 11 +++++++++++ utils/voting.py | 13 +++++++------ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7ac71e729..e74c96ce1 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,12 @@ In a typical weekly omnibus workflow, you need only `mainnet-fork` and `mainnet` networks. In case of large test campaign on Lido upgrades, it also could be useful to go with `goerli`/`sepolia` and `goerli-fork`/`sepolia-fork` testnets first. +To connect to Sepolia testnet set the following var: + +```bash +export SEPOLIA_RPC_URL= +``` + ### Environment variables setup Despite the chosen network you always need to set the following var: diff --git a/network-config.yaml b/network-config.yaml index a60f9e6ef..dba6d5878 100644 --- a/network-config.yaml +++ b/network-config.yaml @@ -1,3 +1,14 @@ +live: + - name: Ethereum + networks: + - chainid: 11155111 + explorer: https://api-sepolia.etherscan.io/api + host: $SEPOLIA_RPC_URL + id: sepolia + # New backward-compatible multicall contract. multicall2 is missing on Holesky. See https://github.com/mds1/multicall + multicall2: "0xeAA373D1973e5af44e91840ee097bf7AD64693c2" + name: Sepolia (Infura) + provider: infura development: # Mainnet Fork diff --git a/utils/voting.py b/utils/voting.py index 0015e85c7..bbdc030c7 100644 --- a/utils/voting.py +++ b/utils/voting.py @@ -193,12 +193,13 @@ def confirm_vote_script( # Show detailed description of prepared voting. if not silent: - human_readable_script = decode_evm_script( - encoded_call_script, - verbose=False, - specific_net=CHAIN_NETWORK_NAME, - repeat_is_error=True, - ) + # human_readable_script = decode_evm_script( + # encoded_call_script, + # verbose=False, + # specific_net=CHAIN_NETWORK_NAME, + # repeat_is_error=True, + # ) + human_readable_script = [] vote_descriptions = list(vote_items.keys()) From 5e888804d3024ba20782484d58745240aafc26ea Mon Sep 17 00:00:00 2001 From: Yuri Tkachenko Date: Wed, 24 Apr 2024 13:12:13 +0200 Subject: [PATCH 4/7] fix: enable decode_evm_script --- utils/voting.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/utils/voting.py b/utils/voting.py index bbdc030c7..0015e85c7 100644 --- a/utils/voting.py +++ b/utils/voting.py @@ -193,13 +193,12 @@ def confirm_vote_script( # Show detailed description of prepared voting. if not silent: - # human_readable_script = decode_evm_script( - # encoded_call_script, - # verbose=False, - # specific_net=CHAIN_NETWORK_NAME, - # repeat_is_error=True, - # ) - human_readable_script = [] + human_readable_script = decode_evm_script( + encoded_call_script, + verbose=False, + specific_net=CHAIN_NETWORK_NAME, + repeat_is_error=True, + ) vote_descriptions = list(vote_items.keys()) From 35a1660460dd37811bbd8fe06a9512edb49394bd Mon Sep 17 00:00:00 2001 From: Yuri Tkachenko Date: Wed, 24 Apr 2024 13:17:22 +0200 Subject: [PATCH 5/7] chore: update readme --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5141f1634..c374116d8 100644 --- a/README.md +++ b/README.md @@ -83,14 +83,12 @@ By default, you should start composing new scripts and test using forked network You have three forked networks to work with: - `mainnet-fork` -- `goerli-fork` - `holesky-fork` - `sepolia-fork` To start new voting on the live networks you could proceed with: - `mainnet` -- `goerli` - `holesky` - `sepolia` @@ -99,7 +97,7 @@ To start new voting on the live networks you could proceed with: In a typical weekly omnibus workflow, you need only `mainnet-fork` and `mainnet` networks. In case of large test campaign on Lido upgrades, -it also could be useful to go with `goerli`/`sepolia` and `goerli-fork`/`sepolia-fork` testnets first. +it also could be useful to go with `holesky` and `holesky-fork` testnets first. > [!IMPORTANT] > **Holesky specifics.** @@ -111,6 +109,10 @@ it also could be useful to go with `goerli`/`sepolia` and `goerli-fork`/`sepolia > [!WARNING] > **Holesky is partially supported.** > At the moment not all parameters are set in `configs/config_holesky.py` and acceptance/regression/snapshot tests are not operational. +> +> **Sepolia is partially supported.** +> At the moment not all parameters are set in `configs/config_sepolia.py` and acceptance/regression/snapshot tests are not operational. + ### Environment variables setup From ffbb200f5765d5d872ebb5589f0462552190f8f3 Mon Sep 17 00:00:00 2001 From: Yuri Tkachenko Date: Wed, 24 Apr 2024 13:32:15 +0200 Subject: [PATCH 6/7] chore: remove unused get_config_params function --- utils/config.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/utils/config.py b/utils/config.py index 7fe2b69e8..0cd0672d6 100644 --- a/utils/config.py +++ b/utils/config.py @@ -132,22 +132,6 @@ def prompt_bool() -> Optional[bool]: sys.stdout.write("Please respond with 'yes' or 'no'") -def get_config_params() -> Dict[str, str]: - if network_name() in ("goerli", "goerli-fork"): - import configs.config_goerli - - ret = {x: globals()[x] for x in dir(configs.config_goerli) if not x.startswith("__")} - elif network_name() in ("sepolia", "sepolia-fork"): - import configs.config_sepolia - - ret = {x: globals()[x] for x in dir(configs.config_sepolia) if not x.startswith("__")} - else: - import configs.config_mainnet - - ret = {x: globals()[x] for x in dir(configs.config_mainnet) if not x.startswith("__")} - return ret - - class ContractsLazyLoader: @property def lido_v1(self) -> interface.LidoV1: From a5eb329c7dac82d23fceeb2a5d7927864f1e4426 Mon Sep 17 00:00:00 2001 From: Yuri Tkachenko Date: Wed, 24 Apr 2024 14:18:35 +0200 Subject: [PATCH 7/7] chore: review fixes --- README.md | 7 ------- network-config.yaml | 28 ++++++++++++---------------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index c374116d8..7d8a12108 100644 --- a/README.md +++ b/README.md @@ -99,13 +99,6 @@ In a typical weekly omnibus workflow, you need only `mainnet-fork` and `mainnet` networks. In case of large test campaign on Lido upgrades, it also could be useful to go with `holesky` and `holesky-fork` testnets first. -> [!IMPORTANT] -> **Holesky specifics.** -> Due to Holesky not being supported by Infura yet, setting RPC URL for Holesky is different. Instead of setting `WEB3_INFURA_PROJECT_ID` env variable set `HOLESKY_RPC_URL`. -> -> **Sepolia specifics.** -> Due to Sepolia not being supported by Infura yet, setting RPC URL for Holesky is different. Instead of setting `WEB3_INFURA_PROJECT_ID` env variable set `SEPOLIA_RPC_URL`. - > [!WARNING] > **Holesky is partially supported.** > At the moment not all parameters are set in `configs/config_holesky.py` and acceptance/regression/snapshot tests are not operational. diff --git a/network-config.yaml b/network-config.yaml index e543d6d2b..deca032b2 100644 --- a/network-config.yaml +++ b/network-config.yaml @@ -3,9 +3,10 @@ live: networks: - chainid: 17000 explorer: https://api-holesky.etherscan.io/api - host: $HOLESKY_RPC_URL + host: https://holesky.infura.io/v3/$WEB3_INFURA_PROJECT_ID id: holesky - # New backward-compatible multicall contract. multicall2 is missing on Holesky. See https://github.com/mds1/multicall + # multicall2 is missing on Holesky. New backward-compatible multicall contract. + # See https://github.com/mds1/multicall multicall2: "0xcA11bde05977b3631167028862bE2a173976CA11" name: Holesky (Infura) provider: infura @@ -14,17 +15,16 @@ live: networks: - chainid: 11155111 explorer: https://api-sepolia.etherscan.io/api - host: $SEPOLIA_RPC_URL + host: https://sepolia.infura.io/v3/$WEB3_INFURA_PROJECT_ID id: sepolia - # New backward-compatible multicall contract. multicall2 is missing on Sepolia. - # So multicall3 (backward compatible) is used. See https://github.com/mds1/multicall + # multicall2 is missing on Sepolia. New backward-compatible multicall contract. + # See https://github.com/mds1/multicall multicall2: "0xcA11bde05977b3631167028862bE2a173976CA11" name: Sepolia (Infura) provider: infura development: - # Mainnet Fork - cmd: ./ganache.sh cmd_settings: accounts: 10 @@ -39,7 +39,6 @@ development: # https://github.com/mds1/multicall#multicall2-contract-addresses multicall2: "0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696" - # Goerli Fork - cmd: ./ganache.sh cmd_settings: accounts: 10 @@ -50,38 +49,35 @@ development: port: 8545 host: http://127.0.0.1 id: goerli-fork - name: goerli-fork + name: Ganache-CLI (Goerli Fork) timeout: 360 - # Holesky Fork - cmd: ./ganache.sh cmd_settings: accounts: 10 chain_id: 17000 - fork: $HOLESKY_RPC_URL + fork: holesky gas_limit: 30000000 mnemonic: brownie port: 8545 host: http://127.0.0.1 id: holesky-fork - name: holesky-fork + name: Ganache-CLI (Holesky Fork) timeout: 360 - # Sepolia Fork - cmd: ./ganache.sh cmd_settings: accounts: 10 chain_id: 11155111 - fork: $SEPOLIA_RPC_URL + fork: sepolia gas_limit: 30000000 mnemonic: brownie port: 8545 host: http://127.0.0.1 id: sepolia-fork - name: sepolia-fork + name: Ganache-CLI (Sepolia Fork) timeout: 360 - # Local Fork - cmd: ./ganache.sh cmd_settings: accounts: 10 @@ -92,7 +88,7 @@ development: port: 8545 host: http://127.0.0.1 id: local-fork - name: local-fork + name: Ganache-CLI (Local Fork) explorer: https://api.etherscan.io/api timeout: 360 # https://github.com/mds1/multicall#multicall2-contract-addresses