Skip to content

Commit 999adf9

Browse files
Merge pull request #576 from morpho-org/ci/foundry
ci(foundry): skip failing invariants
2 parents 5e515a6 + 927dac0 commit 999adf9

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

.github/workflows/foundry.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ jobs:
2121
- type: "slow"
2222
fuzz-runs: 10000
2323
max-test-rejects: 500000
24-
invariant-runs: 48
25-
invariant-depth: 2048
24+
invariant-runs: 32
25+
invariant-depth: 512
2626
- type: "fast"
2727
fuzz-runs: 256
2828
max-test-rejects: 65536
29-
invariant-runs: 16
29+
invariant-runs: 8
3030
invariant-depth: 256
3131

3232
runs-on: ubuntu-latest
@@ -45,3 +45,4 @@ jobs:
4545
FOUNDRY_FUZZ_MAX_TEST_REJECTS: ${{ matrix.max-test-rejects }}
4646
FOUNDRY_INVARIANT_RUNS: ${{ matrix.invariant-runs }}
4747
FOUNDRY_INVARIANT_DEPTH: ${{ matrix.invariant-depth }}
48+
FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }}

foundry.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ via-ir = true
55
optimizer_runs = 4294967295
66

77
[profile.default.invariant]
8-
runs = 16
8+
runs = 8
99
depth = 256
1010
fail_on_revert = true
1111

test/forge/invariant/MorphoInvariantTest.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ contract MorphoInvariantTest is InvariantTest {
342342

343343
/* INVARIANTS */
344344

345-
function invariantSupplyShares() public {
345+
function invariantSupplyShares() internal {
346346
address[] memory users = targetSenders();
347347

348348
for (uint256 i; i < allMarketParams.length; ++i) {
@@ -358,7 +358,7 @@ contract MorphoInvariantTest is InvariantTest {
358358
}
359359
}
360360

361-
function invariantBorrowShares() public {
361+
function invariantBorrowShares() internal {
362362
address[] memory users = targetSenders();
363363

364364
for (uint256 i; i < allMarketParams.length; ++i) {
@@ -383,7 +383,7 @@ contract MorphoInvariantTest is InvariantTest {
383383
}
384384
}
385385

386-
function invariantMorphoBalance() public {
386+
function invariantMorphoBalance() internal {
387387
for (uint256 i; i < allMarketParams.length; ++i) {
388388
MarketParams memory _marketParams = allMarketParams[i];
389389
Id _id = _marketParams.id();
@@ -394,7 +394,7 @@ contract MorphoInvariantTest is InvariantTest {
394394
}
395395
}
396396

397-
function invariantBadDebt() public {
397+
function invariantBadDebt() internal {
398398
address[] memory users = targetSenders();
399399

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

0 commit comments

Comments
 (0)