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

[Bug]: Fuzz test failure in test_fuzz_swap #912

Closed
wjmelements opened this issue Oct 24, 2024 · 2 comments
Closed

[Bug]: Fuzz test failure in test_fuzz_swap #912

wjmelements opened this issue Oct 24, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@wjmelements
Copy link
Contributor

Describe the bug

Github CI failed for #905, which didn't necessarily cause the issue.

Ran 4 tests for test/libraries/Pool.t.sol:PoolTest
[FAIL: Error != expected error: PriceLimitAlreadyExceeded(79228162514264337593543950335 [7.922e28], 17597 [1.759e4]) != InvalidFeeForExactOut(); counterexample: calldata=0xef87a6ec0000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000f423f00000000000000000000000000000000000000000000000000000000000012e2000000000000000000000000000000000000000000000000000000000000046a0000000000000000000000000000000000002216e584f5fa1ea926041bedfe97ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff805660000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044bd0000000000000000000000000000000000000000000000000000000000000000 args=[79228162514264337593543950335 [7.922e28], 999999 [9.999e5], 4834, 1130, SwapParams({ amountSpecified: 691415978906521570653435304214167 [6.914e32], tickSpacing: -8366496 [-8.366e6], zeroForOne: false, sqrtPriceLimitX96: 17597 [1.759e4], lpFeeOverride: 0 })]] test_fuzz_swap(uint160,uint24,uint16,uint16,(int256,int24,bool,uint160,uint24)) (runs: 90154, μ: 91523, ~: 16659)
Logs:
  Bound result 21856
  Bound result 999999
  Bound result 830
  Bound result 129
  Bound result 60

Traces:
  [203671] PoolTest::test_fuzz_swap(792281625142643375935439[503](https://github.com/Uniswap/v4-core/actions/runs/11411964612/job/31803384792#step:5:504)35 [7.922e28], 999999 [9.999e5], 4834, 1130, SwapParams({ amountSpecified: 691415978906521570653435304214167 [6.914e32], tickSpacing: -8366496 [-8.366e6], zeroForOne: false, sqrtPriceLimitX96: 17597 [1.759e4], lpFeeOverride: 0 }))
    ├─ [0] VM::toString(21856 [2.185e4]) [staticcall]
    │   └─ ← [Return] "21856"
    ├─ [0] console::log("Bound result", "21856") [staticcall]
    │   └─ ← [Stop] 
    ├─ [0] console::log("Bound result", 999999 [9.999e5]) [staticcall]
    │   └─ ← [Stop] 
    ├─ [0] console::log("Bound result", 830) [staticcall]
    │   └─ ← [Stop] 
    ├─ [0] console::log("Bound result", 129) [staticcall]
    │   └─ ← [Stop] 
    ├─ [0] VM::toString(60) [staticcall]
    │   └─ ← [Return] "60"
    ├─ [0] console::log("Bound result", "60") [staticcall]
    │   └─ ← [Stop] 
    ├─ [0] VM::assertEq(79228162[514](https://github.com/Uniswap/v4-core/actions/runs/11411964612/job/31803384792#step:5:515)264337593543950335 [7.922e28], 79228162514264337593543950335 [7.922e28]) [staticcall]
    │   └─ ← [Return] 
    ├─ [0] VM::assertEq(0, 0) [staticcall]
    │   └─ ← [Return] 
    ├─ [0] VM::assertEq(-1, -1) [staticcall]
    │   └─ ← [Return] 
    ├─ [0] VM::assertLt(-1, 887272 [8.872e5]) [staticcall]
    │   └─ ← [Return] 
    ├─ [0] VM::assertGt(-1, -887273 [-8.872e5]) [staticcall]
    │   └─ ← [Return] 
    ├─ [0] VM::assertEq(0, 0) [staticcall]
    │   └─ ← [Return] 
    ├─ [0] VM::assertEq(4926, 4926) [staticcall]
    │   └─ ← [Return] 
    ├─ [0] VM::expectRevert(custom error 0xc31eb0e0: 9620624600000000000000000000000000000000000000000000000000000000)
    │   └─ ← [Return] 
    └─ ← [Revert] PriceLimitAlreadyExceeded(79228162514264337593543950335 [7.922e28], 17597 [1.759e4])

[PASS] test_fuzz_tickSpacingToMaxLiquidityPerTick(int24) (runs: 100001, μ: 8568, ~: 8664)
[PASS] test_modifyLiquidity(uint160,uint24,(address,int24,int24,int128,int24,bytes32)) (runs: 100001, μ: 27632, ~: 11164)
[PASS] test_pool_initialize(uint160,uint24) (runs: 100001, μ: 17577, ~: 5929)
Suite result: FAILED. 3 passed; 1 failed; 0 skipped; finished in 34.90s (34.89s CPU time)

Expected Behavior

Fuzz tests should pass

To Reproduce

No response

Additional context

No response

@wjmelements wjmelements added the bug Something isn't working label Oct 24, 2024
Copy link

linear bot commented Oct 24, 2024

@hensha256
Copy link
Contributor

#913

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants