-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vm): Extract oneshot VM executor interface (#2671)
## What ❔ Extracts oneshot VM executor from the API server crate. ## Why ❔ Simplifies reasoning about oneshot VM execution and its maintenance. Allows for alternative implementations. ## 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 `zk fmt` and `zk lint`.
- Loading branch information
Showing
19 changed files
with
859 additions
and
811 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
pub use self::{ | ||
execution_mode::VmExecutionMode, | ||
l1_batch_env::L1BatchEnv, | ||
l2_block::L2BlockEnv, | ||
l2_block::{L2BlockEnv, StoredL2BlockEnv}, | ||
system_env::{SystemEnv, TxExecutionMode}, | ||
}; | ||
|
||
mod execution_mode; | ||
mod l1_batch_env; | ||
mod l2_block; | ||
mod system_env; | ||
|
||
/// Full environment for oneshot transaction / call execution. | ||
#[derive(Debug)] | ||
pub struct OneshotEnv { | ||
/// System environment. | ||
pub system: SystemEnv, | ||
/// Part of the environment specific to an L1 batch. | ||
pub l1_batch: L1BatchEnv, | ||
/// Part of the environment representing the current L2 block. Can be used to override storage slots | ||
/// in the system context contract, which are set from `L1BatchEnv.first_l2_block` by default. | ||
pub current_block: Option<StoredL2BlockEnv>, | ||
} |
Oops, something went wrong.