Skip to content

Commit

Permalink
feat(vm): Extract oneshot VM executor – environment types (#2885)
Browse files Browse the repository at this point in the history
## What ❔

Continues oneshot VM executor extraction by moving generic environment
types to the `zksync_vm_executor` crate.

## Why ❔

Makes it possible to use the VM executor outside the API server. E.g.,
it's now used in `zksync_node_consensus`.

## 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
slowli authored Sep 23, 2024
1 parent d997041 commit a2d4126
Show file tree
Hide file tree
Showing 21 changed files with 1,079 additions and 808 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions core/bin/external_node/src/node_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use zksync_config::{
PostgresConfig,
};
use zksync_metadata_calculator::{MetadataCalculatorConfig, MetadataCalculatorRecoveryConfig};
use zksync_node_api_server::{tx_sender::ApiContracts, web3::Namespace};
use zksync_node_api_server::web3::Namespace;
use zksync_node_framework::{
implementations::layers::{
batch_status_updater::BatchStatusUpdaterLayer,
Expand Down Expand Up @@ -380,12 +380,10 @@ impl ExternalNodeBuilder {
latest_values_cache_size: self.config.optional.latest_values_cache_size() as u64,
};
let max_vm_concurrency = self.config.optional.vm_concurrency_limit;
let api_contracts = ApiContracts::load_from_disk_blocking(); // TODO (BFT-138): Allow to dynamically reload API contracts;
let tx_sender_layer = TxSenderLayer::new(
(&self.config).into(),
postgres_storage_config,
max_vm_concurrency,
api_contracts,
)
.with_whitelisted_tokens_for_aa_cache(true);

Expand Down
3 changes: 1 addition & 2 deletions core/bin/zksync_server/src/node_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use zksync_config::{
use zksync_core_leftovers::Component;
use zksync_metadata_calculator::MetadataCalculatorConfig;
use zksync_node_api_server::{
tx_sender::{ApiContracts, TxSenderConfig},
tx_sender::TxSenderConfig,
web3::{state::InternalApiConfig, Namespace},
};
use zksync_node_framework::{
Expand Down Expand Up @@ -322,7 +322,6 @@ impl MainNodeBuilder {
),
postgres_storage_caches_config,
rpc_config.vm_concurrency_limit(),
ApiContracts::load_from_disk_blocking(), // TODO (BFT-138): Allow to dynamically reload API contracts
));
Ok(self)
}
Expand Down
Loading

0 comments on commit a2d4126

Please sign in to comment.