-
Notifications
You must be signed in to change notification settings - Fork 6.1k
eof: Pass _eofVersion
down to libevmasm/Assembly
class
#15356
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
Conversation
Thank you for your contribution to the Solidity compiler! A team member will follow up shortly. If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother. If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix. |
_eofVersion
down to libevmasm/Assembly
class_eofVersion
down to libevmasm/Assembly
class
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.
Looking at it again in isolation I do have a few more, but only minor comments - I've not yet seen why this would make that one test failing that CI complains about (I had assumed the CommonOptions::get().eofVersion()
would also be empty for now?).
std::shared_ptr<Compiler> compiler = std::make_shared<Compiler>(m_evmVersion, m_revertStrings, m_optimiserSettings); | ||
std::shared_ptr<Compiler> compiler = std::make_shared<Compiler>(m_evmVersion, std::nullopt, m_revertStrings, m_optimiserSettings); |
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.
I actually didn't mean just passing std::nullopt
here, but not adding the eof version option to Compiler
(and CompilerContext
) in the first place (and just have them pass std::nullopt
to the Assembly
s they need and such)
And an assert
solUnimplementedAssert(!m_eofVersion, "EOF is not supported for legacy code generation");
here also wouldn't hurt, together with the !m_viaIR
assert below maybe.
@@ -99,7 +99,7 @@ class AbstractAssembly | |||
/// Append the assembled size as a constant. | |||
virtual void appendAssemblySize() = 0; | |||
/// Creates a new sub-assembly, which can be referenced using dataSize and dataOffset. | |||
virtual std::pair<std::shared_ptr<AbstractAssembly>, SubID> createSubAssembly(bool _creation, std::string _name = "") = 0; | |||
virtual std::pair<std::shared_ptr<AbstractAssembly>, SubID> createSubAssembly(bool _creation, std::optional<uint8_t> _eofVersion, std::string _name = "") = 0; |
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.
Also looking a bit closer here: should a sub-assembly get its own EOF version? I'd imagine that it'd always inherit the EOF version from the parent Assembly. (In the EthAssemblyAdapter
implementation you can fetch it from the wrapped Assembly
, in NoOutputAssembly
, you'd need to store it.)
Or is the idea that technically there could be EOF version 1 containers containing EOF version 2 containers?
@@ -862,6 +864,8 @@ LinkerObject const& Assembly::assemble() const | |||
|
|||
LinkerObject& ret = m_assembledObject; | |||
|
|||
bool const eof = m_eofVersion.has_value(); |
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.
bool const eof = m_eofVersion.has_value(); | |
bool const eof = m_eofVersion.has_value(); | |
solAssert(!eof || m_eofVersion == 1, "Invalid EOF version."); |
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.
Done
Problem is in https://github.com/ipsilon/solidity/blob/eof-prep-1/test/libsolidity/Metadata.cpp#L228 test. It doesn't make sense for now. Even changing first evm version to The test should be added later and adjusted to new EOF version. I can move it to proper commit (later PR) of the |
Makes sense, yeah - we need clean CI to merge this, but we can just remove the test for now, merge this PR and bring the test back later, yes! |
Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>
No description provided.