Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(foundry): skip failing invariants #576

Merged
merged 3 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
- type: "slow"
fuzz-runs: 10000
max-test-rejects: 500000
invariant-runs: 48
invariant-depth: 2048
invariant-runs: 32
invariant-depth: 512
- type: "fast"
fuzz-runs: 256
max-test-rejects: 65536
invariant-runs: 16
invariant-runs: 8
invariant-depth: 256

runs-on: ubuntu-latest
Expand All @@ -45,3 +45,4 @@ jobs:
FOUNDRY_FUZZ_MAX_TEST_REJECTS: ${{ matrix.max-test-rejects }}
FOUNDRY_INVARIANT_RUNS: ${{ matrix.invariant-runs }}
FOUNDRY_INVARIANT_DEPTH: ${{ matrix.invariant-depth }}
FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }}
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ via-ir = true
optimizer_runs = 4294967295

[profile.default.invariant]
runs = 16
runs = 8
depth = 256
fail_on_revert = true

Expand Down
8 changes: 4 additions & 4 deletions test/forge/invariant/MorphoInvariantTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ contract MorphoInvariantTest is InvariantTest {

/* INVARIANTS */

function invariantSupplyShares() public {
function invariantSupplyShares() internal {
address[] memory users = targetSenders();

for (uint256 i; i < allMarketParams.length; ++i) {
Expand All @@ -358,7 +358,7 @@ contract MorphoInvariantTest is InvariantTest {
}
}

function invariantBorrowShares() public {
function invariantBorrowShares() internal {
address[] memory users = targetSenders();

for (uint256 i; i < allMarketParams.length; ++i) {
Expand All @@ -383,7 +383,7 @@ contract MorphoInvariantTest is InvariantTest {
}
}

function invariantMorphoBalance() public {
function invariantMorphoBalance() internal {
for (uint256 i; i < allMarketParams.length; ++i) {
MarketParams memory _marketParams = allMarketParams[i];
Id _id = _marketParams.id();
Expand All @@ -394,7 +394,7 @@ contract MorphoInvariantTest is InvariantTest {
}
}

function invariantBadDebt() public {
function invariantBadDebt() internal {
address[] memory users = targetSenders();

for (uint256 i; i < allMarketParams.length; ++i) {
Expand Down