Skip to content

core/vm: continue after super-instruction fallback - #3622

Merged
MatusKysel merged 1 commit into
developfrom
fix/si-fallback-continue
Mar 31, 2026
Merged

MatusKysel merged 1 commit into
developfrom
fix/si-fallback-continue

Conversation

@MatusKysel

Copy link
Copy Markdown
Contributor

Summary

  • Keep super-instruction fallback inside the main interpreter loop instead of executing decomposed opcodes through a side helper.
  • Preserve normal per-opcode behavior during fallback, including tracing and EIP-4762 code-chunk charging.
  • Add regression coverage for fallback execution, opcode tracing, and Verkle code-chunk accounting.

Motivation

When a fused opcode falls back to its raw opcode sequence, the interpreter should continue execution exactly as if the unfused opcodes had been stepped normally.

The previous fallback path executed decomposed opcodes outside the main loop. That made control flow continue, but it bypassed main-loop behavior that is consensus- and tooling-relevant:

  • OnOpcode tracing for fallback-executed opcodes
  • EIP-4762 code-chunk charging/access-event updates on each stepped opcode

This change routes fallback through the existing interpreter loop so raw opcodes inherit the same gas, tracing, and PC progression semantics as normal execution.

Implementation

  • Add a fallback []OpCode queue in the interpreter loop.
  • When a fused opcode cannot pay its fused gas cost, decompose it and continue the loop in fallback mode.
  • Step decomposed opcodes through the normal opcode path, then drain the fallback queue as each opcode completes.
  • Remove the old helper that executed fallback opcodes out-of-band.

@MatusKysel
MatusKysel requested review from allformless and annielz and removed request for allformless March 26, 2026 08:44
@MatusKysel
MatusKysel merged commit 4d2ed41 into develop Mar 31, 2026
7 of 8 checks passed
@MatusKysel
MatusKysel deleted the fix/si-fallback-continue branch March 31, 2026 09:00
@allformless allformless added this to the 1.7.3 milestone Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants