Skip to content

Commit ccdc2a8

Browse files
authored
Merge pull request #490 from lidofinance/revert-458-revert-455-feat/tw-and-csmv2-restore-master
TW-CSM-Testnet
2 parents fcb6e3a + f2b1bb2 commit ccdc2a8

File tree

98 files changed

+12903
-10408
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+12903
-10408
lines changed

.github/actions/brownie_fork_tests/action.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ inputs:
66
description: "vote type: normal or large"
77
required: false
88
default: "normal"
9-
infura:
10-
description: "infura JSON-RPC provider"
9+
rpc_url:
10+
description: "Ethereum RPC URL (any provider: Infura, Alchemy, custom)"
1111
required: true
1212
default: ""
1313
etherscan:
@@ -74,6 +74,5 @@ runs:
7474
run: >
7575
${{ inputs.command }}
7676
env:
77-
WEB3_INFURA_PROJECT_ID: ${{ inputs.infura }}
7877
ETHERSCAN_TOKEN: ${{ inputs.etherscan }}
79-
ETH_RPC_URL: "https://mainnet.infura.io/v3/${{ inputs.infura }}"
78+
ETH_RPC_URL: ${{ inputs.rpc_url }}

.github/workflows/core_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Run node
4242
run: docker exec -e ETH_RPC_URL --detach tests-runner bash -c 'NODE_PORT=8546 make node'
4343
env:
44-
ETH_RPC_URL: "https://mainnet.infura.io/v3/${{ secrets.WEB3_INFURA_PROJECT_ID }}"
44+
ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }}
4545

4646
- name: Check that the fork is ready
4747
shell: bash

.github/workflows/dual_governance_regression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ jobs:
131131
- name: Start Hardhat node
132132
shell: bash
133133
run: |
134-
npx hardhat node --fork https://mainnet.infura.io/v3/${{ secrets.WEB3_INFURA_PROJECT_ID }} &
134+
npx hardhat node --fork ${{ secrets.ETH_RPC_URL }} &
135135
for i in {1..30}; do
136136
if curl -sf ${{ env.HARDHAT_NODE_URL }} ${{ env.CURL_PARAMS }} | grep -q '"result"'; then
137137
echo "Hardhat node is ready"

.github/workflows/large_vote_ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
uses: ./.github/actions/brownie_fork_tests
3535
with:
3636
vote: "large"
37-
infura: ${{ secrets.WEB3_INFURA_PROJECT_ID }}
37+
rpc_url: ${{ secrets.ETH_RPC_URL }}
3838
etherscan: ${{ secrets.ETHERSCAN_TOKEN }}
3939
command: "make test-1/2"
4040

@@ -60,6 +60,6 @@ jobs:
6060
uses: ./.github/actions/brownie_fork_tests
6161
with:
6262
vote: "large"
63-
infura: ${{ secrets.WEB3_INFURA_PROJECT_ID }}
63+
rpc_url: ${{ secrets.ETH_RPC_URL }}
6464
etherscan: ${{ secrets.ETHERSCAN_TOKEN }}
6565
command: "make test-2/2"

.github/workflows/normal_vote_ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: ./.github/actions/brownie_fork_tests
2222
with:
2323
vote: "normal"
24-
infura: ${{ secrets.WEB3_INFURA_PROJECT_ID }}
24+
rpc_url: ${{ secrets.ETH_RPC_URL }}
2525
etherscan: ${{ secrets.ETHERSCAN_TOKEN }}
2626
command: "make test-1/2"
2727

@@ -36,6 +36,6 @@ jobs:
3636
uses: ./.github/actions/brownie_fork_tests
3737
with:
3838
vote: "normal"
39-
infura: ${{ secrets.WEB3_INFURA_PROJECT_ID }}
39+
rpc_url: ${{ secrets.ETH_RPC_URL }}
4040
etherscan: ${{ secrets.ETHERSCAN_TOKEN }}
4141
command: "make test-2/2"

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ node3:
8080
test-core:
8181
cd $(CORE_DIR) && \
8282
FORK_RPC_URL=$(CORE_TESTS_TARGET_RPC_URL) \
83+
RPC_URL=$(CORE_TESTS_TARGET_RPC_URL) \
8384
yarn test:integration
8485

8586
slots:

archive/scripts/upgrade_tw_csm2.py

Lines changed: 910 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
"""
2+
Vote XX/06/2025 [HOLESKY]
3+
4+
1. Grant SUBMIT_REPORT_HASH_ROLE role to the EasyTrack EVM Script Executor
5+
2. Connect TRIGGERABLE_WITHDRAWALS_GATEWAY to Dual Governance tiebreaker
6+
3. Add `SubmitValidatorsExitRequestHashes` (SDVT) EVM script factory to Easy Track
7+
4. Add `SubmitValidatorsExitRequestHashes` (Curated Module) EVM script factory to Easy Track
8+
"""
9+
import time
10+
11+
from typing import Any, Dict
12+
from typing import Tuple, Optional
13+
from utils.config import (
14+
AGENT,
15+
contracts,
16+
get_deployer_account,
17+
get_priority_fee,
18+
get_is_live
19+
)
20+
from utils.dg_decorators import forward_agent, forward_dg_admin, forward_voting, process_voting_items
21+
from utils.ipfs import upload_vote_ipfs_description, calculate_vote_ipfs_description
22+
from utils.voting import confirm_vote_script, create_vote, bake_vote_items
23+
from utils.permissions import encode_oz_grant_role
24+
from utils.easy_track import (
25+
add_evmscript_factory,
26+
create_permissions,
27+
)
28+
from typing import Optional, Tuple, Dict
29+
from utils.config import contracts
30+
31+
32+
33+
TRIGGERABLE_WITHDRAWALS_GATEWAY = "0x4FD4113f2B92856B59BC3be77f2943B7F4eaa9a5"
34+
35+
EASYTRACK_EVMSCRIPT_EXECUTOR = "0x2819B65021E13CEEB9AC33E77DB32c7e64e7520D"
36+
37+
EASYTRACK_SDVT_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY = "0x4aB23f409F8F6EdeF321C735e941E4670804a1B4"
38+
EASYTRACK_CURATED_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY = "0x7A1c5af4625dc1160a7c67d00335B6Ad492bE53f"
39+
40+
DESCRIPTION = "Add Triggerable Withdrawals Gateway to Dual Governance and new Easy Tracks (HOLESKY)"
41+
42+
def start_vote(tx_params: Dict[str, str], silent: bool) -> Tuple[int, Optional[Any]]:
43+
voting_unprepared_items = [
44+
(
45+
f"Grant SUBMIT_REPORT_HASH_ROLE on Validator Exit Bus Oracle to the EasyTrack EVM Script Executor",
46+
forward_agent(
47+
*encode_oz_grant_role(
48+
contract=contracts.validators_exit_bus_oracle,
49+
role_name="SUBMIT_REPORT_HASH_ROLE",
50+
grant_to=EASYTRACK_EVMSCRIPT_EXECUTOR,
51+
),
52+
),
53+
),
54+
(
55+
"Connect TRIGGERABLE_WITHDRAWALS_GATEWAY to Dual Governance tiebreaker",
56+
forward_dg_admin(
57+
contracts.dual_governance.address,
58+
contracts.dual_governance.addTiebreakerSealableWithdrawalBlocker.encode_input(
59+
TRIGGERABLE_WITHDRAWALS_GATEWAY
60+
),
61+
)
62+
),
63+
(
64+
f"Add `SubmitValidatorsExitRequestHashes` (SDVT) EVM script factory with address `{EASYTRACK_SDVT_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY}` to Easy Track `{contracts.easy_track.address}`",
65+
forward_voting(
66+
*add_evmscript_factory(
67+
factory=EASYTRACK_SDVT_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY,
68+
permissions=(create_permissions(contracts.validators_exit_bus_oracle, "submitExitRequestsHash")),
69+
)
70+
)
71+
),
72+
(
73+
f"Add `SubmitValidatorsExitRequestHashes` (Curated Module) EVM script factory with address `{EASYTRACK_CURATED_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY}` to Easy Track `{contracts.easy_track.address}`",
74+
forward_voting(
75+
*add_evmscript_factory(
76+
factory=EASYTRACK_CURATED_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY,
77+
permissions=(create_permissions(contracts.validators_exit_bus_oracle, "submitExitRequestsHash")),
78+
)
79+
)
80+
)
81+
]
82+
83+
if silent:
84+
desc_ipfs = calculate_vote_ipfs_description(DESCRIPTION)
85+
else:
86+
desc_ipfs = upload_vote_ipfs_description(DESCRIPTION)
87+
88+
89+
vote_items = process_voting_items(voting_unprepared_items)
90+
assert confirm_vote_script(vote_items, silent, desc_ipfs)
91+
92+
return create_vote(vote_items, tx_params, desc_ipfs=desc_ipfs)
93+
94+
95+
96+
def main():
97+
tx_params = {"from": get_deployer_account()}
98+
if get_is_live():
99+
tx_params["priority_fee"] = get_priority_fee()
100+
101+
vote_id, _ = start_vote(tx_params=tx_params, silent=False)
102+
103+
vote_id >= 0 and print(f"Vote created: {vote_id}.")
104+
105+
time.sleep(5) # hack for waiting thread #2.

0 commit comments

Comments
 (0)