EIP-7939: added CLZ opcode for Osaka#1264
Merged
chfast merged 1 commit intoipsilon:masterfrom Jul 22, 2025
Merged
Conversation
Contributor
Author
|
@chfast wonder if you saw this PR |
chfast
requested changes
Jul 19, 2025
Member
chfast
left a comment
There was a problem hiding this comment.
I wasn't aware of this PR. Thanks for the contribution.
a3d58db to
f2f8912
Compare
chfast
approved these changes
Jul 22, 2025
There was a problem hiding this comment.
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>
Member
|
@Saw-mon-and-Natalie If you are interested in more contributions for Osaka, let me know. |
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.
fixes: