Skip to content

Commit 4c1104e

Browse files
committed
fix: reorganize DG items
1 parent 7bf67c5 commit 4c1104e

File tree

2 files changed

+117
-105
lines changed

2 files changed

+117
-105
lines changed

scripts/upgrade_2026_01_20_v3_phase_2.py

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def get_vote_items() -> Tuple[List[str], List[Tuple[str, str]]]:
8787
predeposit_guarantee = interface.PredepositGuarantee(PREDEPOSIT_GUARANTEE)
8888

8989
dg_items = [
90+
# ======================== EasyTrack ========================
9091
# 1.1. Revoke `vaults.OperatorsGrid.Registry` role `a495a3428837724c7f7648cda02eb83c9c4c778c8688d6f254c7f3f80c154d55` on OperatorGrid `0xC69685E89Cefc327b43B7234AC646451B27c544d` from old VaultsAdapter `0xe2DE6d2DefF15588a71849c0429101F8ca9FB14D`
9192
agent_forward([
9293
encode_oz_revoke_role(operator_grid, "vaults.OperatorsGrid.Registry", OLD_VAULTS_ADAPTER)
@@ -117,74 +118,77 @@ def get_vote_items() -> Tuple[List[str], List[Tuple[str, str]]]:
117118
encode_oz_grant_role(vault_hub, "vaults.VaultHub.BadDebtMasterRole", VAULTS_ADAPTER)
118119
]),
119120

120-
# 1.7. Raise CSM (MODULE_ID = `3`) stake share limit from `500 BP` to `750 BP` and priority exit threshold from `625 BP` to `900 BP`
121-
agent_forward([
122-
(
123-
staking_router.address,
124-
staking_router.updateStakingModule.encode_input(
125-
CSM_MODULE_ID,
126-
CSM_MODULE_NEW_TARGET_SHARE_BP,
127-
CSM_MODULE_NEW_PRIORITY_EXIT_THRESHOLD_BP,
128-
CSM_MODULE_MODULE_FEE_BP,
129-
CSM_MODULE_TREASURY_FEE_BP,
130-
CSM_MODULE_MAX_DEPOSITS_PER_BLOCK,
131-
CSM_MODULE_MIN_DEPOSIT_BLOCK_DISTANCE,
132-
),
133-
),
134-
]),
135-
136-
# 1.8. Grant `MANAGE_FRAME_CONFIG_ROLE` `921f40f434e049d23969cbe68d9cf3ac1013fbe8945da07963af6f3142de6afe` on CS HashConsensus `0x71093efF8D8599b5fA340D665Ad60fA7C80688e4` to TwoPhaseFrameConfigUpdate contract `0xb2B4DB1491cbe949ae85EfF01E0d3ee239f110C1`
137-
agent_forward([
138-
encode_oz_grant_role(
139-
contract=cs_hash_consensus,
140-
role_name="MANAGE_FRAME_CONFIG_ROLE",
141-
grant_to=TWO_PHASE_FRAME_CONFIG_UPDATE,
142-
)
143-
]),
144-
145-
# 1.9. Update PredepositGuarantee proxy `0xF4bF42c6D6A0E38825785048124DBAD6c9eaaac3` implementation to `0xE78717192C45736DF0E4be55c0219Ee7f9aDdd0D`
121+
# ======================== PDG ========================
122+
# 1.7. Update PredepositGuarantee proxy `0xF4bF42c6D6A0E38825785048124DBAD6c9eaaac3` implementation to `0xE78717192C45736DF0E4be55c0219Ee7f9aDdd0D`
146123
agent_forward([
147124
(
148125
predeposit_guarantee_proxy.address,
149126
predeposit_guarantee_proxy.proxy__upgradeTo.encode_input(PREDEPOSIT_GUARANTEE_NEW_IMPL),
150127
)
151128
]),
152129

153-
# 1.10. Temporarily grant `PausableUntilWithRoles.ResumeRole` `a79a6aede309e0d48bf2ef0f71355c06ad317956d4c0da2deb0dc47cc34f826c` on PredepositGuarantee `0xF4bF42c6D6A0E38825785048124DBAD6c9eaaac3` to Agent `0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c`
130+
# 1.8. Temporarily grant `PausableUntilWithRoles.ResumeRole` `a79a6aede309e0d48bf2ef0f71355c06ad317956d4c0da2deb0dc47cc34f826c` on PredepositGuarantee `0xF4bF42c6D6A0E38825785048124DBAD6c9eaaac3` to Agent `0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c`
154131
agent_forward([
155132
encode_oz_grant_role(predeposit_guarantee, "PausableUntilWithRoles.ResumeRole", AGENT)
156133
]),
157134

158-
# 1.11. Unpause PredepositGuarantee `0xF4bF42c6D6A0E38825785048124DBAD6c9eaaac3`
135+
# 1.9. Unpause PredepositGuarantee `0xF4bF42c6D6A0E38825785048124DBAD6c9eaaac3`
159136
agent_forward([
160137
(
161138
predeposit_guarantee_proxy.address,
162139
predeposit_guarantee.resume.encode_input(),
163140
)
164141
]),
165142

166-
# 1.12. Revoke `PausableUntilWithRoles.ResumeRole` `a79a6aede309e0d48bf2ef0f71355c06ad317956d4c0da2deb0dc47cc34f826c` on PredepositGuarantee `0xF4bF42c6D6A0E38825785048124DBAD6c9eaaac3` from Agent `0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c`
143+
# 1.10. Revoke `PausableUntilWithRoles.ResumeRole` `a79a6aede309e0d48bf2ef0f71355c06ad317956d4c0da2deb0dc47cc34f826c` on PredepositGuarantee `0xF4bF42c6D6A0E38825785048124DBAD6c9eaaac3` from Agent `0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c`
167144
agent_forward([
168145
encode_oz_revoke_role(predeposit_guarantee, "PausableUntilWithRoles.ResumeRole", AGENT)
169146
]),
170147

171-
# 1.13. Temporarily grant `STAKING_CONTROL_ROLE` `a42eee1333c0758ba72be38e728b6dadb32ea767de5b4ddbaea1dae85b1b051f` on Lido `0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84` to Agent `0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c`
148+
# ======================== Lido ========================
149+
# 1.11. Temporarily grant `STAKING_CONTROL_ROLE` `a42eee1333c0758ba72be38e728b6dadb32ea767de5b4ddbaea1dae85b1b051f` on Lido `0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84` to Agent `0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c`
172150
agent_forward([
173151
encode_permission_grant(lido, "STAKING_CONTROL_ROLE", AGENT)
174152
]),
175153

176-
# 1.14. Set max external ratio to `30%` on Lido `0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84`
154+
# 1.12. Set max external ratio to `30%` on Lido `0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84`
177155
agent_forward([
178156
(
179157
lido.address,
180158
lido.setMaxExternalRatioBP.encode_input(MAX_EXTERNAL_RATIO_BP),
181159
)
182160
]),
183161

184-
# 1.15. Revoke `STAKING_CONTROL_ROLE` a42eee1333c0758ba72be38e728b6dadb32ea767de5b4ddbaea1dae85b1b051f on Lido `0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84` from Agent `0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c`
162+
# 1.13. Revoke `STAKING_CONTROL_ROLE` a42eee1333c0758ba72be38e728b6dadb32ea767de5b4ddbaea1dae85b1b051f on Lido `0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84` from Agent `0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c`
185163
agent_forward([
186164
encode_permission_revoke(lido, "STAKING_CONTROL_ROLE", AGENT)
187165
]),
166+
167+
# ======================== CSM ========================
168+
# 1.14. Raise CSM (MODULE_ID = `3`) stake share limit from `500 BP` to `750 BP` and priority exit threshold from `625 BP` to `900 BP`
169+
agent_forward([
170+
(
171+
staking_router.address,
172+
staking_router.updateStakingModule.encode_input(
173+
CSM_MODULE_ID,
174+
CSM_MODULE_NEW_TARGET_SHARE_BP,
175+
CSM_MODULE_NEW_PRIORITY_EXIT_THRESHOLD_BP,
176+
CSM_MODULE_MODULE_FEE_BP,
177+
CSM_MODULE_TREASURY_FEE_BP,
178+
CSM_MODULE_MAX_DEPOSITS_PER_BLOCK,
179+
CSM_MODULE_MIN_DEPOSIT_BLOCK_DISTANCE,
180+
),
181+
),
182+
]),
183+
184+
# 1.15. Grant `MANAGE_FRAME_CONFIG_ROLE` `921f40f434e049d23969cbe68d9cf3ac1013fbe8945da07963af6f3142de6afe` on CS HashConsensus `0x71093efF8D8599b5fA340D665Ad60fA7C80688e4` to TwoPhaseFrameConfigUpdate contract `0xb2B4DB1491cbe949ae85EfF01E0d3ee239f110C1`
185+
agent_forward([
186+
encode_oz_grant_role(
187+
contract=cs_hash_consensus,
188+
role_name="MANAGE_FRAME_CONFIG_ROLE",
189+
grant_to=TWO_PHASE_FRAME_CONFIG_UPDATE,
190+
)
191+
]),
188192
]
189193

190194
dg_call_script = submit_proposals([

tests/test_2026_01_20.py

Lines changed: 81 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def dual_governance_proposal_calls():
121121
predeposit_guarantee = interface.PredepositGuarantee(PREDEPOSIT_GUARANTEE)
122122

123123
dg_items = [
124+
# ======================== EasyTrack ========================
124125
# 1.1. Revoke REGISTRY_ROLE on OperatorGrid from old VaultsAdapter
125126
agent_forward([
126127
encode_oz_revoke_role(operator_grid, "vaults.OperatorsGrid.Registry", OLD_VAULTS_ADAPTER)
@@ -151,74 +152,77 @@ def dual_governance_proposal_calls():
151152
encode_oz_grant_role(vault_hub, "vaults.VaultHub.BadDebtMasterRole", VAULTS_ADAPTER)
152153
]),
153154

154-
# 1.7. Raise CSM (MODULE_ID = 3) stake share limit from 500 BP to 750 BP and priority exit threshold from 625 BP to 900 BP
155-
agent_forward([
156-
(
157-
staking_router.address,
158-
staking_router.updateStakingModule.encode_input(
159-
CSM_MODULE_ID,
160-
CSM_MODULE_NEW_TARGET_SHARE_BP,
161-
CSM_MODULE_NEW_PRIORITY_EXIT_THRESHOLD_BP,
162-
CSM_MODULE_MODULE_FEE_BP,
163-
CSM_MODULE_TREASURY_FEE_BP,
164-
CSM_MODULE_MAX_DEPOSITS_PER_BLOCK,
165-
CSM_MODULE_MIN_DEPOSIT_BLOCK_DISTANCE,
166-
),
167-
),
168-
]),
169-
170-
# 1.8. Grant MANAGE_FRAME_CONFIG_ROLE on CS HashConsensus to TwoPhaseFrameConfigUpdate
171-
agent_forward([
172-
encode_oz_grant_role(
173-
contract=cs_hash_consensus,
174-
role_name="MANAGE_FRAME_CONFIG_ROLE",
175-
grant_to=TWO_PHASE_FRAME_CONFIG_UPDATE,
176-
)
177-
]),
178-
179-
# 1.9. Update PredepositGuarantee implementation
155+
# ======================== PDG ========================
156+
# 1.7. Update PredepositGuarantee implementation
180157
agent_forward([
181158
(
182159
predeposit_guarantee_proxy.address,
183160
predeposit_guarantee_proxy.proxy__upgradeTo.encode_input(PREDEPOSIT_GUARANTEE_NEW_IMPL),
184161
)
185162
]),
186163

187-
# 1.10. Grant RESUME_ROLE on PredepositGuarantee to Agent
164+
# 1.8. Grant RESUME_ROLE on PredepositGuarantee to Agent
188165
agent_forward([
189166
encode_oz_grant_role(predeposit_guarantee, "PausableUntilWithRoles.ResumeRole", AGENT)
190167
]),
191168

192-
# 1.11. Unpause PredepositGuarantee
169+
# 1.9. Unpause PredepositGuarantee
193170
agent_forward([
194171
(
195172
PREDEPOSIT_GUARANTEE,
196173
predeposit_guarantee.resume.encode_input(),
197174
)
198175
]),
199176

200-
# 1.12. Revoke RESUME_ROLE on PredepositGuarantee from Agent
177+
# 1.10. Revoke RESUME_ROLE on PredepositGuarantee from Agent
201178
agent_forward([
202179
encode_oz_revoke_role(predeposit_guarantee, "PausableUntilWithRoles.ResumeRole", AGENT)
203180
]),
204181

205-
# 1.13. Grant STAKING_CONTROL_ROLE on Lido to Agent
182+
# ======================== Lido ========================
183+
# 1.11. Grant STAKING_CONTROL_ROLE on Lido to Agent
206184
agent_forward([
207185
encode_permission_grant(lido, "STAKING_CONTROL_ROLE", AGENT)
208186
]),
209187

210-
# 1.14. Set max external ratio to 30%
188+
# 1.12. Set max external ratio to 30%
211189
agent_forward([
212190
(
213191
lido.address,
214192
lido.setMaxExternalRatioBP.encode_input(MAX_EXTERNAL_RATIO_BP),
215193
)
216194
]),
217195

218-
# 1.15. Revoke STAKING_CONTROL_ROLE on Lido from Agent
196+
# 1.13. Revoke STAKING_CONTROL_ROLE on Lido from Agent
219197
agent_forward([
220198
encode_permission_revoke(lido, "STAKING_CONTROL_ROLE", AGENT)
221199
]),
200+
201+
# ======================== CSM ========================
202+
# 1.14. Raise CSM (MODULE_ID = 3) stake share limit from 500 BP to 750 BP and priority exit threshold from 625 BP to 900 BP
203+
agent_forward([
204+
(
205+
staking_router.address,
206+
staking_router.updateStakingModule.encode_input(
207+
CSM_MODULE_ID,
208+
CSM_MODULE_NEW_TARGET_SHARE_BP,
209+
CSM_MODULE_NEW_PRIORITY_EXIT_THRESHOLD_BP,
210+
CSM_MODULE_MODULE_FEE_BP,
211+
CSM_MODULE_TREASURY_FEE_BP,
212+
CSM_MODULE_MAX_DEPOSITS_PER_BLOCK,
213+
CSM_MODULE_MIN_DEPOSIT_BLOCK_DISTANCE,
214+
),
215+
),
216+
]),
217+
218+
# 1.15. Grant MANAGE_FRAME_CONFIG_ROLE on CS HashConsensus to TwoPhaseFrameConfigUpdate
219+
agent_forward([
220+
encode_oz_grant_role(
221+
contract=cs_hash_consensus,
222+
role_name="MANAGE_FRAME_CONFIG_ROLE",
223+
grant_to=TWO_PHASE_FRAME_CONFIG_UPDATE,
224+
)
225+
]),
222226
]
223227

224228
# Convert each dg_item to the expected format
@@ -580,6 +584,7 @@ def test_vote(helpers, accounts, ldo_holder, vote_ids_from_env, stranger, dual_g
580584

581585
# === DG EXECUTION EVENTS VALIDATION ===
582586

587+
# ======================== EasyTrack items ========================
583588
# 1.1. Revoke REGISTRY_ROLE on OperatorGrid from old VaultsAdapter
584589
validate_revoke_role_event(
585590
dg_events[0],
@@ -634,82 +639,85 @@ def test_vote(helpers, accounts, ldo_holder, vote_ids_from_env, stranger, dual_g
634639
emitted_by=vault_hub,
635640
)
636641

637-
# 1.7. Validate CSM staking module update events
638-
validate_staking_module_update_event(
639-
event=dg_events[6],
640-
module_item=StakingModuleItem(
641-
id=CSM_MODULE_ID,
642-
address=None,
643-
name=CSM_MODULE_NAME,
644-
target_share=CSM_MODULE_NEW_TARGET_SHARE_BP,
645-
module_fee=CSM_MODULE_MODULE_FEE_BP,
646-
treasury_fee=CSM_MODULE_TREASURY_FEE_BP,
647-
priority_exit_share=CSM_MODULE_NEW_PRIORITY_EXIT_THRESHOLD_BP,
648-
),
649-
emitted_by=STAKING_ROUTER,
650-
)
651-
652-
# 1.8. Grant MANAGE_FRAME_CONFIG_ROLE on CS HashConsensus to TwoPhaseFrameConfigUpdate
653-
validate_grant_role_event(
654-
dg_events[7],
655-
role=manage_frame_config_role.hex(),
656-
grant_to=TWO_PHASE_FRAME_CONFIG_UPDATE,
657-
sender=AGENT,
658-
emitted_by=cs_hash_consensus,
659-
)
660-
661-
# 1.9. Validate PredepositGuarantee implementation upgrade
642+
# ======================== PDG items ========================
643+
# 1.7. Validate PredepositGuarantee implementation upgrade
662644
validate_proxy_upgrade_event(
663-
dg_events[8],
645+
dg_events[6],
664646
implementation=PREDEPOSIT_GUARANTEE_NEW_IMPL,
665647
emitted_by=PREDEPOSIT_GUARANTEE,
666648
)
667649

668-
# 1.10. Validate grant RESUME_ROLE on PredepositGuarantee to Agent
650+
# 1.8. Validate grant RESUME_ROLE on PredepositGuarantee to Agent
669651
validate_grant_role_event(
670-
dg_events[9],
652+
dg_events[7],
671653
role=resume_role.hex(),
672654
grant_to=AGENT,
673655
sender=AGENT,
674656
emitted_by=predeposit_guarantee,
675657
)
676658

677-
# 1.11. Validate PredepositGuarantee unpause (Resumed event)
678-
assert "Resumed" in dg_events[10], "No Resumed event found for PredepositGuarantee"
679-
assert dg_events[10]["Resumed"][0]["_emitted_by"] == PREDEPOSIT_GUARANTEE, "Wrong emitter for Resumed event"
659+
# 1.9. Validate PredepositGuarantee unpause (Resumed event)
660+
assert "Resumed" in dg_events[8], "No Resumed event found for PredepositGuarantee"
661+
assert dg_events[8]["Resumed"][0]["_emitted_by"] == PREDEPOSIT_GUARANTEE, "Wrong emitter for Resumed event"
680662

681-
# 1.12. Validate revoke RESUME_ROLE on PredepositGuarantee from Agent
663+
# 1.10. Validate revoke RESUME_ROLE on PredepositGuarantee from Agent
682664
validate_revoke_role_event(
683-
dg_events[11],
665+
dg_events[9],
684666
role=resume_role.hex(),
685667
revoke_from=AGENT,
686668
sender=AGENT,
687669
emitted_by=predeposit_guarantee,
688670
)
689671

690-
# 1.13. Validate grant STAKING_CONTROL_ROLE on Lido to Agent
672+
# ======================== External share items ========================
673+
# 1.11. Validate grant STAKING_CONTROL_ROLE on Lido to Agent
691674
validate_aragon_grant_permission_event(
692-
dg_events[12],
675+
dg_events[10],
693676
entity=AGENT,
694677
app=LIDO,
695678
role=staking_control_role.hex(),
696679
emitted_by=ACL,
697680
)
698681

699-
# 1.14. Validate MaxExternalRatioBPSet event
700-
assert "MaxExternalRatioBPSet" in dg_events[13], "No MaxExternalRatioBPSet event found"
701-
assert dg_events[13]["MaxExternalRatioBPSet"]["maxExternalRatioBP"] == MAX_EXTERNAL_RATIO_BP, "Wrong max external ratio in event"
702-
assert dg_events[13]["MaxExternalRatioBPSet"]["_emitted_by"] == LIDO, "Wrong event emitter for MaxExternalRatioBPSet"
682+
# 1.12. Validate MaxExternalRatioBPSet event
683+
assert "MaxExternalRatioBPSet" in dg_events[11], "No MaxExternalRatioBPSet event found"
684+
assert dg_events[11]["MaxExternalRatioBPSet"]["maxExternalRatioBP"] == MAX_EXTERNAL_RATIO_BP, "Wrong max external ratio in event"
685+
assert dg_events[11]["MaxExternalRatioBPSet"]["_emitted_by"] == LIDO, "Wrong event emitter for MaxExternalRatioBPSet"
703686

704-
# 1.15. Validate revoke STAKING_CONTROL_ROLE on Lido from Agent
687+
# 1.13. Validate revoke STAKING_CONTROL_ROLE on Lido from Agent
705688
validate_aragon_revoke_permission_event(
706-
dg_events[14],
689+
dg_events[12],
707690
entity=AGENT,
708691
app=LIDO,
709692
role=staking_control_role.hex(),
710693
emitted_by=ACL,
711694
)
712695

696+
# ======================== CSM items ========================
697+
# 1.14. Validate CSM staking module update events
698+
validate_staking_module_update_event(
699+
event=dg_events[13],
700+
module_item=StakingModuleItem(
701+
id=CSM_MODULE_ID,
702+
address=None,
703+
name=CSM_MODULE_NAME,
704+
target_share=CSM_MODULE_NEW_TARGET_SHARE_BP,
705+
module_fee=CSM_MODULE_MODULE_FEE_BP,
706+
treasury_fee=CSM_MODULE_TREASURY_FEE_BP,
707+
priority_exit_share=CSM_MODULE_NEW_PRIORITY_EXIT_THRESHOLD_BP,
708+
),
709+
emitted_by=STAKING_ROUTER,
710+
)
711+
712+
# 1.15. Grant MANAGE_FRAME_CONFIG_ROLE on CS HashConsensus to TwoPhaseFrameConfigUpdate
713+
validate_grant_role_event(
714+
dg_events[14],
715+
role=manage_frame_config_role.hex(),
716+
grant_to=TWO_PHASE_FRAME_CONFIG_UPDATE,
717+
sender=AGENT,
718+
emitted_by=cs_hash_consensus,
719+
)
720+
713721

714722
# =========================================================================
715723
# ==================== After DG proposal executed checks ==================

0 commit comments

Comments
 (0)