Update primitives/opcodes to Osaka (and fix some bugs)#463
Merged
Conversation
8a163ac to
73fb62b
Compare
Regenerate std/opcodes.solc (via gen-std-opcodes.py) to match the Primitives.hs Yul builtin list as of EVM Osaka: Add clz (0x1e, EIP-7939). Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
hullBuiltins (the type environment yule uses to typecheck Hull objects) had diverged from Primitives.hs/std/opcodes.solc: - extcodecopy took 3 args; the Yul builtin is extcodecopy(addr, dst, offset, length) = 4 args. Any use produced an arity-mismatch error. - clz (Osaka, EIP-7939) was missing. - blobhash (Cancun, EIP-4844) was missing, despite blobbasefee being present (inconsistent partial-Cancun support). - datacopy (Yul object builtin) was missing, diverging from Primitives. difficulty was already present and left unchanged.
Matches Primitives.hs, which exposes only prevrandao (post-Merge name) and not the deprecated difficulty alias.
These low-level control-flow opcodes are not part of the user-facing Yul dialect and were unused: no codegen path (EmitHull, yule Translate) emitted them and no source called them. Dropping them keeps hullBuiltins in parity with Primitives.hs/std/opcodes.solc. The hull->yul side (builtinFuns in yule/TM.hs) never referenced them, so no change there.
mbenke
reviewed
Jun 15, 2026
mbenke
left a comment
Collaborator
There was a problem hiding this comment.
In std/opcodes.solc, it may be worthwhile to add a comment along the lines
// Generated by scripts/gen-std-opcodes.py. Run the script to regenerate.
mbenke
approved these changes
Jun 15, 2026
Contributor
Author
|
@mbenke added |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This
difficulty(ofprevrandao, as it was renamed several hardforks back),pcas it is not a Yul builtin,extcodecopyin Hull,pc/jump/jumpi` from Hull,