Skip to content

feat: 10k runs for fuzz in deep profile#1663

Open
dry914 wants to merge 4 commits intofeat/fuzzing-updatedfrom
feat/fuzz-10k-runs
Open

feat: 10k runs for fuzz in deep profile#1663
dry914 wants to merge 4 commits intofeat/fuzzing-updatedfrom
feat/fuzz-10k-runs

Conversation

@dry914
Copy link
Contributor

@dry914 dry914 commented Feb 18, 2026

Add deep Foundry profile for 10,000 fuzzing runs certification.

Context

The project has invariant and fuzz tests across multiple contracts with various inline forge-config overrides for runs, depth, and other settings. Currently all tests run with default settings (256 invariant runs, standard fuzz runs), with no standardized way to run extended fuzzing campaigns.

Solution

foundry.toml: Added [profile.deep.fuzz] and [profile.deep.invariant] sections with runs = 10000.

Inline config cleanup across all test files:

  • Removed redundant default.*.runs where the value matched toml defaults (2048 in math256, signatureUtils, unstructuredStorage; 256 in withdrawalQueue; 32/128 in refSlotCache)
  • Kept default.*.runs only where intentionally different: beaconChainDepositor (32 — expensive per call), positiveTokenRebaseLimiter (65536), BLS (204800/10000)
  • Added deep.invariant.runs = 10000 only in beaconChainDepositor where inline default.invariant.runs = 32 would block deep profile
  • Reduced beaconChainDepositor depth to 4 (single handler function, depth doesn't add coverage)
  • Added max-test-rejects = 1000000 to two GIndex fuzz tests that reject ~88% of inputs via vm.assume

Run: FOUNDRY_PROFILE=deep forge test (~41 min wall time)

@dry914 dry914 self-assigned this Feb 18, 2026
@dry914 dry914 requested a review from a team as a code owner February 18, 2026 15:34
@dry914 dry914 added the tests When it comes to testing the code label Feb 18, 2026
@github-actions
Copy link

github-actions bot commented Feb 18, 2026

badge

Hardhat Unit Tests Coverage Summary

Details
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/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                                  196       1  99.49%   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                          47       2  95.74%   321-330
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%   483-503, 532, 671, 678, 700
contracts/0.8.9/Accounting.sol                                             96       2  97.92%   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/TokenRateNotifier.sol                                      36      36  0.00%    35-130
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%
contracts/tooling/AlertingHarness.sol                                      54       1  98.15%   97
contracts/tooling/sepolia/SepoliaDepositAdapter.sol                        21      21  0.00%    55-106
TOTAL                                                                    5006     234  95.33%

Diff against master

Filename      Stmts    Miss  Cover
----------  -------  ------  --------
TOTAL             0       0  +100.00%

Results for commit: c60ff64

Minimum allowed coverage is 95%

♻️ This comment has been updated with latest results

Copy link
Contributor

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

Adds a “deep” Foundry profile intended for extended fuzzing/invariant campaigns, and cleans up inline forge-config overrides across the test suite to rely more on profile defaults.

Changes:

  • Added Foundry profiles/config in foundry.toml for deep fuzz/invariant runs (10,000).
  • Removed several inline default.*.runs overrides from fuzz and invariant tests.
  • Increased default.fuzz.max-test-rejects for two GIndex fuzz tests to tolerate high vm.assume rejection rates.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
foundry.toml Introduces profile.deep fuzz/invariant runs and sets default invariant settings.
test/common/signatureUtils.t.sol Removes inline fuzz runs overrides.
test/common/minFirstAllocationStrategy.t.sol Removes inline invariant runs overrides.
test/common/math256.t.sol Removes inline fuzz runs overrides.
test/common/lib/GIndex.t.sol Adds higher fuzz max-test-rejects for rejection-heavy fuzz tests.
test/0.8.9/withdrawalQueue.t.sol Removes inline invariant runs overrides (keeping depth/fail-on-revert).
test/0.8.9/unstructuredStorage.t.sol Removes inline fuzz runs overrides.
test/0.8.9/beaconChainDepositor.t.sol Adjusts invariant inline config (depth) and removes runs override.
test/0.8.25/vaults/refSlotCache/refSlotCache.t.sol Removes inline invariant runs/depth overrides.
test/0.8.25/invariant-fuzzing/StakingVaultsFuzzing.t.sol Removes inline invariant runs/depth overrides.

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

@tamtamchik tamtamchik requested a review from a team as a code owner March 3, 2026 16:02
@tamtamchik tamtamchik force-pushed the feat/fuzz-10k-runs branch from 4b3bbcc to 0d2d8c5 Compare March 3, 2026 16:04
@tamtamchik tamtamchik removed the request for review from a team March 3, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests When it comes to testing the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants