Skip to content

Conversation

@RembrandtK
Copy link
Contributor

@RembrandtK RembrandtK commented Dec 12, 2025

I am experiencing a CI failure with fuzz testing in:

The vm.assume constraints (for some random seeds) caused the fuzzer to reject too many inputs.
Now bounds amountThawing and amountCollected to half of MAX_STAKING_TOKENS, avoiding invalid inputs.

I believe this should avoid that issue without compromising the test.

From https://github.com/graphprotocol/contracts/actions/runs/20112321235/job/57774684175#step:5:2840:

[FAIL: `vm.assume` rejected too many inputs (65536 allowed)] testGetBalance_WhenCollectedOverThawing(uint256,uint256,uint256) (runs: 250, μ: 300014, ~: 301219)

…wing

Replace vm.assume with bounded inputs to fix "vm.assume rejected too many inputs" error.
The previous implementation used overly restrictive constraints that caused the fuzzer
to reject most random inputs. Now limits amountThawing and amountCollected to half of
MAX_STAKING_TOKENS, guaranteeing valid deposit ranges while maintaining test coverage.
@RembrandtK RembrandtK self-assigned this Dec 12, 2025
@RembrandtK RembrandtK marked this pull request as ready for review December 12, 2025 19:03
@RembrandtK RembrandtK requested a review from tmigone December 12, 2025 19:03
@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.06%. Comparing base (44de081) to head (aa10045).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1268   +/-   ##
=======================================
  Coverage   84.06%   84.06%           
=======================================
  Files          42       42           
  Lines        2071     2071           
  Branches      615      615           
=======================================
  Hits         1741     1741           
  Misses        330      330           
Flag Coverage Δ
unittests 84.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@RembrandtK RembrandtK merged commit 2fc082e into main Dec 12, 2025
6 checks passed
@RembrandtK RembrandtK deleted the horizon-fuzz-test-fix branch December 12, 2025 19:09
RembrandtK added a commit that referenced this pull request Dec 12, 2025
…wing (#1268)

Replace vm.assume with bounded inputs to fix "vm.assume rejected too many inputs" error.
The previous implementation used overly restrictive constraints that caused the fuzzer
to reject most random inputs. Now limits amountThawing and amountCollected to half of
MAX_STAKING_TOKENS, guaranteeing valid deposit ranges while maintaining test coverage.
RembrandtK added a commit that referenced this pull request Dec 12, 2025
…wing (#1268)

Replace vm.assume with bounded inputs to fix "vm.assume rejected too many inputs" error.
The previous implementation used overly restrictive constraints that caused the fuzzer
to reject most random inputs. Now limits amountThawing and amountCollected to half of
MAX_STAKING_TOKENS, guaranteeing valid deposit ranges while maintaining test coverage.
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.

3 participants