-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Implementation of EOF in Solidity #15294
Draft
rodiazet
wants to merge
15
commits into
ethereum:develop
Choose a base branch
from
ipsilon:eof-cleaned
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+14,064
−549
Draft
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4ae6d1c
prep: Extend `StandardCompiler` settings with `eofVersion` flag. Fix …
rodiazet edc3b40
prep: Pass `_eofVersion` to `libevmasm/Assembly` class
rodiazet 07528fc
prep: Change `toBigEndian` interface to support rvalue ref.
rodiazet c0a839e
eof: Introduce EOF container format support in `Assembly::assemble` (…
rodiazet 84ab885
eof: Support `DATALOADN` (EIP-7480)
rodiazet 70b9e8b
eof: Support RJUMP, RJUMPI (EIP-4200)
rodiazet 64cbc1d
eof: Support CALLF, JUMPF, RETF. (EIP-4750, EIP-6206)
rodiazet 412edcd
eof: Pass flag to `copyConstructorArgumentsToMemoryFunction` (EIP-7620)
rodiazet 76a25cc
eof: Implement EOF Contract Creation (EIP-7620)
rodiazet a419908
eof: Implement revamped CALL instructions (EIP-7069)
rodiazet 79b4d65
eof: Implement max stack heigh calculation (EIP-5450)
rodiazet bdc126f
prep: Update to emvc 12
rodiazet 00b0b14
tests: Add new (EOF) message kind to EVMHost. Separate arguments in s…
rodiazet a902291
tests: Add `compileToEOF` flag to semantic tests settings
rodiazet bbfb85d
tests: Update semantic tests for EOF
rodiazet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -426,7 +426,7 @@ std::optional<Json> checkAuxiliaryInputKeys(Json const& _input) | |
|
||
std::optional<Json> checkSettingsKeys(Json const& _input) | ||
{ | ||
static std::set<std::string> keys{"debug", "evmVersion", "libraries", "metadata", "modelChecker", "optimizer", "outputSelection", "remappings", "stopAfter", "viaIR"}; | ||
static std::set<std::string> keys{"debug", "evmVersion", "eofVersion", "libraries", "metadata", "modelChecker", "optimizer", "outputSelection", "remappings", "stopAfter", "viaIR"}; | ||
return checkKeys(_input, keys, "settings"); | ||
} | ||
|
||
|
@@ -837,7 +837,7 @@ std::variant<StandardCompiler::InputsAndSettings, Json> StandardCompiler::parseI | |
{ | ||
if (!settings["eofVersion"].is_number_unsigned()) | ||
return formatFatalError(Error::Type::JSONError, "eofVersion must be an unsigned integer."); | ||
auto eofVersion = settings["evmVersion"].get<uint8_t>(); | ||
auto eofVersion = settings["eofVersion"].get<uint8_t>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This and the related evm-version check change can and should separately go into develop :-). |
||
if (eofVersion != 1) | ||
return formatFatalError(Error::Type::JSONError, "Invalid EOF version requested."); | ||
ret.eofVersion = 1; | ||
|
@@ -1308,6 +1308,7 @@ Json StandardCompiler::compileSolidity(StandardCompiler::InputsAndSettings _inpu | |
compilerStack.addSMTLib2Response(smtLib2Response.first, smtLib2Response.second); | ||
compilerStack.setViaIR(_inputsAndSettings.viaIR); | ||
compilerStack.setEVMVersion(_inputsAndSettings.evmVersion); | ||
compilerStack.setEOFVersion(_inputsAndSettings.eofVersion); | ||
compilerStack.setRemappings(std::move(_inputsAndSettings.remappings)); | ||
compilerStack.setOptimiserSettings(std::move(_inputsAndSettings.optimiserSettings)); | ||
compilerStack.setRevertStringBehaviour(_inputsAndSettings.revertStrings); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of passing
m_eofVersion
around here, we can just assert(this is only-legacy, see the
solAssert(!m_viaIR, "");
below)And thereby leave
libsolidity/codegen/Compiler.h
andlibsolidity/codegen/CompilerContext.h
largely untouched (resp. where they need an eof version just usestd::nullopt
directly).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in https://github.com/ethereum/solidity/pull/15356/files#diff-0f19df92d55a7d7fe38fdf4be1e14b364671c4934853d13a33b31aedf3f917bdR1424