Skip to content

Conversation

@cameel
Copy link
Collaborator

@cameel cameel commented Mar 1, 2025

I noticed that we're still missing validations against combinations like --experimental-eof-version 1 --evm-version cancun. I thought we had that safeguarded already because soltest does have this check, but apparently not. You'll either run into an ICE, or even worse - no error.

No error example

This finishes without errors:

echo 'contract C {}' | solc - --experimental-eof-version 1 --evm-version cancun

You only get an error if you request bytecode (Error: Experimental EOF support is only available for via-IR compilation.). And with --via-ir the compiler produces invalid IR.

ICE example

This triggers an ICE:

echo '{}' | solc --strict-assembly - --experimental-eof-version 1 --evm-version cancun
======= <stdin> (EVM) =======

Pretty printed source:
object "object" {
    code { { } }
}

Uncaught exception:
/solidity/libyul/backends/evm/EVMObjectCompiler.cpp(77): Throw in function void solidity::yul::EVMObjectCompiler::run(const solidity::yul::Object&, bool)
Dynamic exception type: boost::wrapexcept<solidity::yul::YulAssertion>
std::exception::what: Experimental EOF support is only available for optimized via-IR compilation and the most recent EVM version.
[solidity::util::tag_comment*] = Experimental EOF support is only available for optimized via-IR compilation and the most recent EVM version.

@cameel cameel added this to the 0.8.29 milestone Mar 1, 2025
@cameel cameel self-assigned this Mar 1, 2025
@cameel cameel added the EOF label Mar 1, 2025
Comment on lines -1386 to +1388
default:
assertThrow(false, Exception, "Invalid call kind.");
case evmc_call_kind::EVMC_EOFCREATE:
return "EOFCREATE";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EVMHostPrinter seems to be only used by fuzzer so this wasn't breaking anything in practice (which is why it went unnoticed so far).

@cameel cameel force-pushed the eof-before-osaka-validation branch from c88b0b6 to 6fb6b04 Compare March 1, 2025 18:34
@@ -0,0 +1 @@
Error: Option --evm-version is not supported with --import-asm-json.
Copy link
Collaborator Author

@cameel cameel Mar 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aarlt Looks like EVM (and EOF) version is not accepted by assembly import on the CLI, even though it works in Standard JSON.

ekpyron
ekpyron previously approved these changes Mar 3, 2025
@cameel cameel force-pushed the eof-before-osaka-validation branch from 6fb6b04 to 24b0ec2 Compare March 3, 2025 17:28
@cameel cameel merged commit 69f3a3e into develop Mar 3, 2025
74 checks passed
@cameel cameel deleted the eof-before-osaka-validation branch March 3, 2025 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants