-
Notifications
You must be signed in to change notification settings - Fork 69
feat(core): implement EIP-7939: CLZ opcode #31989 #2012
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
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Pull request overview
This PR implements EIP-7939, which adds a new CLZ (Count Leading Zeros) opcode to the EVM. The CLZ opcode counts the number of leading zero bits in a 256-bit value. To support this new opcode, a new Osaka fork is introduced, which builds on top of the Prague fork.
Changes:
- Adds the Osaka fork configuration across all network constants (mainnet, testnet, devnet, local)
- Implements the CLZ opcode (0x1e) that counts leading zero bits in a 256-bit value
- Creates the Osaka instruction set that includes all Prague features plus EIP-7939
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| params/config.go | Adds OsakaBlock field and IsOsaka() method to chain configuration and Rules struct |
| core/vm/opcodes.go | Defines CLZ opcode constant (0x1e) and adds string mappings |
| core/vm/eips.go | Implements opCLZ function and enable7939 to activate the opcode |
| core/vm/jump_table.go | Creates newOsakaInstructionSet() that extends Prague with EIP-7939 |
| core/vm/jump_table_export.go | Updates LookupInstructionSet() to handle Osaka and Verkle forks |
| core/vm/evm.go | Adds Osaka case to select appropriate instruction set |
| core/vm/instructions_test.go | Adds comprehensive test cases for CLZ opcode covering edge cases |
| common/constants.*.go | Initializes OsakaBlock for all networks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
356b268 to
aa09b60
Compare
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.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c12af3c to
614eeb0
Compare
Proposed changes
implement EIP-7939
Ref: ethereum#31989
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which part of the codebase this PR will touch base on,
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that