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): add gateway changes to fast vm #3236

Merged
merged 5 commits into from
Nov 12, 2024
Merged

Conversation

perekopskiy
Copy link
Contributor

What ❔

Ports VM changes to vm_fast that are needed for gateway version. Code changes are mostly copied from vm_latest

Why ❔

vm_fast should support new protocol version

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 zkstack dev fmt and zkstack dev lint.

@perekopskiy perekopskiy marked this pull request as ready for review November 7, 2024 19:01
slowli
slowli previously approved these changes Nov 12, 2024
Copy link
Contributor

@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.

Would it be possible to unit-test pubdata logic in multivm? (I'd imagine by setting ProtocolVersionId to the gateway version.) AFAICT, pubdata-related fields are covered by shadow VM checks, so these tests could help checking that the relevant logic works identically for vm_latest and vm_fast. Can be done separately, of course.

core/lib/multivm/src/versions/vm_fast/version.rs Outdated Show resolved Hide resolved

// Save the pubdata for the future initial bootloader memory building
self.bootloader_state
.set_pubdata_input(pubdata_input.clone());
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: clone() isn't necessary here.

Also, since pubdata_input is almost only read from the VM, so it could be relatively straightforward to return pubdata_input from this function (e.g., by supplying pubdata: Option<(&dyn PubdataBuilder, &mut PubdataInput)> to it), and then use it in finish_batch(). I'm not sure a similar transform would work for vm_latest though, and we'd probably want to keep BootloaderState equivalent for both (ideally, it'd make sense to share it).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed clone.
Not sure I understood the point for returning pubdata_input, can you elaborate on why is it better than storing and reading it from BootloaderState?

@perekopskiy
Copy link
Contributor Author

Would it be possible to unit-test pubdata logic in multivm?

Do you mean something particular? Rollup/Validium pubdata builders' logic is covered with tests in pubdata_builders module. We also have a vm test in sync-layer-stable that checks pubdata_inputs more thoroughly, it will be merged to main soonish.

@perekopskiy perekopskiy added this pull request to the merge queue Nov 12, 2024
Merged via the queue into main with commit f3a2517 Nov 12, 2024
33 checks passed
@perekopskiy perekopskiy deleted the support-gateway-in-vm-fast branch November 12, 2024 17:13
github-merge-queue bot pushed a commit that referenced this pull request Nov 19, 2024
🤖 I have created a release *beep* *boop*
---


##
[25.2.0](core-v25.1.0...core-v25.2.0)
(2024-11-19)


### Features

* add more metrics for the tee_prover
([#3276](#3276))
([8b62434](8b62434))
* **api-server:** add `yParity` for non-legacy txs
([#3246](#3246))
([6ea36d1](6ea36d1))
* **consensus:** fallback json rpc syncing for consensus
([#3211](#3211))
([726203b](726203b))
* **contract-verifier:** Adapt contract verifier API for EVM bytecodes
([#3234](#3234))
([4509179](4509179))
* **contract-verifier:** Support Solidity contracts with EVM bytecode in
contract verifier
([#3225](#3225))
([8a3a82c](8a3a82c))
* **contract-verifier:** Support Vyper toolchain for EVM bytecodes
([#3251](#3251))
([75f7db9](75f7db9))
* **en:** Support Merkle tree recovery with pruning enabled
([#3172](#3172))
([7b8640a](7b8640a))
* ProverJobProcessor & circuit prover
([#3287](#3287))
([98823f9](98823f9))
* **prover:** Move prover_autoscaler config into crate
([#3222](#3222))
([1b33b5e](1b33b5e))
* **vm_executor:** Add new histogram metric for gas per tx in
vm_executor
([#3215](#3215))
([3606fc1](3606fc1))
* **vm:** add gateway changes to fast vm
([#3236](#3236))
([f3a2517](f3a2517))


### Bug Fixes

* **merkle-tree:** Repair stale keys for tree in background
([#3200](#3200))
([363b4f0](363b4f0))
* **tracer:** Add error to flat tracer
([#3306](#3306))
([7c93c47](7c93c47))
* use_dummy_inclusion_data condition
([#3244](#3244))
([6e3c36e](6e3c36e))
* **vm:** Do not require experimental VM config
([#3270](#3270))
([54e4b00](54e4b00))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: zksync-era-bot <zksync-era-bot@users.noreply.github.com>
Deniallugo pushed a commit that referenced this pull request Nov 21, 2024
🤖 I have created a release *beep* *boop*
---


##
[25.2.0](core-v25.1.0...core-v25.2.0)
(2024-11-19)


### Features

* add more metrics for the tee_prover
([#3276](#3276))
([8b62434](8b62434))
* **api-server:** add `yParity` for non-legacy txs
([#3246](#3246))
([6ea36d1](6ea36d1))
* **consensus:** fallback json rpc syncing for consensus
([#3211](#3211))
([726203b](726203b))
* **contract-verifier:** Adapt contract verifier API for EVM bytecodes
([#3234](#3234))
([4509179](4509179))
* **contract-verifier:** Support Solidity contracts with EVM bytecode in
contract verifier
([#3225](#3225))
([8a3a82c](8a3a82c))
* **contract-verifier:** Support Vyper toolchain for EVM bytecodes
([#3251](#3251))
([75f7db9](75f7db9))
* **en:** Support Merkle tree recovery with pruning enabled
([#3172](#3172))
([7b8640a](7b8640a))
* ProverJobProcessor & circuit prover
([#3287](#3287))
([98823f9](98823f9))
* **prover:** Move prover_autoscaler config into crate
([#3222](#3222))
([1b33b5e](1b33b5e))
* **vm_executor:** Add new histogram metric for gas per tx in
vm_executor
([#3215](#3215))
([3606fc1](3606fc1))
* **vm:** add gateway changes to fast vm
([#3236](#3236))
([f3a2517](f3a2517))


### Bug Fixes

* **merkle-tree:** Repair stale keys for tree in background
([#3200](#3200))
([363b4f0](363b4f0))
* **tracer:** Add error to flat tracer
([#3306](#3306))
([7c93c47](7c93c47))
* use_dummy_inclusion_data condition
([#3244](#3244))
([6e3c36e](6e3c36e))
* **vm:** Do not require experimental VM config
([#3270](#3270))
([54e4b00](54e4b00))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: zksync-era-bot <zksync-era-bot@users.noreply.github.com>
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