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: vm2 account validation #2863

Merged

Conversation

joonazan
Copy link
Contributor

@joonazan joonazan commented Sep 12, 2024

Implements an account validation gas limit and the validation tracer for vm2, along with better tests for validation.

Instead of a second gas limit like in vm_latest, the normal gas limit is used. Unfortunately this means that the VM is not safe to use in the sequencer until we forbid the use of gasleft. I didn't do it here because it requires something like taint analysis and could break existing contracts that didn't know that gasleft is forbidden.

@joonazan joonazan force-pushed the jms-pla-908-account-validation-properly-handle-when-out-of-gas branch 2 times, most recently from 5055b79 to b3c6f60 Compare September 12, 2024 16:45
@joonazan joonazan force-pushed the jms-pla-908-account-validation-properly-handle-when-out-of-gas branch 4 times, most recently from a79945d to d3539bb Compare October 8, 2024 19:04
@joonazan joonazan changed the base branch from main to aov-pla-1038-integrate-new-vm-into-api-server-no-tracers October 10, 2024 11:47
@joonazan joonazan force-pushed the jms-pla-908-account-validation-properly-handle-when-out-of-gas branch from 02e190e to 5c80c9c Compare October 10, 2024 16:07
@joonazan joonazan force-pushed the jms-pla-908-account-validation-properly-handle-when-out-of-gas branch from 71e56d8 to 372f76a Compare October 22, 2024 17:01
@joonazan joonazan requested a review from slowli October 23, 2024 16:21
Base automatically changed from aov-pla-1038-integrate-new-vm-into-api-server-no-tracers to main October 25, 2024 14:07
@joonazan joonazan force-pushed the jms-pla-908-account-validation-properly-handle-when-out-of-gas branch from d82c52a to 0074bba Compare October 25, 2024 20:13
@joonazan joonazan marked this pull request as ready for review October 25, 2024 20:19
@joonazan joonazan changed the title feat: vm2 account validation gas limit feat: vm2 account validation Oct 25, 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.

Sorry for a delayed review.

core/lib/multivm/src/versions/vm_fast/vm.rs Outdated Show resolved Hide resolved
core/lib/multivm/src/versions/vm_fast/validation_tracer.rs Outdated Show resolved Hide resolved
core/lib/multivm/src/versions/vm_fast/validation_tracer.rs Outdated Show resolved Hide resolved
core/lib/vm_executor/src/oneshot/mod.rs Outdated Show resolved Hide resolved
core/lib/vm_executor/src/oneshot/mod.rs Outdated Show resolved Hide resolved
core/lib/vm_executor/src/oneshot/mod.rs Outdated Show resolved Hide resolved
@joonazan joonazan enabled auto-merge November 14, 2024 11:54
@joonazan joonazan force-pushed the jms-pla-908-account-validation-properly-handle-when-out-of-gas branch from 2c8cd98 to 40484a7 Compare November 14, 2024 12:10
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.

Some preliminary comments; will look through the PR once again tomorrow.

core/lib/multivm/src/versions/shadow/mod.rs Outdated Show resolved Hide resolved
core/lib/multivm/src/versions/testonly/require_eip712.rs Outdated Show resolved Hide resolved
core/lib/multivm/src/versions/vm_fast/vm.rs Outdated Show resolved Hide resolved
core/lib/multivm/src/versions/vm_fast/vm.rs Outdated Show resolved Hide resolved
core/lib/multivm/src/versions/vm_fast/validation_tracer.rs Outdated Show resolved Hide resolved
core/lib/multivm/src/versions/vm_fast/tests/mod.rs Outdated Show resolved Hide resolved
core/lib/vm_executor/src/oneshot/mod.rs Outdated Show resolved Hide resolved
@slowli slowli disabled auto-merge December 3, 2024 16:45
@slowli slowli added this pull request to the merge queue Dec 19, 2024
Merged via the queue into main with commit af149a0 Dec 19, 2024
32 checks passed
@slowli slowli deleted the jms-pla-908-account-validation-properly-handle-when-out-of-gas branch December 19, 2024 11:01
github-merge-queue bot pushed a commit that referenced this pull request Dec 19, 2024
🤖 I have created a release *beep* *boop*
---


##
[25.4.0](core-v25.3.0...core-v25.4.0)
(2024-12-19)


### Features

* add support for custom genesis state
([#3259](#3259))
([3cffdb2](3cffdb2))
* **consensus:** Added view_timeout to consensus config
([#3383](#3383))
([fc02a8f](fc02a8f))
* Support stable compiler for VM (and some other crates)
([#3248](#3248))
([cbee99d](cbee99d))
* vm2 account validation
([#2863](#2863))
([af149a0](af149a0))


### Bug Fixes

* **contract-verifier:** Fix version extraction in gh resolver
([#3378](#3378))
([9a10dcf](9a10dcf))

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

2 participants