-
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): Fast VM integration (#1949)
## What ❔ Integrates the new VM into server codebase: - Allows to run the new VM in the state keeper / batch executor (but not the API server sandbox). The new VM is disabled by default everywhere and requires an explicit opt-in. - Introduces the new component, VM playground, to test the new VM. - Runs the load test with the new VM in CI. ## Why ❔ New VM is several times more efficient as per preliminary benchmarks and is easier to maintain. ## 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`. --------- Co-authored-by: Fedor Sakharov <[email protected]> Co-authored-by: Alex Ostrovski <[email protected]> Co-authored-by: Alex Ostrovski <[email protected]>
- Loading branch information
1 parent
b8609eb
commit b752a54
Showing
150 changed files
with
9,112 additions
and
1,016 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//! Basic VM types that shared widely enough to not put them in the `multivm` crate. | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Debug, Clone, Copy)] | ||
pub enum VmVersion { | ||
M5WithoutRefunds, | ||
M5WithRefunds, | ||
M6Initial, | ||
M6BugWithCompressionFixed, | ||
Vm1_3_2, | ||
VmVirtualBlocks, | ||
VmVirtualBlocksRefundsEnhancement, | ||
VmBoojumIntegration, | ||
Vm1_4_1, | ||
Vm1_4_2, | ||
Vm1_5_0SmallBootloaderMemory, | ||
Vm1_5_0IncreasedBootloaderMemory, | ||
} | ||
|
||
impl VmVersion { | ||
/// Returns the latest supported VM version. | ||
pub const fn latest() -> VmVersion { | ||
Self::Vm1_5_0IncreasedBootloaderMemory | ||
} | ||
} | ||
|
||
/// Mode in which to run the new fast VM implementation. | ||
#[derive(Debug, Clone, Copy, Default, PartialEq, Serialize, Deserialize)] | ||
#[serde(rename_all = "snake_case")] | ||
pub enum FastVmMode { | ||
/// Run only the old VM. | ||
#[default] | ||
Old, | ||
/// Run only the new Vm. | ||
New, | ||
/// Run both the new and old VM and compare their outputs for each transaction execution. | ||
Shadow, | ||
} |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.