Skip to content

EIP-3855: Add PUSH0 OpCode#4975

Merged
GheisMohammadi merged 1 commit intodevfrom
feature/EIP-3855
Apr 26, 2026
Merged

EIP-3855: Add PUSH0 OpCode#4975
GheisMohammadi merged 1 commit intodevfrom
feature/EIP-3855

Conversation

@GheisMohammadi
Copy link
Copy Markdown
Collaborator

EIP-3855 introduces a new Ethereum Virtual Machine (EVM) instruction called PUSH0 that pushes the value zero onto the stack. Before this improvement, pushing zero required using PUSH1 0, which takes 2 bytes of bytecode and costs 3 gas at runtime. The new PUSH0 opcode (represented by 0x5f) accomplishes the same task using only 1 byte and costs just 2 gas, making smart contracts more efficient and cheaper to deploy and execute.

The motivation for this change comes from how frequently zero values are used in smart contracts. Many EVM operations need zero as an input parameter—for example, when making contract calls where you want to specify zero offsets or when using return data functions. Previously, every time a contract needed to push zero onto the stack, it had to use the more expensive PUSH1 0 instruction. With PUSH0, developers can write more gas-efficient code, and the smaller bytecode size also reduces deployment costs.

This PR implements EIP-3855 and can be activated at a specific epoch through the EIP3855Epoch configuration parameter. When enabled, the EVM interpreter includes the PUSH0 opcode in its jump table, allowing smart contracts to use this more efficient instruction. This is part of Harmony's ongoing effort to align with Ethereum improvements while maintaining its own epoch-based upgrade mechanism.

@GheisMohammadi GheisMohammadi self-assigned this Dec 9, 2025
@GheisMohammadi GheisMohammadi force-pushed the feature/EIP-3855 branch 2 times, most recently from 56478d0 to 335f245 Compare December 29, 2025 11:09
@Frozen
Copy link
Copy Markdown
Collaborator

Frozen commented Apr 5, 2026

Rebase please @GheisMohammadi

@GheisMohammadi
Copy link
Copy Markdown
Collaborator Author

Rebase please @GheisMohammadi

rebased

@mur-me
Copy link
Copy Markdown
Collaborator

mur-me commented Apr 8, 2026

Hey @GheisMohammadi, please fix the tests

@GheisMohammadi
Copy link
Copy Markdown
Collaborator Author

GheisMohammadi commented Apr 9, 2026

Hey @GheisMohammadi, please fix the tests

fixed and rebased

@Frozen
Copy link
Copy Markdown
Collaborator

Frozen commented Apr 15, 2026

rebase please

@GheisMohammadi GheisMohammadi merged commit 5cd8851 into dev Apr 26, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants