Skip to content

EIP-7939: added CLZ opcode for Osaka#1264

Merged
chfast merged 1 commit intoipsilon:masterfrom
Saw-mon-and-Natalie:EIP-7939-CLZ
Jul 22, 2025
Merged

EIP-7939: added CLZ opcode for Osaka#1264
chfast merged 1 commit intoipsilon:masterfrom
Saw-mon-and-Natalie:EIP-7939-CLZ

Conversation

@Saw-mon-and-Natalie
Copy link
Contributor

@Saw-mon-and-Natalie
Copy link
Contributor Author

@chfast wonder if you saw this PR ☺️

Copy link
Member

@chfast chfast left a comment

Choose a reason for hiding this comment

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

I wasn't aware of this PR. Thanks for the contribution.

@chfast chfast changed the title EIP-7939: added CLZ opcode for Osaka hardfork. EIP-7939: added CLZ opcode for Osaka Jul 19, 2025
@chfast chfast force-pushed the EIP-7939-CLZ branch 4 times, most recently from a3d58db to f2f8912 Compare July 22, 2025 07:57
@chfast chfast requested a review from Copilot July 22, 2025 08:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements the EIP-7939 Count Leading Zeros (CLZ) opcode for the Osaka revision of the Ethereum Virtual Machine. The opcode counts the number of leading zero bits in a 256-bit value.

  • Adds the OP_CLZ opcode (0x1e) with gas cost of 5 and activation from EVMC_OSAKA revision
  • Implements comprehensive test coverage including pre-activation behavior, gas consumption, and various input/output scenarios
  • Updates CI configuration to enable EIP-7939 test execution

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lib/evmone/instructions_opcodes.hpp Defines OP_CLZ constant (0x1e)
lib/evmone/instructions_xmacro.hpp Maps OP_CLZ to clz instruction handler
lib/evmone/instructions_traits.hpp Sets gas cost (5) and instruction traits for CLZ
lib/evmone/instructions.hpp Implements clz instruction logic
test/utils/utils.cpp Adds revision schedule for Prague to Osaka transition
test/utils/bytecode.hpp Adds clz bytecode helper function
test/unittests/instructions_test.cpp Marks CLZ as evmone-only instruction
test/unittests/evm_eip7939_clz_test.cpp Comprehensive test suite for CLZ opcode
test/unittests/CMakeLists.txt Includes CLZ test file in build
circle.yml Removes CLZ from test exclusion filter

Co-authored-by: Paweł Bylica <pawel@hepcolgum.band>
@chfast chfast enabled auto-merge (squash) July 22, 2025 08:21
@chfast
Copy link
Member

chfast commented Jul 22, 2025

@Saw-mon-and-Natalie If you are interested in more contributions for Osaka, let me know.

@chfast chfast merged commit c3cee78 into ipsilon:master Jul 22, 2025
22 of 23 checks passed
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