Skip to content

Commit

Permalink
feat(vm): Support EVM emulation in fast VM (#3163)
Browse files Browse the repository at this point in the history
## What ❔

Supports EVM emulation if it is signaled via `SystemEnv`.

## Why ❔

Fast VM should have feature parity with the legacy VM.

## Checklist

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [x] Tests for the changes have been added / updated.
- [x] Documentation comments have been added / updated.
- [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev
lint`.
  • Loading branch information
slowli authored Oct 31, 2024
1 parent 2721396 commit 9ad1f0d
Show file tree
Hide file tree
Showing 12 changed files with 802 additions and 496 deletions.
48 changes: 48 additions & 0 deletions core/lib/multivm/src/versions/shadow/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,54 @@ mod default_aa {
}
}

mod evm_emulator {
use test_casing::{test_casing, Product};

use crate::versions::testonly::evm_emulator::*;

#[test]
fn tracing_evm_contract_deployment() {
test_tracing_evm_contract_deployment::<super::ShadowedFastVm>();
}

#[test]
fn mock_emulator_basics() {
test_mock_emulator_basics::<super::ShadowedFastVm>();
}

#[test_casing(2, [false, true])]
#[test]
fn mock_emulator_with_payment(deploy_emulator: bool) {
test_mock_emulator_with_payment::<super::ShadowedFastVm>(deploy_emulator);
}

#[test_casing(4, Product(([false, true], [false, true])))]
#[test]
fn mock_emulator_with_recursion(deploy_emulator: bool, is_external: bool) {
test_mock_emulator_with_recursion::<super::ShadowedFastVm>(deploy_emulator, is_external);
}

#[test]
fn calling_to_mock_emulator_from_native_contract() {
test_calling_to_mock_emulator_from_native_contract::<super::ShadowedFastVm>();
}

#[test]
fn mock_emulator_with_deployment() {
test_mock_emulator_with_deployment::<super::ShadowedFastVm>();
}

#[test]
fn mock_emulator_with_delegate_call() {
test_mock_emulator_with_delegate_call::<super::ShadowedFastVm>();
}

#[test]
fn mock_emulator_with_static_call() {
test_mock_emulator_with_static_call::<super::ShadowedFastVm>();
}
}

mod gas_limit {
use crate::versions::testonly::gas_limit::*;

Expand Down
Loading

0 comments on commit 9ad1f0d

Please sign in to comment.