-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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: forge config --json
returns evm version that is not compatible with solc version
#7014
Comments
this only affects the config part, right? |
I only experienced the bug in |
@0xalpharush Do you have any suggestions on how to improve the chisel version check? |
I think we also need this validation when |
should I add a normalization step specifically for forge config? |
Yes, I think it is taken care of for |
forge config --json
returns evm version that is not compatible with solc versionforge config --json
returns evm version that is not compatible with solc version
Note: looks like this is still an active issue - for future reference When no {
"evm_version": "paris",
} With {
"evm_version": "london",
} Related: crytic/slither#2422 (comment) |
Component
Forge, Chisel
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (84d9842 2024-02-02T00:19:34.098872000Z)
What command(s) is the bug in?
forge config --json
Operating System
macOS (Apple Silicon)
Describe the bug
When the EVM version isn't set in the foundry.toml but the solc version is, Foundry may incorrectly use
EvmVersion::Paris
without validating that it is available for the given solc verison e.g. solc 0.8.17. I would expect to be able to pass the output offorge config --json
to solc without running into errors related solc configurations. I'd also expect incompatibilities that are explicitly defined in the foundry.tom to be reported in a diagnostic.I looked into fixing this but I'm not familiar with the figment provider library and wasn't sure how to add a call to
normalize_version
that will produce a correct solc version and evm version combo cleanly (I assume someone with more knowledge of the toolchain and architecture can consolidate the validation and error handling better than myself).Relevant code for
forge config
foundry/crates/config/src/lib.rs
Line 1774 in 7922fd5
Relevant code for
chisel
which I believe also performs insufficient validation i.e it can produce other misconfigurations for solc version and evm version pairs besides 0.8.17 and Paris.foundry/crates/chisel/src/session_source.rs
Lines 108 to 121 in 7922fd5
Also, probably here and here could use the same fix.
For more info, see also crytic/slither#2287
The text was updated successfully, but these errors were encountered: