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

Error: Unknown key "inliner" #15576

Closed
anajuliabit opened this issue Nov 15, 2024 · 4 comments
Closed

Error: Unknown key "inliner" #15576

anajuliabit opened this issue Nov 15, 2024 · 4 comments

Comments

@anajuliabit
Copy link

Description

solc doesn't recognize inliner option

Environment

  • Compiler version: Version: 0.8.19+commit.7dd6d404.Darwin.appleclan
  • Target EVM version (as per compiler settings): shanghai
  • Framework/IDE (e.g. Truffle or Remix): foundry
  • EVM execution environment / backend / blockchain client:
  • Operating system: macOS (Apple Silicon)

Steps to Reproduce

Compilation with IR active fails with

Error: Compiler run failed: Error: Unknown key "inline"

For reference and how to reproduce foundry-rs/foundry#9322

@anajuliabit anajuliabit changed the title Error: Unknown key "inliner Error: Unknown key "inliner" Nov 15, 2024
@zerosnacks
Copy link

For additional context / recap:

Steps to reproduce

  1. Clone https://github.com/moonwell-fi/moonwell-contracts-v2
  2. Run forge coverage --ir-minimum --skip test --skip script --out artifacts/coverage

This yields: Error: Compiler run failed: Error: Unknown key "inline"

When you run: forge coverage --ir-minimum

it yields:

Error: solc exited with signal: 11 (SIGSEGV) (core dumped)
<empty output>

@cameel
Copy link
Member

cameel commented Nov 16, 2024

Just from a quick look, this could be caused by settings.optimizer.details.inliner setting being set in the wrong dict. If that's the case that would be a problem on Foundry side. On the other hand solc should not segfault because of it so if that's the case, it's something we'd still need to fix.

It would be helpful if we could remove some layers of indirection and reproduce this directly with solc. For that we'd need to see what is the exact Standard JSON content and command-line flags that forge is passing to solc.

@cameel cameel added waiting for more input Issues waiting for more input by the reporter low effort There is not much implementation work to be done. The task is very easy or tiny. low impact Changes are not very noticeable or potential benefits are limited. labels Nov 16, 2024
@grandizzy
Copy link

Just from a quick look, this could be caused by settings.optimizer.details.inliner setting being set in the wrong dict.

Indeed, that's the case, we're setting settings.optimizer.details.inliner to false even for solc versions <= 0.8.4 (Standard JSON: Properly allow the inliner setting under settings.optimizer.details was addressed in 0.8.5). We can just omit it from details, can you pls confirm that the default is set to false for versions >= 0.8.5? (in this way we could support older versions too without an explicit check). (foundry ref) Thanks!

klkvr pushed a commit to foundry-rs/compilers that referenced this issue Nov 18, 2024
Ref
foundry-rs/foundry#9322 (comment)

ethereum/solidity#15576 (comment)

Set inliner to None since it is properly supported from 0.8.5 version(
see `Standard JSON: Properly allow the inliner setting under
settings.optimizer.details`
https://soliditylang.org/blog/2021/06/10/solidity-0.8.5-release-announcement/)

---------

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
@cameel
Copy link
Member

cameel commented Nov 20, 2024

I can confirm that the defaults have not changed ever since the feature was introduced in 0.8.2 (#10761). But note that the default is dependent on the state of the optimizer: true when the optimizer is enabled and false otherwise.

What changed in 0.8.5 (#11419) is just that you can actually use the setting in Standard JSON - there was a bug in validation logic that prevented it from being used. But it did not affect the defaults.

@cameel cameel removed bug 🐛 waiting for more input Issues waiting for more input by the reporter low effort There is not much implementation work to be done. The task is very easy or tiny. low impact Changes are not very noticeable or potential benefits are limited. labels Nov 20, 2024
@cameel cameel closed this as not planned Won't fix, can't repro, duplicate, stale Nov 20, 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

No branches or pull requests

4 participants