Skip to content

execution/vm: fold EVMInterpreter into EVM#18765

Merged
yperbasis merged 7 commits intomainfrom
yperbasis/EVMInterpreter
Jan 27, 2026
Merged

execution/vm: fold EVMInterpreter into EVM#18765
yperbasis merged 7 commits intomainfrom
yperbasis/EVMInterpreter

Conversation

@yperbasis
Copy link
Member

@yperbasis yperbasis commented Jan 22, 2026

@yperbasis yperbasis linked an issue Jan 22, 2026 that may be closed by this pull request
@yperbasis yperbasis marked this pull request as ready for review January 23, 2026 15:36
@yperbasis yperbasis requested a review from mh0lt as a code owner January 23, 2026 15:36
Copy link
Contributor

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 refactors the EVM architecture by folding the EVMInterpreter struct into the EVM struct, eliminating an unnecessary layer of indirection. This is a cherry-pick from go-ethereum that simplifies the codebase by consolidating interpreter functionality directly into the EVM.

Changes:

  • Merged EVMInterpreter fields and methods into the EVM struct
  • Updated all opcode function signatures to accept *EVM instead of *EVMInterpreter
  • Removed the Interpreter interface and related test infrastructure

Reviewed changes

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

Show a summary per file
File Description
execution/vm/evm.go Added interpreter fields (jt, depth, hasher, readOnly, returnData) to EVM struct and removed interpreter indirection
execution/vm/interpreter.go Removed EVMInterpreter struct, Interpreter interface, and VM struct; refactored Run method to be on EVM
execution/vm/jump_table.go Updated executionFunc signature to accept *EVM parameter
execution/vm/instructions.go Updated all opcode implementations to accept *EVM instead of *EVMInterpreter
execution/vm/eips.go Updated EIP-specific opcodes to accept *EVM parameter
execution/vm/instructions_test.go Removed EVMInterpreter references from tests
execution/vm/mock_vm.go Removed test mock file no longer needed
execution/vm/evm_test.go Removed interpreter-specific tests
execution/tracing/tracers/logger/logger_test.go Updated to call evm.Run directly
execution/tracing/tracers/js/tracer_test.go Updated to call evm.Run directly

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

v, overflow = uint256.FromBig(evm.Context.Difficulty)
if overflow {
return pc, nil, errors.New("interpreter.evm.Context.Difficulty higher than 2^256-1")
return pc, nil, errors.New("evm.Context.Difficulty higher than 2^256-1")
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The error message refers to "evm.Context.Difficulty" which is misleading. The error occurs when converting the difficulty value, but the message structure suggests a field path. Consider rewording to "difficulty value exceeds 2^256-1" for clarity.

Suggested change
return pc, nil, errors.New("evm.Context.Difficulty higher than 2^256-1")
return pc, nil, errors.New("difficulty value exceeds 2^256-1")

Copilot uses AI. Check for mistakes.
@@ -1,436 +0,0 @@
// Copyright 2024 The Erigon Authors
Copy link
Member

Choose a reason for hiding this comment

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

why was this file deleted?

Copy link
Member Author

Choose a reason for hiding this comment

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

It was added in PR #2508 as part of the work on TEVM (transpiled EVM), which we abandoned since then.

@yperbasis yperbasis enabled auto-merge (squash) January 27, 2026 09:57
@yperbasis yperbasis merged commit 7fd3122 into main Jan 27, 2026
19 checks passed
@yperbasis yperbasis deleted the yperbasis/EVMInterpreter branch January 27, 2026 13:05
mattevans added a commit to ethpandaops/erigone-legacy that referenced this pull request Jan 28, 2026
* main: (37 commits)
  Make `lastCommittedTxNum` atomic (erigontech#18820)
  integrity: fix redundant variable name in checkLogIdx (erigontech#18646)
  Fixed index building for v0 snapshot format (erigontech#18825)
  execution/vm: fold EVMInterpreter into EVM (erigontech#18765)
  fix: return correct prune mode value instead of nil (erigontech#18804)
  fix BuildMissedAccessors for caplin state (erigontech#18802)
  execution: EIP-7708: ETH transfers emit a log (erigontech#18761)
  refactor(rpc): remove redundant boolean comparison in AccountRange (erigontech#18814)
  Show the default P2P discovery bools in --help (erigontech#18818)
  fix(txpool): remove redundant Worst() calls in queued pool discard loop (erigontech#18810)
  node: remove unused logger and test helper (erigontech#18744)
  Disabled compression in collate function (erigontech#18813)
  Add missing tx.Commit() in stage_snapshots (erigontech#18816)
  Bumped major version of snapshot files (erigontech#18815)
  qa-tests: summary for RPC integration tests (erigontech#18809)
  perf: reuse hash buffer in witness storage leaf hash (erigontech#18803)
  execution/stagedsync: remove canPrune from serial_exec (erigontech#18800)
  Fixed deduplication intervals for rebuild cmd (erigontech#18796)
  Fix race due to warmup cache (erigontech#18799)
  fix(txpool): use instance logger instead of global log (erigontech#18797)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port "fold EVMInterpreter into EVM" from geth

4 participants