Skip to content

Commit 1424565

Browse files
authored
Merge pull request #584 from lidofinance/feat/v3-phase-2-ci
feat: Lido V3 CI tests
2 parents 21fc3e9 + 192e887 commit 1424565

File tree

4 files changed

+44
-33
lines changed

4 files changed

+44
-33
lines changed

configs/config_mainnet.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@
182182
CS_MODULE_NAME = "Community Staking"
183183
CS_MODULE_MODULE_FEE_BP = 600
184184
CS_MODULE_TREASURY_FEE_BP = 400
185-
CS_MODULE_TARGET_SHARE_BP = 500
186-
CS_MODULE_PRIORITY_EXIT_SHARE_THRESHOLD = 625
185+
CS_MODULE_TARGET_SHARE_BP = 750
186+
CS_MODULE_PRIORITY_EXIT_SHARE_THRESHOLD = 900
187187
CS_MODULE_MAX_DEPOSITS_PER_BLOCK = 30
188188
CS_MODULE_MIN_DEPOSIT_BLOCK_DISTANCE = 25
189189

@@ -407,6 +407,7 @@
407407
CS_PERMISSIONLESS_GATE_ADDRESS = "0xcF33a38111d0B1246A3F38a838fb41D626B454f0"
408408
CS_VERIFIER_V2_ADDRESS = "0xdC5FE1782B6943f318E05230d688713a560063DC"
409409
CS_GATE_SEAL_V2_ADDRESS = "0xE1686C2E90eb41a48356c1cC7FaA17629af3ADB3"
410+
TWO_PHASE_FRAME_CONFIG_UPDATE = "0xb2B4DB1491cbe949ae85EfF01E0d3ee239f110C1"
410411

411412
# DualGovernance
412413
DUAL_GOVERNANCE = "0xC1db28B3301331277e307FDCfF8DE28242A4486E"
@@ -530,7 +531,7 @@
530531
OPERATOR_GRID = "0xC69685E89Cefc327b43B7234AC646451B27c544d"
531532
LAZY_ORACLE = "0x5DB427080200c235F2Ae8Cd17A7be87921f7AD6c"
532533
PREDEPOSIT_GUARANTEE = "0xF4bF42c6D6A0E38825785048124DBAD6c9eaaac3"
533-
VAULTS_ADAPTER = "0xe2DE6d2DefF15588a71849c0429101F8ca9FB14D"
534+
VAULTS_ADAPTER = "0x28F9Ac198C4E0FA6A9Ad2c2f97CB38F1A3120f27"
534535
GATE_SEAL_V3 = "0x881dAd714679A6FeaA636446A0499101375A365c"
535536
STAKING_VAULT_BEACON = "0x5FbE8cEf9CCc56ad245736D3C5bAf82ad54Ca789"
536537

tests/regression/test_gate_seal.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,6 @@ def test_gate_seal_v3_vaults_scenario(gate_seal_committee):
357357

358358
pause_duration = gate_seal_v3.get_seal_duration_seconds()
359359

360-
# TODO remove this after PDG unpause
361-
reseal_manager_account = accounts.at(RESEAL_MANAGER, force=True)
362-
contracts.predeposit_guarantee.resume({"from": reseal_manager_account})
363-
364360
assert not contracts.vault_hub.isPaused()
365361
assert not contracts.predeposit_guarantee.isPaused()
366362

tests/regression/test_permissions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@
7272
VAULTS_ADAPTER,
7373
GATE_SEAL_V3,
7474
L1_TOKEN_RATE_NOTIFIER,
75-
STAKING_VAULT_BEACON
75+
STAKING_VAULT_BEACON,
76+
TWO_PHASE_FRAME_CONFIG_UPDATE
7677
)
7778

7879

@@ -399,7 +400,7 @@ def protocol_permissions():
399400
"DEFAULT_ADMIN_ROLE": [contracts.agent],
400401
"MANAGE_MEMBERS_AND_QUORUM_ROLE": [contracts.agent],
401402
"DISABLE_CONSENSUS_ROLE": [],
402-
"MANAGE_FRAME_CONFIG_ROLE": [],
403+
"MANAGE_FRAME_CONFIG_ROLE": [TWO_PHASE_FRAME_CONFIG_UPDATE],
403404
"MANAGE_FAST_LANE_CONFIG_ROLE": [],
404405
"MANAGE_REPORT_PROCESSOR_ROLE": [],
405406
},

tests/snapshot/test_lido_snapshot.py

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pytest
77
from brownie import ZERO_ADDRESS, chain, web3, accounts
88
from brownie.network.account import Account
9+
from hexbytes import HexBytes
910
from pytest_check import check
1011
from web3.types import Wei
1112

@@ -36,6 +37,11 @@ class Frame(TypedDict):
3637

3738

3839
EXPECTED_SNAPSHOT_DIFFS: dict[str, Any] = {
40+
# Max external ratio is changed from 3% (300 BP) to 30% (3000 BP) in the upgrade
41+
"lido.Lido.lidoLocatorAndMaxExternalRatio": (
42+
HexBytes("0x00000000000000000000012cc1d0b3de6792bf6b4b37eccdcc24e45978cfd2eb"),
43+
HexBytes("0x000000000000000000000bb8c1d0b3de6792bf6b4b37eccdcc24e45978cfd2eb"),
44+
),
3945
}
4046

4147

@@ -417,36 +423,43 @@ def _actions_snaps(builder_arg: Account | None):
417423
func=repr(action_fn),
418424
)
419425

420-
contracts.acl.grantPermission(
421-
contracts.agent,
422-
contracts.lido,
423-
contracts.lido.PAUSE_ROLE(),
424-
{"from": contracts.agent},
425-
)
426-
contracts.acl.grantPermission(
427-
contracts.agent,
428-
contracts.lido,
429-
contracts.lido.RESUME_ROLE(),
430-
{"from": contracts.agent},
431-
)
432-
contracts.acl.grantPermission(
433-
contracts.agent,
434-
contracts.lido,
435-
contracts.lido.STAKING_PAUSE_ROLE(),
436-
{"from": contracts.agent},
437-
)
438-
contracts.acl.grantPermission(
439-
contracts.agent,
440-
contracts.lido,
441-
contracts.lido.STAKING_CONTROL_ROLE(),
442-
{"from": contracts.agent},
443-
)
426+
def _grant_lido_permissions():
427+
"""Grant necessary permissions to agent for Lido operations"""
428+
contracts.acl.grantPermission(
429+
contracts.agent,
430+
contracts.lido,
431+
contracts.lido.PAUSE_ROLE(),
432+
{"from": contracts.agent},
433+
)
434+
contracts.acl.grantPermission(
435+
contracts.agent,
436+
contracts.lido,
437+
contracts.lido.RESUME_ROLE(),
438+
{"from": contracts.agent},
439+
)
440+
contracts.acl.grantPermission(
441+
contracts.agent,
442+
contracts.lido,
443+
contracts.lido.STAKING_PAUSE_ROLE(),
444+
{"from": contracts.agent},
445+
)
446+
contracts.acl.grantPermission(
447+
contracts.agent,
448+
contracts.lido,
449+
contracts.lido.STAKING_CONTROL_ROLE(),
450+
{"from": contracts.agent},
451+
)
452+
453+
_grant_lido_permissions()
444454

445455
with _chain_snapshot():
446456
v1_frames = tuple(_actions_snaps(contracts.agent))
447457

448458
execute_vote_and_process_dg_proposals(helpers, vote_ids_from_env, dg_proposal_ids_from_env)
449459

460+
# Re-grant permissions after upgrade as some may have been revoked
461+
_grant_lido_permissions()
462+
450463
v2_frames = tuple(_actions_snaps(contracts.agent))
451464

452465
return v1_frames, v2_frames

0 commit comments

Comments
 (0)