Skip to content

docs: Explain EventWriter-only event recording divergence from zk_evm#108

Open
0xVolosnikov wants to merge 1 commit into
masterfrom
docs/event-writer-divergence
Open

docs: Explain EventWriter-only event recording divergence from zk_evm#108
0xVolosnikov wants to merge 1 commit into
masterfrom
docs/event-writer-divergence

Conversation

@0xVolosnikov

Copy link
Copy Markdown
Contributor

Summary

Documents the Informational audit finding (I-1) about event recording — an intentional, output-equivalent divergence from zk_evm that was previously only tersely noted.

zk_evm records the Event opcode from any emitter (keeping the emitter address) and filters down to the EventWriter system contract (0x800d) later in the pipeline. vm2 instead only records events emitted by the EventWriter in the first place — the only contract that runs the Event opcode in real execution — which is why Event has no address field. Both approaches produce the same event set; the true originating contract is encoded in the event payload in both.

No behavior change — comments only.

Changes

  • Expand the Event doc comment (state_interface.rs) to explain the zk_evm behavior and why vm2 omits the address field.
  • Add a short comment at the recording condition in the Event handler (event.rs) pointing to the Event docs.

Testing

  • cargo build -p zksync_vm2 -p zksync_vm2_interface — passes
  • cargo doc -p zksync_vm2_interface --no-deps — generates cleanly

🤖 Generated with Claude Code

vm2 records events only from the EventWriter system contract, whereas
zk_evm records events from any emitter (storing the emitter address) and
filters down to the EventWriter later in the pipeline. This is an
intentional, output-equivalent divergence, but it was only tersely noted.

Expand the `Event` doc comment to describe the zk_evm behavior, why vm2
collapses it into a single step, and why `Event` therefore has no address
field. Add a matching comment at the recording condition in the handler.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@0xVolosnikov 0xVolosnikov requested a review from a team as a code owner July 1, 2026 18:48
@0xVolosnikov 0xVolosnikov requested a review from dimazhornyk July 1, 2026 18:48
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.

1 participant