Skip to content

Add EIP: Opcode for arbitrary bytecode execution #10036

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

0xCamax
Copy link

@0xCamax 0xCamax commented Jul 19, 2025

EIP-7982: RUNCODE Opcode for In-Context Bytecode Execution

Summary

This EIP proposes a new RUNCODE opcode that enables execution of arbitrary bytecode from memory within the same execution context. This complements DELEGATECALL by providing an alternative for scenarios where dynamic code doesn't need to be permanently stored on-chain, offering significant gas savings.

Key Benefits

  • Alternative to DELEGATECALL: Provides option for temporary/generated code that doesn't require permanent on-chain storage
  • Gas Optimization: Saves up to 2,600 gas per execution by eliminating cold address access costs
  • Reduced Blockchain Bloat: Avoids deploying temporary bytecode as contracts, reducing state growth
  • Deployment Savings: Eliminates need to deploy ephemeral code as contracts (~32,000+ gas savings per deployment)
  • Context Preservation: Maintains identical execution context as DELEGATECALL while operating from memory

Use Cases

  • Runtime code generation and execution without permanent deployment
  • One-time complex calculations that don't justify permanent contract storage
  • Temporary computational libraries that change frequently
  • Meta-programming patterns where bytecode is generated dynamically
  • Mathematical computation libraries that generate optimized bytecode on-demand

@0xCamax 0xCamax requested a review from eth-bot as a code owner July 19, 2025 22:40
@github-actions github-actions bot added c-new Creates a brand new proposal s-draft This EIP is a Draft t-core labels Jul 19, 2025
@eth-bot
Copy link
Collaborator

eth-bot commented Jul 19, 2025

File EIPS/eip-7982.md

Requires 1 more reviewers from @g11tech, @lightclient, @SamWilsn

@eth-bot eth-bot added e-consensus Waiting on editor consensus e-review Waiting on editor to review labels Jul 19, 2025
@eth-bot eth-bot changed the title Add EIP-7982: RUNCODE Opcode for arbitrary bytecode execution Add EIP: RUNCODE Opcode for arbitrary bytecode execution Jul 19, 2025
@eth-bot eth-bot changed the title Add EIP: RUNCODE Opcode for arbitrary bytecode execution Add EIP: Opcode for arbitrary bytecode execution Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-new Creates a brand new proposal e-consensus Waiting on editor consensus e-review Waiting on editor to review s-draft This EIP is a Draft t-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants