Merged
Conversation
RomanBrodetski
added a commit
to matter-labs/zksync-os-server
that referenced
this pull request
Oct 24, 2025
Adding a separate pipeline item for running the revm execution environment to compare state results. The zksync-revm uses a Database with access to a custom state handler. All state changes across one block are accumulated in an in-memory (cache) database, and for each new block, the data is loaded from the server state handler. This means that each block comparison is done separately, and if a mismatch happens in block X, the block X + 1 comparison won’t be affected. You can find the zksync-revm here: - matter-labs/zksync-os-revm#2 --------- Co-authored-by: romanbrodetski <rb@matterlabs.dev>
itegulov
previously approved these changes
Dec 8, 2025
Contributor
itegulov
left a comment
There was a problem hiding this comment.
Mostly nits, LGTM otherwise. At the very least I'd add basic GHA workflows and clarify how ZkSpecId is expected to be evolved going forward.
This PR upgrades revm 29.0.0->31.0.2. There have been a few changes in the interfaces so the code had to be adapted accordingly. No functional changes expected.
itegulov
approved these changes
Dec 9, 2025
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.
ZKsync OS variant of REVM. Most of the code is just imports from REVM and wrappers that implement REVM traits. The big things to review:
precompiles— precompiles should behave exactly the same as on ZKsync OS, and if a precompile is present on ZKsync OS, then it must be present in this REVM and vice versa.hooks— same as precompiles. All ZKsync OS hooks should be implemented here as well. Pay attention to:gas. How much used by precompiles in a positive testcase. Out of Gas handling.staticmode.delegatecall.tx_types- all transaction types should behave exactly the same way as on ZKsync OS. For EIP-1559 transactions, this means correctly charging fees and not burning the base fee. For pre-155 txs, don’t check the chain ID. For L1 → L2 transactions (priority and upgrade types), don’t perform validation, and don’t bump the nonce when validating the transaction.ZKsyncHandler- this is the main component. Most of the custom logic is implemented here. It handles transaction validation, refunds, and state change reverts. Pay special attention togas_used_overrideandforce_failing. I recommend reading the vanilla REVM. Unfortunately, I couldn’t find good documentation for this component.