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

fix(vm): Fix VM divergences related to validation #3567

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

slowli
Copy link
Contributor

@slowli slowli commented Feb 4, 2025

What ❔

Fixes divergences in VM execution during account validation, or reconsiders what is considered a divergence.

Why ❔

Fixes some of divergences currently observed during oneshot VM execution in the API server in CI (specifically, during the "custom account" integration test).

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.

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.

  • Locally, I've observed little (~2–3%) degradation in some wall-clock VM benchmarks w.r.t. the "default" / fast validation tracer changes; on most benchmarks, there's no observable degradation. Looks expected given that the tracer only tracks Ret(Panic) operations.
  • The PR changes fast VM semantics with "default" validation tracing; it now unconditionally fails tx execution if an out-of-gas error is encountered during validation. This is somewhat close to the legacy VM and fixes VM divergences on integration unit tests (e.g. this one). However, it's not a 1-to-1 match because the legacy VM deals with computational gas calculations, meaning that it doesn't flag some out-of-gas errors during validation, like with deep recursion.

@slowli slowli marked this pull request as ready for review February 5, 2025 09:34
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