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

Investigate test failure in CLPool.t.sol #38

Open
ChefMist opened this issue May 8, 2024 · 2 comments · Fixed by #43
Open

Investigate test failure in CLPool.t.sol #38

ChefMist opened this issue May 8, 2024 · 2 comments · Fixed by #43

Comments

@ChefMist
Copy link
Collaborator

ChefMist commented May 8, 2024

from this job https://github.com/pancakeswap/pancake-v4-core/actions/runs/8996481967/job/24713051330 which runs after merging #30

Though it seems that the test didn't fail due to the change. this are the params which can trigger the test failure locally even after reverting the changes in src/pool-cl/libraries/LiquidityMath.sol from #30

test/pool-cl/libraries/CLPool.t.sol

function testSwap(
        uint160 sqrtPriceX96,
        CLPool.ModifyLiquidityParams memory modifyLiquidityParams,
        CLPool.SwapParams memory swapParams,
        uint24 swapFee
    ) public {
        sqrtPriceX96 = 4295128739;
        modifyLiquidityParams = CLPool.ModifyLiquidityParams({
                owner: 0x0000000000000000000000000000000000000000,
                tickLower: 0,
                tickUpper: 295988,
                liquidityDelta: 63654653689537733100209589053550,
                tickSpacing: 1
            });

        swapParams = CLPool.SwapParams({
                tickSpacing: 0,
                zeroForOne: false,
                amountSpecified: 170141183460469231731687303715884105728,
                sqrtPriceLimitX96: 211765884121348748676852868765138027
            });
            
        ......
    }

@ChefMist ChefMist changed the title Investigate test failure Investigate test failure in CLPool.t.sol May 8, 2024
@ChefMist
Copy link
Collaborator Author

ChefMist commented May 8, 2024

this test also fail when done the below. checkout to an older commit: 2eb67b3

1. git checkout 2eb67b3e17c681c5a1ee7a31dbd7128c30cd6968
2. run testSwap with those param
3. forge test and see the error

@chefburger
Copy link
Collaborator

chefburger commented May 29, 2024

Unfortunately, this has not been solved, check detail reason & temp workaround:

// modifyLiquidityParams = CLPool.ModifyLiquidityParams({

@chefburger chefburger reopened this May 29, 2024
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 a pull request may close this issue.

2 participants