docs: Explain EventWriter-only event recording divergence from zk_evm#108
Open
0xVolosnikov wants to merge 1 commit into
Open
docs: Explain EventWriter-only event recording divergence from zk_evm#1080xVolosnikov wants to merge 1 commit into
0xVolosnikov wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents the Informational audit finding (I-1) about event recording — an intentional, output-equivalent divergence from
zk_evmthat was previously only tersely noted.zk_evmrecords theEventopcode from any emitter (keeping the emitter address) and filters down to theEventWritersystem contract (0x800d) later in the pipeline. vm2 instead only records events emitted by theEventWriterin the first place — the only contract that runs theEventopcode in real execution — which is whyEventhas noaddressfield. 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
Eventdoc comment (state_interface.rs) to explain thezk_evmbehavior and why vm2 omits the address field.Eventhandler (event.rs) pointing to theEventdocs.Testing
cargo build -p zksync_vm2 -p zksync_vm2_interface— passescargo doc -p zksync_vm2_interface --no-deps— generates cleanly🤖 Generated with Claude Code