Skip to content

Chore: add submit exit hashes factories to the vote #416

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

Open
wants to merge 1 commit into
base: feat/tw-and-csmv2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions configs/config_holesky.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ def ETH(amount):
EASYTRACK_MEV_BOOST_ADD_RELAYS_FACTORY = "0x0"
EASYTRACK_MEV_BOOST_REMOVE_RELAYS_FACTORY = "0x0"
EASYTRACK_MEV_BOOST_EDIT_RELAYS_FACTORY = "0x0"
# TODO: fill in after deploy
EASYTRACK_SDVT_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY = "0x0"
EASYTRACK_CURATED_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY = "0x0"

# Multisigs
FINANCE_MULTISIG = ""
Expand Down
3 changes: 3 additions & 0 deletions configs/config_hoodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
EASYTRACK_MEV_BOOST_ADD_RELAYS_FACTORY = "0xF02DbeaA1Bbc90226CaB995db4C190DbE25983af"
EASYTRACK_MEV_BOOST_REMOVE_RELAYS_FACTORY = "0x7FCc2901C6C3D62784cB178B14d44445B038f736"
EASYTRACK_MEV_BOOST_EDIT_RELAYS_FACTORY = "0x27A99a7104190DdA297B222104A6C70A4Ca5A17e"
# TODO: fill in after deploy
EASYTRACK_SDVT_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY = "0x0"
EASYTRACK_CURATED_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY = "0x0"

# Other
RELAY_ALLOWED_LIST = "0x279d3A456212a1294DaEd0faEE98675a52E8A4Bf"
Expand Down
47 changes: 32 additions & 15 deletions scripts/vote_tw_csm2.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
VOTING,
ARAGON_KERNEL,
AGENT,
VALIDATORS_EXIT_BUS_ORACLE,
EASYTRACK_SDVT_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY,
EASYTRACK_CURATED_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY,
EASYTRACK_EVMSCRIPT_EXECUTOR,
contracts,
get_deployer_account,
get_priority_fee,
Expand Down Expand Up @@ -149,7 +153,7 @@ def create_tw_vote(tx_params: Dict[str, str], silent: bool) -> Tuple[int, Option
3. Call finalizeUpgrade_v2(maxValidatorsPerReport, maxExitRequestsLimit, exitsPerFrame, frameDurationInSec) on VEBO
4. Grant VEBO role MANAGE_CONSENSUS_VERSION_ROLE to the AGENT
5. Bump VEBO consensus version to `4`
6. Grant VEB role SUBMIT_REPORT_HASH_ROLE to the ET (TBD)
6. Grant SUBMIT_REPORT_HASH_ROLE on Validator Exit Bus Oracle `0xffDDF7025410412deaa05E3E1cE68FE53208afcb` to the EasyTrack EVM Script Executor `0x2819B65021E13CEEB9AC33E77DB32c7e64e7520D`
--- Triggerable Withdrawals Gateway (TWG)
7. Grant TWG role ADD_FULL_WITHDRAWAL_REQUEST_ROLE to the CS Ejector
8. Grant TWG role ADD_FULL_WITHDRAWAL_REQUEST_ROLE to the VEB
Expand Down Expand Up @@ -203,7 +207,9 @@ def create_tw_vote(tx_params: Dict[str, str], silent: bool) -> Tuple[int, Option
49. Grant CSFeeOracle role PAUSE_ROLE for the new GateSeal instance
50. Increase CSM share in Staking Router from {to_percent(CS_MODULE_TARGET_SHARE_BP)}% to {to_percent(CS_MODULE_NEW_TARGET_SHARE_BP)}%
51. Add CSMSetVettedGateTree factory to EasyTrack with permissions
"""
52. Add `SubmitValidatorsExitRequestHashes` (SDVT) EVM script factory with address `` to Easy Track `0x1763b9ED3586B08AE796c7787811a2E1bc16163a`
53. Add `SubmitValidatorsExitRequestHashes` (Curated Module) EVM script factory with address `` to Easy Track `0x1763b9ED3586B08AE796c7787811a2E1bc16163a`
""" # TODO: fill in after deploy ^

print(f"LIDO_LOCATOR_IMPL repo URI: {LIDO_LOCATOR_IMPL}")
print(f"VALIDATORS_EXIT_BUS_ORACLE_IMPL: {VALIDATORS_EXIT_BUS_ORACLE_IMPL}")
Expand Down Expand Up @@ -250,16 +256,14 @@ def create_tw_vote(tx_params: Dict[str, str], silent: bool) -> Tuple[int, Option
f"5. Bump VEBO consensus version to `{VEBO_CONSENSUS_VERSION}`",
encode_oracle_upgrade_consensus(contracts.validators_exit_bus_oracle, VEBO_CONSENSUS_VERSION)
),
# (
# f"6. Grant VEB role SUBMIT_REPORT_HASH_ROLE to the ET",
# agent_forward([
# encode_oz_grant_role(
# contract=contracts.validators_exit_bus_oracle,
# role_name="SUBMIT_REPORT_HASH_ROLE",
# grant_to=contracts.agent,
# )
# ])
# ),
(
f"6. Grant SUBMIT_REPORT_HASH_ROLE on Validator Exit Bus Oracle `0xffDDF7025410412deaa05E3E1cE68FE53208afcb` to the EasyTrack EVM Script Executor `0x2819B65021E13CEEB9AC33E77DB32c7e64e7520D`",
encode_oz_grant_role(
contract=contracts.validators_exit_bus_oracle,
role_name="SUBMIT_REPORT_HASH_ROLE",
grant_to=EASYTRACK_EVMSCRIPT_EXECUTOR,
),
),
# # --- Triggerable Withdrawals Gateway (TWG)
(
f"7. Grant TWG role ADD_FULL_WITHDRAWAL_REQUEST_ROLE to the CS Ejector",
Expand Down Expand Up @@ -626,12 +630,25 @@ def create_tw_vote(tx_params: Dict[str, str], silent: bool) -> Tuple[int, Option
)

plain_agent_item = bake_vote_items(
["54. Add CSSetVettedGateTree factory to EasyTrack with permissions"],
[
"54. Add CSSetVettedGateTree factory to EasyTrack with permissions",
# TODO: fill in after deploy
"55. Add `SubmitValidatorsExitRequestHashes` (SDVT) EVM script factory with address `` to Easy Track `0x1763b9ED3586B08AE796c7787811a2E1bc16163a`",
"56. Add `SubmitValidatorsExitRequestHashes` (Curated Module) EVM script factory with address `` to Easy Track `0x1763b9ED3586B08AE796c7787811a2E1bc16163a`",
],
[
add_evmscript_factory(
factory=CS_SET_VETTED_GATE_TREE_FACTORY,
permissions=(create_permissions(contracts.cs_vetted_gate, "setTreeParams")),
)
permissions=(create_permissions(contracts.cs_vetted_gate, "setTreeParams"))
),
add_evmscript_factory(
factory=EASYTRACK_SDVT_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY,
permissions=(create_permissions(VALIDATORS_EXIT_BUS_ORACLE, "submitExitRequestHashes"))
),
add_evmscript_factory(
factory=EASYTRACK_CURATED_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY,
permissions=(create_permissions(VALIDATORS_EXIT_BUS_ORACLE, "submitExitRequestHashes"))
),
]
)

Expand Down
24 changes: 24 additions & 0 deletions tests/test_vote_tw_csm2.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
CS_FEE_ORACLE_V2_VERSION = 2
CS_FEE_DISTRIBUTOR_V2_VERSION = 2

VALIDATORS_EXIT_BUS_ORACLE = "0xffDDF7025410412deaa05E3E1cE68FE53208afcb"

EASYTRACK = "0x1763b9ED3586B08AE796c7787811a2E1bc16163a"
EASYTRACK_EVMSCRIPT_EXECUTOR = "0x2819B65021E13CEEB9AC33E77DB32c7e64e7520D"
# TODO: fill in after deploy
EASYTRACK_SDVT_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY = "0x0"
EASYTRACK_CURATED_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY = "0x0"

def get_ossifiable_proxy_impl(proxy_address):
"""Get implementation address from an OssifiableProxy"""
Expand All @@ -50,6 +57,8 @@ def check_proxy_implementation(proxy_address, expected_impl):
def test_tw_vote(helpers, accounts, vote_ids_from_env, stranger):
# Define constants and initial states
app_manager_role = web3.keccak(text="APP_MANAGER_ROLE")
submit_exit_hashes_role = web3.keccak(text="SUBMIT_REPORT_HASH_ROLE")

vebo_consensus_version = 4
ao_consensus_version = 4
exit_events_lookback_window_in_slots = 7200
Expand Down Expand Up @@ -131,6 +140,9 @@ def test_tw_vote(helpers, accounts, vote_ids_from_env, stranger):
# Assert APP_MANAGER_ROLE setting
assert not contracts.acl.hasPermission(contracts.agent, contracts.kernel, app_manager_role)

# 6. Assert EasyTrackEVMScriptExecutor has no SUBMIT_REPORT_HASH_ROLE permission on the ValidatorsExitBusOracle
assert not contracts.acl.hasPermission(EASYTRACK_EVMSCRIPT_EXECUTOR, VALIDATORS_EXIT_BUS_ORACLE, submit_exit_hashes_role)

# Assert Node Operator Registry and sDVT configuration

assert contracts.node_operators_registry.getContractVersion() == 3
Expand Down Expand Up @@ -196,6 +208,10 @@ def test_tw_vote(helpers, accounts, vote_ids_from_env, stranger):
# CSM Step 51: EasyTrack factories before vote (pre-vote state)
initial_factories = contracts.easy_track.getEVMScriptFactories()
assert CS_SET_VETTED_GATE_TREE_FACTORY not in initial_factories, "EasyTrack should not have CSMSetVettedGateTree factory before vote"
# 52. SubmitValidatorsExitRequestHashes (SDVT) EVM script factory is not in Easy Track
assert EASYTRACK_SDVT_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY not in initial_factories, "EasyTrack should not have SDVT Submit Validator Exit Request Hashes factory before vote"
# 53. CuratedSubmitValidatorExitRequestHashes (Curated) EVM script factory is not in Easy Track
assert EASYTRACK_CURATED_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY not in initial_factories, "EasyTrack should not have Curated Submit Validator Exit Request Hashes factory before vote"

# START VOTE
if len(vote_ids_from_env) > 0:
Expand Down Expand Up @@ -229,6 +245,9 @@ def test_tw_vote(helpers, accounts, vote_ids_from_env, stranger):
assert contracts.triggerable_withdrawals_gateway.hasRole(add_full_withdrawal_request_role, contracts.cs_ejector)
assert contracts.triggerable_withdrawals_gateway.hasRole(add_full_withdrawal_request_role, contracts.validators_exit_bus_oracle)

# 6. Assert EasyTrackEVMScriptExecutor has SUBMIT_REPORT_HASH_ROLE permission on the ValidatorsExitBusOracle
assert contracts.acl.hasPermission(EASYTRACK_EVMSCRIPT_EXECUTOR, VALIDATORS_EXIT_BUS_ORACLE, submit_exit_hashes_role)

# # 9-10. Validate Withdrawal Vault upgrade
assert interface.WithdrawalContractProxy(contracts.withdrawal_vault).implementation() == WITHDRAWAL_VAULT_IMPL
# Validate finalizeUpgrade_v2() was called (check version or new functionality)
Expand Down Expand Up @@ -348,3 +367,8 @@ def test_tw_vote(helpers, accounts, vote_ids_from_env, stranger):
# CSM Step 54: Add EasyTrack factory for CSSetVettedGateTree
new_factories = contracts.easy_track.getEVMScriptFactories()
assert CS_SET_VETTED_GATE_TREE_FACTORY in new_factories, "EasyTrack should have CSSetVettedGateTree factory after vote"

# 55. SubmitValidatorsExitRequestHashes (SDVT) EVM script factory is added to Easy Track
assert EASYTRACK_SDVT_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY in new_factories, "EasyTrack should have SDVT Submit Validator Exit Request Hashes factory after vote"
# 56. CuratedSubmitValidatorExitRequestHashes (Curated) EVM script factory is added to Easy Track
assert EASYTRACK_CURATED_SUBMIT_VALIDATOR_EXIT_REQUEST_HASHES_FACTORY in new_factories, "EasyTrack should have Curated Submit Validator Exit Request Hashes factory after vote"
Loading