Skip to content

Update primitives/opcodes to Osaka (and fix some bugs)#463

Merged
mbenke merged 9 commits into
argotorg:mainfrom
axic:primitives
Jun 15, 2026
Merged

Update primitives/opcodes to Osaka (and fix some bugs)#463
mbenke merged 9 commits into
argotorg:mainfrom
axic:primitives

Conversation

@axic

@axic axic commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

This

  • sorts the primitives to match the opcode order (see https://evm.codes),
  • removes duplicate difficulty (of prevrandao, as it was renamed several hardforks back),
  • removes pc as it is not a Yul builtin,
  • adds the missing opcodes as per Osaka hardfork (@d-xo mentioned a while back the current goal is to match latest hardfork, then we can decide if/how to support older ones),
  • and adds missing specific Yul builtins,
  • fix wrong definition of extcodecopy in Hull,
  • remove pc/jump/jumpi` from Hull,
  • sync the primitives with Hull.

@axic axic force-pushed the primitives branch 6 times, most recently from 8a163ac to 73fb62b Compare June 14, 2026 13:13
axic and others added 4 commits June 14, 2026 15:15
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>
@axic axic marked this pull request as ready for review June 14, 2026 13:16
@axic axic changed the title Update primitives/opcodes to Osaka Update primitives/opcodes to Osaka (and fix some bugs) Jun 14, 2026
claude added 3 commits June 14, 2026 15:26
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 mbenke left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@axic

axic commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@mbenke added

@mbenke mbenke merged commit 1672141 into argotorg:main Jun 15, 2026
4 checks passed
@axic axic deleted the primitives branch June 15, 2026 10:32
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

Successfully merging this pull request may close these issues.

3 participants