zksync_multivm

Crates.iozksync_multivm
lib.rszksync_multivm
version27.0.0-non-semver-compat
sourcesrc
created_at2024-07-12 13:23:19.766139+00
updated_at2025-03-21 16:59:20.486119+00
descriptionZKsync out-of-circuit VM
homepagehttps://zksync.io/
repositoryhttps://github.com/matter-labs/zksync-era
max_upload_size
id1300683
size4,115,933
(CratesMatterLabs)

documentation

README

ZKsync Era VM Wrapper

This crate represents a wrapper over several versions of VM that have been used by the ZKsync Era node. It contains the glue code that allows switching the VM version based on the externally provided marker while preserving the public interface. This crate exists to enable the external node to process breaking upgrades and re-execute all the transactions from the genesis block.

Developer guidelines

Adding tests

If you want to add unit tests for the VM wrapper, consider the following:

  • Whenever possible, make tests reusable; declare test logic in the testonly module, and then instantiate tests using this logic for the supported VM versions. If necessary, extend the tested VM trait so that test logic can be defined in a generic way. See the testonly module docs for more detailed guidelines.
  • If you define a generic test, don't forget to add its instantiations for all supported VMs (vm_latest, vm_fast and shadow). shadow tests allow checking VM divergences for free!
  • Do not use an RNG where it can be avoided (e.g., for test contract addresses).
  • Avoid using zero / default values in cases they can be treated specially by the tested code.
Commit count: 2268

cargo fmt