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]: Error "Stack too deep" when running forge test without --via-ir #863

Closed
DamirS09 opened this issue Sep 2, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@DamirS09
Copy link

DamirS09 commented Sep 2, 2024

Describe the bug

When running forge test on the v4-core project, the compiler throws a "Stack too deep" error. The error message suggests using --via-ir or enabling the optimizer to bypass this issue. Running the test with the --via-ir flag resolves the issue, but this should ideally work without needing additional flags.

Expected Behavior

The forge test command should run successfully without requiring the --via-ir flag, and all tests should pass without any "Stack too deep" compiler errors.

To Reproduce

forge test
[⠆] Compiling...
[⠔] Compiling 125 files with Solc 0.8.26
[⠒] Solc 0.8.26 finished in 3.17s
Error:
Compiler run failed:
Error: Compiler error (C:\Users\circleci\project\libsolidity\codegen\LValue.cpp:51):Stack too deep. Try compiling with --via-ir (cli) or the equivalent viaIR: true (standard JSON) while enabling the optimizer. Otherwise, try removing local variables.
CompilerError: Stack too deep. Try compiling with --via-ir (cli) or the equivalent viaIR: true (standard JSON) while enabling the optimizer. Otherwise, try removing local variables.
--> lib/v4-core/src/PoolManager.sol:179:36:
|
179 | (callerDelta, hookDelta) = key.hooks.afterModifyLiquidity(key, params, callerDelta, feesAccrued, hookData);
| ^^^

Additional context

No response

@DamirS09 DamirS09 added the bug Something isn't working label Sep 2, 2024
Copy link

linear bot commented Sep 2, 2024

PROTO-573 [Bug]: Error "Stack too deep" when running forge test without --via-ir

@NikitaZ
Copy link

NikitaZ commented Sep 10, 2024

This is fixed now with #872

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

3 participants