Skip to content

Conversation

sandstone-ag
Copy link

Add Dual Governance to protocol scratch deploy

Context

After the deployment of Dual Governance on Lido mainnet we need to add the DG deployment to protocol scratch deploy routine.

Problem

DAO-654
After the deployment of Dual Governance on Lido mainnet we need to add the DG deployment to protocol scratch deploy routine.

Solution

Added DG to scratch deployment

@tamtamchik tamtamchik requested a review from arwer13 August 26, 2025 19:35
@sandstone-ag sandstone-ag force-pushed the feat/dg-scratch-deployment branch from 466b5f6 to e60b63d Compare August 28, 2025 13:52
@sandstone-ag sandstone-ag force-pushed the feat/dg-scratch-deployment branch from e60b63d to d7844ec Compare September 12, 2025 17:22
Copy link

github-actions bot commented Sep 12, 2025

badge

Hardhat Unit Tests Coverage Summary

Filename                                                                Stmts    Miss  Cover    Missing
--------------------------------------------------------------------  -------  ------  -------  -----------------------------------------------------------------------------------------------------
contracts/0.4.24/Lido.sol                                                 279      11  96.06%   809-828, 924-936
contracts/0.4.24/StETH.sol                                                 79       0  100.00%
contracts/0.4.24/StETHPermit.sol                                           15       0  100.00%
contracts/0.4.24/lib/Packed64x4.sol                                         5       0  100.00%
contracts/0.4.24/lib/SigningKeys.sol                                       36       0  100.00%
contracts/0.4.24/lib/StakeLimitUtils.sol                                   37       0  100.00%
contracts/0.4.24/nos/NodeOperatorsRegistry.sol                            436       0  100.00%
contracts/0.4.24/utils/Pausable.sol                                         9       0  100.00%
contracts/0.4.24/utils/UnstructuredStorageExt.sol                          14       0  100.00%
contracts/0.4.24/utils/Versioned.sol                                        5       0  100.00%
contracts/0.6.12/WstETH.sol                                                17       0  100.00%
contracts/0.8.25/ValidatorExitDelayVerifier.sol                            75       0  100.00%
contracts/0.8.25/utils/AccessControlConfirmable.sol                         2       0  100.00%
contracts/0.8.25/utils/Confirmable2Addresses.sol                            5       0  100.00%
contracts/0.8.25/utils/Confirmations.sol                                   37       0  100.00%
contracts/0.8.25/utils/PausableUntilWithRoles.sol                           3       0  100.00%
contracts/0.8.25/utils/V3TemporaryAdmin.sol                                52      52  0.00%    83-218
contracts/0.8.25/vaults/LazyOracle.sol                                    118      13  88.98%   221, 259-262, 388, 400, 416, 463, 503-505, 580, 588
contracts/0.8.25/vaults/OperatorGrid.sol                                  189       0  100.00%
contracts/0.8.25/vaults/PinnedBeaconProxy.sol                               6       0  100.00%
contracts/0.8.25/vaults/StakingVault.sol                                  111      14  87.39%   307-341
contracts/0.8.25/vaults/ValidatorConsolidationRequests.sol                 48       3  93.75%   183, 187, 199
contracts/0.8.25/vaults/VaultFactory.sol                                   35       0  100.00%
contracts/0.8.25/vaults/VaultHub.sol                                      412      80  80.58%   247-256, 271-277, 321-342, 358, 443, 521-522, 564-657, 956-958, 1040-1046, 1100, 1155-1162, 1448-1466
contracts/0.8.25/vaults/dashboard/Dashboard.sol                           119       6  94.96%   174-184, 576-589
contracts/0.8.25/vaults/dashboard/NodeOperatorFee.sol                      64       0  100.00%
contracts/0.8.25/vaults/dashboard/Permissions.sol                          48       2  95.83%   339-348
contracts/0.8.25/vaults/interfaces/IPinnedBeaconProxy.sol                   0       0  100.00%
contracts/0.8.25/vaults/interfaces/IPredepositGuarantee.sol                 0       0  100.00%
contracts/0.8.25/vaults/interfaces/IStakingVault.sol                        0       0  100.00%
contracts/0.8.25/vaults/interfaces/IVaultFactory.sol                        0       0  100.00%
contracts/0.8.25/vaults/lib/PinnedBeaconUtils.sol                           5       0  100.00%
contracts/0.8.25/vaults/lib/RecoverTokens.sol                               5       0  100.00%
contracts/0.8.25/vaults/lib/RefSlotCache.sol                               36       0  100.00%
contracts/0.8.25/vaults/predeposit_guarantee/CLProofVerifier.sol           16       1  93.75%   214
contracts/0.8.25/vaults/predeposit_guarantee/MeIfNobodyElse.sol             3       0  100.00%
contracts/0.8.25/vaults/predeposit_guarantee/PredepositGuarantee.sol      212      12  94.34%   449-469, 502, 639, 646, 668
contracts/0.8.9/Accounting.sol                                             93       2  97.85%   342-343
contracts/0.8.9/BeaconChainDepositor.sol                                   21       2  90.48%   48, 51
contracts/0.8.9/Burner.sol                                                 92       0  100.00%
contracts/0.8.9/DepositSecurityModule.sol                                 128       0  100.00%
contracts/0.8.9/EIP712StETH.sol                                            16       0  100.00%
contracts/0.8.9/LidoExecutionLayerRewardsVault.sol                         16       0  100.00%
contracts/0.8.9/LidoLocator.sol                                            26       0  100.00%
contracts/0.8.9/OracleDaemonConfig.sol                                     28       0  100.00%
contracts/0.8.9/StakingRouter.sol                                         305       0  100.00%
contracts/0.8.9/TriggerableWithdrawalsGateway.sol                          54       1  98.15%   271
contracts/0.8.9/WithdrawalQueue.sol                                        88       0  100.00%
contracts/0.8.9/WithdrawalQueueBase.sol                                   146       0  100.00%
contracts/0.8.9/WithdrawalQueueERC721.sol                                  89       0  100.00%
contracts/0.8.9/WithdrawalVault.sol                                        32       0  100.00%
contracts/0.8.9/WithdrawalVaultEIP7002.sol                                 21       0  100.00%
contracts/0.8.9/lib/ExitLimitUtils.sol                                     35       0  100.00%
contracts/0.8.9/lib/Math.sol                                                4       0  100.00%
contracts/0.8.9/lib/PositiveTokenRebaseLimiter.sol                         22       0  100.00%
contracts/0.8.9/lib/UnstructuredRefStorage.sol                              2       0  100.00%
contracts/0.8.9/oracle/AccountingOracle.sol                               173       0  100.00%
contracts/0.8.9/oracle/BaseOracle.sol                                      89       1  98.88%   401
contracts/0.8.9/oracle/HashConsensus.sol                                  263       1  99.62%   1005
contracts/0.8.9/oracle/ValidatorsExitBus.sol                              138      10  92.75%   458-471, 541
contracts/0.8.9/oracle/ValidatorsExitBusOracle.sol                         52       1  98.08%   217
contracts/0.8.9/proxy/OssifiableProxy.sol                                  17       0  100.00%
contracts/0.8.9/proxy/WithdrawalsManagerProxy.sol                          60       0  100.00%
contracts/0.8.9/sanity_checks/OracleReportSanityChecker.sol               232      12  94.83%   305-307, 598-603, 798-833, 954
contracts/0.8.9/utils/DummyEmptyContract.sol                                0       0  100.00%
contracts/0.8.9/utils/PausableUntil.sol                                    31       0  100.00%
contracts/0.8.9/utils/Versioned.sol                                        11       0  100.00%
contracts/0.8.9/utils/access/AccessControl.sol                             23       0  100.00%
contracts/0.8.9/utils/access/AccessControlEnumerable.sol                    9       0  100.00%
contracts/common/utils/PausableUntil.sol                                   29       0  100.00%
TOTAL                                                                    4878     224  95.41%

Diff against master

Filename                                                                Stmts    Miss  Cover
--------------------------------------------------------------------  -------  ------  --------
contracts/0.4.24/Lido.sol                                                 +67     +11  -3.94%
contracts/0.4.24/StETH.sol                                                 +7       0  +100.00%
contracts/0.4.24/nos/NodeOperatorsRegistry.sol                            -76       0  +100.00%
contracts/0.4.24/utils/UnstructuredStorageExt.sol                         +14       0  +100.00%
contracts/0.8.25/ValidatorExitDelayVerifier.sol                           +75       0  +100.00%
contracts/0.8.25/utils/AccessControlConfirmable.sol                        +2       0  +100.00%
contracts/0.8.25/utils/Confirmable2Addresses.sol                           +5       0  +100.00%
contracts/0.8.25/utils/Confirmations.sol                                  +37       0  +100.00%
contracts/0.8.25/utils/PausableUntilWithRoles.sol                          +3       0  +100.00%
contracts/0.8.25/utils/V3TemporaryAdmin.sol                               +52     +52  +100.00%
contracts/0.8.25/vaults/LazyOracle.sol                                   +118     +13  +88.98%
contracts/0.8.25/vaults/OperatorGrid.sol                                 +189       0  +100.00%
contracts/0.8.25/vaults/PinnedBeaconProxy.sol                              +6       0  +100.00%
contracts/0.8.25/vaults/StakingVault.sol                                 +111     +14  +87.39%
contracts/0.8.25/vaults/ValidatorConsolidationRequests.sol                +48      +3  +93.75%
contracts/0.8.25/vaults/VaultFactory.sol                                  +35       0  +100.00%
contracts/0.8.25/vaults/VaultHub.sol                                     +412     +80  +80.58%
contracts/0.8.25/vaults/dashboard/Dashboard.sol                          +119      +6  +94.96%
contracts/0.8.25/vaults/dashboard/NodeOperatorFee.sol                     +64       0  +100.00%
contracts/0.8.25/vaults/dashboard/Permissions.sol                         +48      +2  +95.83%
contracts/0.8.25/vaults/interfaces/IPinnedBeaconProxy.sol                   0       0  +100.00%
contracts/0.8.25/vaults/interfaces/IPredepositGuarantee.sol                 0       0  +100.00%
contracts/0.8.25/vaults/interfaces/IStakingVault.sol                        0       0  +100.00%
contracts/0.8.25/vaults/interfaces/IVaultFactory.sol                        0       0  +100.00%
contracts/0.8.25/vaults/lib/PinnedBeaconUtils.sol                          +5       0  +100.00%
contracts/0.8.25/vaults/lib/RecoverTokens.sol                              +5       0  +100.00%
contracts/0.8.25/vaults/lib/RefSlotCache.sol                              +36       0  +100.00%
contracts/0.8.25/vaults/predeposit_guarantee/CLProofVerifier.sol          +16      +1  +93.75%
contracts/0.8.25/vaults/predeposit_guarantee/MeIfNobodyElse.sol            +3       0  +100.00%
contracts/0.8.25/vaults/predeposit_guarantee/PredepositGuarantee.sol     +212     +12  +94.34%
contracts/0.8.9/Accounting.sol                                            +93      +2  +97.85%
contracts/0.8.9/Burner.sol                                                +21       0  +100.00%
contracts/0.8.9/LidoLocator.sol                                            +8       0  +100.00%
contracts/0.8.9/StakingRouter.sol                                         -11       0  +100.00%
contracts/0.8.9/TriggerableWithdrawalsGateway.sol                         +54      +1  +98.15%
contracts/0.8.9/WithdrawalVault.sol                                       +11       0  +100.00%
contracts/0.8.9/WithdrawalVaultEIP7002.sol                                +21       0  +100.00%
contracts/0.8.9/lib/ExitLimitUtils.sol                                    +35       0  +100.00%
contracts/0.8.9/oracle/AccountingOracle.sol                               -17      -2  +1.05%
contracts/0.8.9/oracle/ValidatorsExitBus.sol                             +138     +10  +92.75%
contracts/0.8.9/oracle/ValidatorsExitBusOracle.sol                        -39      -1  +0.28%
contracts/0.8.9/proxy/WithdrawalsManagerProxy.sol                         +60       0  +100.00%
contracts/0.8.9/sanity_checks/OracleReportSanityChecker.sol                 0     +12  -5.17%
contracts/common/utils/PausableUntil.sol                                  +29       0  +100.00%
TOTAL                                                                   +2016    +216  -3.63%

Results for commit: e54cd83

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Contributor

@arwer13 arwer13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work!

I see these follow ups:

  1. Rebase on up-to-date vaults branch #1287

  2. Add integration which verifies dual governance upgrade pass (for any dummy one). Boilerplates for the voting script (contract) is in the vaults branch as well. At the moment it won't work because proper roles distribution (in LidoTemplate.sol) is missing.

  3. Make sure no-DG setup is also operational. It is at the moment, but after the roles tinkering there gonna be two Aragon roles configuration. Actually, I'm not 100% sure we optional DG installation is worth the effort, but likely it is. To simplify we can split LidoTemplate into LidoTemplateBase, LidoTemplate and LidoTemplateWithDG - it seems not much work. But for the integration tests and for the utility contracts/scripts which do an upgrade there must be two setups to support in this case. Wdyt @tamtamchik ?

networkState[Sk.dualGovernanceConfig].dual_governance.sanity_check_params.min_withdrawals_batch_size,
},
},
dual_governance_config_provider: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just

Suggested change
dual_governance_config_provider: {
dual_governance_config_provider: networkState[Sk.dualGovernanceConfig].dual_governance_config_provider

here and similar places, why not?

}
}

async function runCommand(command: string, workingDirectory: string) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runCommand duplicates here and in dg-installation.ts . May move to lib/subprocess.ts or some other lib file

@tamtamchik
Copy link
Member

Make sure no-DG setup is also operational. It is at the moment, but after the roles tinkering there gonna be two Aragon roles configuration. Actually, I'm not 100% sure we optional DG installation is worth the effort, but likely it is. To simplify we can split LidoTemplate into LidoTemplateBase, LidoTemplate and LidoTemplateWithDG - it seems not much work. But for the integration tests and for the utility contracts/scripts which do an upgrade there must be two setups to support in this case. Wdyt @tamtamchik ?

Agree, we need no-DG setup also for some devnets to simplify operational work when DG not related to the scope of changes.

@tamtamchik tamtamchik added infrastructure Infrastructure changes refactoring Quality improving code changes labels Sep 24, 2025
@sandstone-ag sandstone-ag force-pushed the feat/dg-scratch-deployment branch from 2e73c48 to 4b6dc09 Compare September 29, 2025 08:37
@sandstone-ag sandstone-ag changed the base branch from master to feat/vaults September 29, 2025 08:37
@sandstone-ag sandstone-ag marked this pull request as ready for review September 29, 2025 08:51
@sandstone-ag sandstone-ag requested a review from a team as a code owner September 29, 2025 08:51
@sandstone-ag sandstone-ag requested a review from a team as a code owner September 29, 2025 13:57
@sandstone-ag sandstone-ag force-pushed the feat/dg-scratch-deployment branch from c732df7 to ea79118 Compare September 29, 2025 14:02
@sandstone-ag sandstone-ag force-pushed the feat/dg-scratch-deployment branch 2 times, most recently from fb6aefd to 673d745 Compare September 29, 2025 17:41
@sandstone-ag sandstone-ag force-pushed the feat/dg-scratch-deployment branch 2 times, most recently from 8b44c84 to b4e43e0 Compare September 30, 2025 08:07
@sandstone-ag sandstone-ag force-pushed the feat/dg-scratch-deployment branch from b4e43e0 to d8f4ffd Compare September 30, 2025 08:12
@sandstone-ag sandstone-ag force-pushed the feat/dg-scratch-deployment branch from b791b52 to e54cd83 Compare September 30, 2025 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Infrastructure changes refactoring Quality improving code changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants