Skip to content

Conversation

@arwer13
Copy link
Contributor

@arwer13 arwer13 commented Nov 9, 2025

No description provided.

@arwer13 arwer13 requested a review from a team as a code owner November 9, 2025 20:20
@github-actions
Copy link

github-actions bot commented Nov 9, 2025

badge

Hardhat Unit Tests Coverage Summary

Filename                                                                Stmts    Miss  Cover    Missing
--------------------------------------------------------------------  -------  ------  -------  -----------------------------------------------------------------------------------------------------------
contracts/0.4.24/Lido.sol                                                 281      11  96.09%   825-844, 940-952
contracts/0.4.24/StETH.sol                                                 80       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                                   41       0  100.00%
contracts/0.4.24/nos/NodeOperatorsRegistry.sol                            435       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                                50      50  0.00%    90-222
contracts/0.8.25/vaults/LazyOracle.sol                                    134      18  86.57%   203-209, 248, 276-279, 436, 449, 467, 515, 556-558, 650, 658
contracts/0.8.25/vaults/OperatorGrid.sol                                  191       1  99.48%   203
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                                   34       0  100.00%
contracts/0.8.25/vaults/VaultHub.sol                                      425      76  82.12%   257-266, 281-287, 342-366, 383, 552-553, 595-688, 997-999, 1087-1091, 1147, 1202-1209, 1495-1496, 1511-1521
contracts/0.8.25/vaults/dashboard/Dashboard.sol                           137       8  94.16%   183-201, 327, 636-649
contracts/0.8.25/vaults/dashboard/NodeOperatorFee.sol                      70       0  100.00%
contracts/0.8.25/vaults/dashboard/Permissions.sol                          46       2  95.65%   312-321
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      213      12  94.37%   482-502, 531, 670, 677, 699
contracts/0.8.9/Accounting.sol                                             95       2  97.89%   349-350
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                               174       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%   307-309, 600-605, 800-835, 956
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                                                                    4938     226  95.42%

Diff against master

Filename                                                                Stmts    Miss  Cover
--------------------------------------------------------------------  -------  ------  --------
contracts/0.4.24/Lido.sol                                                 +69     +11  -3.91%
contracts/0.4.24/StETH.sol                                                 +8       0  +100.00%
contracts/0.4.24/lib/StakeLimitUtils.sol                                   +4       0  +100.00%
contracts/0.4.24/utils/UnstructuredStorageExt.sol                         +14       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                               +50     +50  +100.00%
contracts/0.8.25/vaults/LazyOracle.sol                                   +134     +18  +86.57%
contracts/0.8.25/vaults/OperatorGrid.sol                                 +191      +1  +99.48%
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                                  +34       0  +100.00%
contracts/0.8.25/vaults/VaultHub.sol                                     +425     +76  +82.12%
contracts/0.8.25/vaults/dashboard/Dashboard.sol                          +137      +8  +94.16%
contracts/0.8.25/vaults/dashboard/NodeOperatorFee.sol                     +70       0  +100.00%
contracts/0.8.25/vaults/dashboard/Permissions.sol                         +46      +2  +95.65%
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     +213     +12  +94.37%
contracts/0.8.9/Accounting.sol                                            +95      +2  +97.89%
contracts/0.8.9/Burner.sol                                                +21       0  +100.00%
contracts/0.8.9/LidoLocator.sol                                            +6       0  +100.00%
contracts/0.8.9/oracle/AccountingOracle.sol                               -19       0  +100.00%
contracts/0.8.9/oracle/ValidatorsExitBus.sol                                0      +9  -6.53%
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                                                                   +1864    +219  -1.90%

Results for commit: 461ad23

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Base automatically changed from feat/audit-10 to feat/vaults November 10, 2025 10:26
@tamtamchik tamtamchik requested a review from Copilot November 10, 2025 17:15
Comment on lines 11 to 12
import {Duration} from "./utils/Duration.sol";
import {Timestamp} from "./utils/Timestamp.sol";
Copy link
Member

Choose a reason for hiding this comment

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

Do we need a Duration and Timestamp here? Looks like we can just use plain types uint32 and uint40?

Copy link
Member

Choose a reason for hiding this comment

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

Do we need to remove the file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No more V3 upgrades on Hoodi, so why keep it?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the V3 upgrade mechanism to use a time-based constraint system instead of a simple expiration timestamp. The upgrade can now only be executed within specific time windows, enforced by a predeployed TimeConstraints contract.

  • Replaces the simple EXPIRE_SINCE_INCLUSIVE timestamp with a comprehensive time constraint system that includes disabled before/after dates and daily time windows
  • Adds new vote script actions for treasury transfers, staking module updates, and Easy Track registry configuration
  • Removes support for the Hoodi testnet configuration
  • Refactors time delay calculations to fetch values dynamically rather than caching them

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
contracts/upgrade/V3Template.sol Replaces expiration timestamp with time constraint parameters (DISABLED_BEFORE, DISABLED_AFTER, ENABLED_DAY_SPAN_START, ENABLED_DAY_SPAN_END)
contracts/upgrade/V3VoteScript.sol Adds time constraint checks, treasury transfer actions, staking module updates, and Easy Track registry configuration to vote items
contracts/upgrade/V3Addresses.sol Adds treasury transfer and TRP-related parameters to the addresses struct
contracts/upgrade/utils/Timestamp.sol Introduces new Timestamp user-defined type with comparison operations and helper functions
contracts/upgrade/utils/Duration.sol Introduces new Duration user-defined type with arithmetic operations and conversion utilities
scripts/upgrade/steps/0200-deploy-v3-upgrading-contracts.ts Updates deployment script to pass new parameters including time constraints to V3Template and V3VoteScript
scripts/upgrade/steps/0500-mock-v3-aragon-voting.ts Adds helper functions to calculate valid upgrade timestamps and set blockchain time accordingly for tests
scripts/upgrade/steps/0100-deploy-v3-contracts.ts Updates OracleReportSanityChecker deployment to use new simulatedShareRateDeviationBPLimit parameter
scripts/upgrade/upgrade-params-mainnet.toml Adds comprehensive configuration for sanity checker, staking module, treasury transfers, Easy Track TRP registry, and time constraints
scripts/upgrade/upgrade-params-hoodi.toml Removes Hoodi testnet configuration file entirely
scripts/utils/upgrade.ts Refactors to fetch timelock delays dynamically instead of caching them
lib/config-schemas.ts Updates schema to include sanityChecker, timeConstraints, and additional v3VoteScript parameters
tasks/validate-configs.ts Adds validation rules for new configuration parameters in the expected missing list
test/integration/upgrade/upgrade-template-v3.integration.ts Updates tests to use setValidUpgradeTimestamp helper and adds tests for time constraint immutables
package.json Removes test scripts for Hoodi testnet configuration
.gitmodules Adds dual-governance submodule reference

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

let agentSigner: HardhatEthersSigner;
let agentMock: V3Template__Harness;

// Helper function to set timestamp within valid upgrade window
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

The comment "Helper function to set timestamp within valid upgrade window" is misleading as it's placed above the before hook which doesn't call the helper function setValidUpgradeTimestamp. The actual calls to the helper are in the individual tests. Consider removing this comment or moving it to where the function is defined/called.

Suggested change
// Helper function to set timestamp within valid upgrade window

Copilot uses AI. Check for mistakes.
package.json Outdated
"test:integration:upgrade:helper-hoodi": "cp deployed-hoodi.json deployed-hoodi-upgrade.json && NETWORK_STATE_FILE=deployed-hoodi-upgrade.json UPGRADE_PARAMETERS_FILE=scripts/upgrade/upgrade-params-hoodi.toml MODE=forking UPGRADE=true GAS_PRIORITY_FEE=1 GAS_MAX_FEE=100 DEPLOYER=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 hardhat test --trace --disabletracer",
"test:integration:upgrade-template": "cp deployed-mainnet.json deployed-mainnet-upgrade.json && NETWORK_STATE_FILE=deployed-mainnet-upgrade.json UPGRADE_PARAMETERS_FILE=scripts/upgrade/upgrade-params-mainnet.toml MODE=forking TEMPLATE_TEST=true GAS_PRIORITY_FEE=1 GAS_MAX_FEE=100 DEPLOYER=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 hardhat test test/integration/upgrade/*.ts --fulltrace --disabletracer",
"test:integration:scratch": "DEPLOYER=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 SKIP_INTERFACES_CHECK=true SKIP_CONTRACT_SIZE=true SKIP_GAS_REPORT=true GENESIS_TIME=1639659600 GAS_PRIORITY_FEE=1 GAS_MAX_FEE=100 yarn test:integration:scratch:helper test/integration/**/*.ts",
"test:integration:upgrade-template-hoodi": "cp deployed-hoodi.json deployed-hoodi-upgrade.json && NETWORK_STATE_FILE=deployed-hoodi-upgrade.json UPGRADE_PARAMETERS_FILE=scripts/upgrade/upgrade-params-hoodi.toml MODE=forking TEMPLATE_TEST=true GAS_PRIORITY_FEE=1 GAS_MAX_FEE=100 DEPLOYER=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 hardhat test test/integration/upgrade/*.ts --fulltrace --disabletracer",
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

The script test:integration:upgrade-template-hoodi at line 39 references UPGRADE_PARAMETERS_FILE=scripts/upgrade/upgrade-params-hoodi.toml, but the upgrade-params-hoodi.toml file has been deleted in this PR. This script should either be removed or updated to use a different configuration file.

Suggested change
"test:integration:upgrade-template-hoodi": "cp deployed-hoodi.json deployed-hoodi-upgrade.json && NETWORK_STATE_FILE=deployed-hoodi-upgrade.json UPGRADE_PARAMETERS_FILE=scripts/upgrade/upgrade-params-hoodi.toml MODE=forking TEMPLATE_TEST=true GAS_PRIORITY_FEE=1 GAS_MAX_FEE=100 DEPLOYER=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 hardhat test test/integration/upgrade/*.ts --fulltrace --disabletracer",

Copilot uses AI. Check for mistakes.
Comment on lines 480 to 506
description: "21. Raise SDVT (MODULE_ID = 2) stake share limit from 400 bps to 430 bps in Staking Router 0xFdDf38947aFB03C621C71b06C9C70bce73f12999",
call: _forwardCall(
TEMPLATE.AGENT(),
TEMPLATE.STAKING_ROUTER(),
abi.encodeCall(IStakingRouter.updateStakingModule, (
params.stakingModuleId,
params.stakeShareLimit,
currentModule.priorityExitShareThreshold,
currentModule.stakingModuleFee,
currentModule.treasuryFee,
currentModule.maxDepositsPerBlock,
currentModule.minDepositBlockDistance
))
)
});

voteItems[index++] = VoteItem({
description: "22. Set spent amount for Easy Track TRP registry 0x231Ac69A1A37649C6B06a71Ab32DdD92158C80b8 to 0 LDO",
call: _forwardCall(
TEMPLATE.AGENT(),
params.easyTrackTrpRegistry,
abi.encodeCall(IAllowedRecipientsRegistry.unsafeSetSpentAmount, (0))
)
});

voteItems[index++] = VoteItem({
description: "23. Set limit for Easy Track TRP registry 0x231Ac69A1A37649C6B06a71Ab32DdD92158C80b8 to 15'000'000 LDO with unchanged period duration of 12 months",
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

The descriptions at lines 480, 497, and 506 contain hardcoded addresses and values. Consider making these descriptions more maintainable by either:

  1. Deriving them from the actual parameter values
  2. Removing the hardcoded addresses since they're already in the function call parameters
    This will prevent inconsistencies between descriptions and actual values.

Copilot uses AI. Check for mistakes.
});

votingVoteItems[index++] = VoteItem({
description: "11. Transfer 508,106 MATIC from Aragon Agent to Liquidity Observation Lab (LOL) Multisig 0x87D93d9B2C672bf9c9642d853a8682546a5012B5",
Copy link

Choose a reason for hiding this comment

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

We in DAO Ops really love specifying things as explicit as possible, so if the addresses were removed because of the Copilot suggestions - I suggest getting them back for explicitness and transparency

Suggested change
description: "11. Transfer 508,106 MATIC from Aragon Agent to Liquidity Observation Lab (LOL) Multisig 0x87D93d9B2C672bf9c9642d853a8682546a5012B5",
description: "11. Transfer 508,106 MATIC 0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0 from Aragon Agent 0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c to Liquidity Observation Lab (LOL) Multisig 0x87D93d9B2C672bf9c9642d853a8682546a5012B5",


voteItems[index++] = VoteItem({
description: "1. Call UpgradeTemplateV3.startUpgrade",
description: "1.1. Check DG voting enactment is after December 4, 2025 00:00:00 UTC",
Copy link

Choose a reason for hiding this comment

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

Suggested change
description: "1.1. Check DG voting enactment is after December 4, 2025 00:00:00 UTC",
description: "1.1. Ensure DG proposal execution is after December 4, 2025 00:00:00 UTC",

});

voteItems[index++] = VoteItem({
description: "1.2. Check DG voting enactment is before December 10, 2025 00:00:00 UTC",
Copy link

Choose a reason for hiding this comment

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

Suggested change
description: "1.2. Check DG voting enactment is before December 10, 2025 00:00:00 UTC",
description: "1.2. Ensure DG proposal execution is before December 10, 2025 00:00:00 UTC",

});

voteItems[index++] = VoteItem({
description: "1.3. Check DG voting enactment is within daily time window (14:00 UTC - 23:00 UTC)",
Copy link

Choose a reason for hiding this comment

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

Suggested change
description: "1.3. Check DG voting enactment is within daily time window (14:00 UTC - 23:00 UTC)",
description: "1.3. Ensure DG proposal execution is within daily time window (14:00 UTC - 23:00 UTC)",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants