Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vm): Extract VM interface to separate crate #2638

Merged
merged 17 commits into from
Aug 13, 2024

Conversation

slowli
Copy link
Contributor

@slowli slowli commented Aug 12, 2024

What ❔

  • Refactors zksync_multivm crate by extracting its interface part into a separate crate.
  • Revises zksync_state / zksync_multivm uses in the workspace.

Why ❔

  • This eliminates multivm dependency on zksync_state, which is quite heavyweight (depends on sqlx, rocksdb etc.).
  • Makes VM interface better defined and easier to reason about.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zk fmt and zk lint.

@slowli slowli marked this pull request as ready for review August 12, 2024 14:42
Copy link
Contributor Author

@slowli slowli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The changeset stats look monstrous, but most files just have imports changed.
  • I plan to try moving some VM-related types from zksync_types and zksync_utils into zksync_vm_interface in a follow-up PR; this one is large as-is.

Copy link
Contributor

@Deniallugo Deniallugo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Glad you managed to extract it

Copy link
Member

@popzxc popzxc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot even express how happy I am to see that change, thank you! ❤️

I love the fact that traits from zksync_state were moved to the new crate. If I don't miss anything, probably it means that era-test-node no longer will have to depend on zksync_dal (which was a shame, given that it doesn't use Postgres in any way), so the benefits here expand beyond this repository :)

If we think about further steps here, I have the following thing in mind:
We probably should prepare abstractions to extract execution_sandbox from the API. I have a feeling that the abstraction for VmBootstrap I proposed in the comment may be a significant chunk of work here. If it will encompass stuff like loading system contracts, then using historical/playground system contracts in the API should work out of the box. This will be a path towards having a single interface for the VM instead of 3.5 (state keeper/vm runner, API, era_test_node) and help with (currently somewhat ugly) implementation of eth_call in the consensus module.

core/lib/vm_utils/Cargo.toml Show resolved Hide resolved
@slowli slowli added this pull request to the merge queue Aug 13, 2024
@slowli slowli removed this pull request from the merge queue due to a manual request Aug 13, 2024
@slowli slowli added this pull request to the merge queue Aug 13, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 13, 2024
@slowli slowli added this pull request to the merge queue Aug 13, 2024
Merged via the queue into main with commit cb9ac4e Aug 13, 2024
55 checks passed
@slowli slowli deleted the aov-pla-1012-extract-vm-interface-to-separate-crate branch August 13, 2024 12:02
github-merge-queue bot pushed a commit that referenced this pull request Aug 16, 2024
🤖 I have created a release *beep* *boop*
---


##
[16.4.0](prover-v16.3.0...prover-v16.4.0)
(2024-08-16)


### Features

* Bump harness & gpu deps
([#2634](#2634))
([2a7d566](2a7d566))
* Poll the main node API for attestation status - relaxed (BFT-496)
([#2583](#2583))
([b45aa91](b45aa91))
* **vlog:** Report observability config, flush, and shutdown
([#2622](#2622))
([e23e661](e23e661))
* **vm:** Extract VM interface to separate crate
([#2638](#2638))
([cb9ac4e](cb9ac4e))
* **vm:** Fast VM integration
([#1949](#1949))
([b752a54](b752a54))


### Bug Fixes

* Bump prover dependencies & rust toolchain
([#2600](#2600))
([849c6a5](849c6a5))
* **prover:** Fix NWG
([#2590](#2590))
([9b58ae9](9b58ae9))
* **prover:** Updated README.md
([#2604](#2604))
([be9f357](be9f357))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

3 participants