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

chore: remove forge coverage command #396

Merged
merged 1 commit into from
Sep 11, 2024
Merged

chore: remove forge coverage command #396

merged 1 commit into from
Sep 11, 2024

Conversation

shaspitz
Copy link
Contributor

@shaspitz shaspitz commented Sep 11, 2024

Describe your changes

The forge coverage command has been very flaky lately. Recent comments from this issue confirm others are having trouble lately as well. The command itself suggests our use of --ir-minimum is a workaround.

Example error from https://github.com/primev/mev-commit/actions/runs/10807042835/job/29977007439?pr=395

forge clean && forge coverage --ir-minimum
Warning! "--ir-minimum" flag enables viaIR with minimum optimization, which can result in inaccurate source mappings.
Only use this flag as a workaround if you are experiencing "stack too deep" errors.
Note that "viaIR" is only available in Solidity 0.8.13 and above.
See more: https://github.com/foundry-rs/foundry/issues/3357
Compiling 1[4](https://github.com/primev/mev-commit/actions/runs/10807042835/job/29977007439?pr=395#step:7:5)1 files with Solc 0.8.26
Solc 0.8.26 finished in 25.11s
Error: 
Compiler run failed:
Error: Yul exception:Cannot swap Variable _28 with Variable _30: too deep in the stack by 1 slots in [ RET expr_81067_address _907_slot _28 expr_81091_value expr_81063_component expr _9 _22 _18 _2[5](https://github.com/primev/mev-commit/actions/runs/10807042835/job/29977007439?pr=395#step:7:6) _17 expr_81117_address _27 _26 _17 expr_81138_mpos expr_81134_mpos expr_2 _29 _30 ]
No memoryguard was present. Consider using memory-safe assembly only and annotating it via 'assembly ("memory-safe") { ... }'.
YulException: Cannot swap Variable _28 with Variable _30: too deep in the stack by 1 slots in [ RET expr_810[6](https://github.com/primev/mev-commit/actions/runs/10807042835/job/29977007439?pr=395#step:7:7)7_address _907_slot _28 expr_81091_value expr_81063_component expr _9 _22 _18 _25 _1[7](https://github.com/primev/mev-commit/actions/runs/10807042835/job/29977007439?pr=395#step:7:8) expr_81117_address _27 _26 _17 expr_[8](https://github.com/primev/mev-commit/actions/runs/10807042835/job/29977007439?pr=395#step:7:9)1138_mpos expr_81134_mpos expr_2 _29 _30 ]
No memoryguard was present. Consider using memory-safe assembly only and annotating it via 'assembly ("memory-safe") { ... }'.

I've consistently found the solution to this error is shortening .sol files. Ie. our main branch has .sol files that are just below the stack size threshold which causes this error to show up. In the case of #395, we don't have the option to refactor in order to reduce "stack too deep" errors. New code must be added.

The forge coverage command itself does not add value as CI, ie. it cannot pass or fail. Therefore it shouldn't be a problem to remove from CI. At least until the foundry team addresses these compilation issues.

@shaspitz shaspitz changed the title ci: remove forge coverage command chore: remove forge coverage command Sep 11, 2024
@shaspitz shaspitz requested review from Mikelle and ckartik September 11, 2024 08:06
@shaspitz shaspitz marked this pull request as ready for review September 11, 2024 08:10
@shaspitz shaspitz merged commit 0253556 into main Sep 11, 2024
13 of 14 checks passed
@shaspitz shaspitz deleted the rm-forge-coverage branch September 11, 2024 18:43
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 this pull request may close these issues.

2 participants