Skip to content

Commit

Permalink
fix(tee_verifier): correctly initialize storage for re-execution
Browse files Browse the repository at this point in the history
Previously the storage for VM re-execution was initialized just from `WitnessInputMerklePaths`.
This although misses the storage values for slots, which are only read/written to by rolled back transactions.

With this commit, the TEE verifier uses `WitnessStorageState` of `VMRunWitnessInputData` to initialize the storage.
This requires waiting for the BasicWitnessInputProducer to complete
and therefore the TEE verifier input producer can be removed.
The input for the TEE verifier is now collected in the `proof_data_handler`, which enables to remove
the whole job queue for the TEE verifier input producer.

Co-authored-by: Patrick Beza <[email protected]>
Signed-off-by: Harald Hoyer <[email protected]>
  • Loading branch information
haraldh and pbeza committed Oct 4, 2024
1 parent 2a7e72b commit ef9a41d
Show file tree
Hide file tree
Showing 45 changed files with 396 additions and 1,221 deletions.
25 changes: 4 additions & 21 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ members = [
"core/node/consensus",
"core/node/contract_verification_server",
"core/node/api_server",
"core/node/tee_verifier_input_producer",
"core/node/base_token_adjuster",
"core/node/external_proof_integration_api",
"core/node/logs_bloom_backfill",
Expand Down Expand Up @@ -307,6 +306,5 @@ zksync_node_storage_init = { version = "0.1.0", path = "core/node/node_storage_i
zksync_node_consensus = { version = "0.1.0", path = "core/node/consensus" }
zksync_contract_verification_server = { version = "0.1.0", path = "core/node/contract_verification_server" }
zksync_node_api_server = { version = "0.1.0", path = "core/node/api_server" }
zksync_tee_verifier_input_producer = { version = "0.1.0", path = "core/node/tee_verifier_input_producer" }
zksync_base_token_adjuster = { version = "0.1.0", path = "core/node/base_token_adjuster" }
zksync_logs_bloom_backfill = { version = "0.1.0", path = "core/node/logs_bloom_backfill" }
2 changes: 1 addition & 1 deletion core/bin/zksync_server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct Cli {
/// Comma-separated list of components to launch.
#[arg(
long,
default_value = "api,tree,eth,state_keeper,housekeeper,tee_verifier_input_producer,commitment_generator,da_dispatcher,vm_runner_protective_reads"
default_value = "api,tree,eth,state_keeper,housekeeper,commitment_generator,da_dispatcher,vm_runner_protective_reads"
)]
components: ComponentsToRun,
/// Path to the yaml config. If set, it will be used instead of env vars.
Expand Down
12 changes: 0 additions & 12 deletions core/bin/zksync_server/src/node_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ use zksync_node_framework::{
main_batch_executor::MainBatchExecutorLayer, mempool_io::MempoolIOLayer,
output_handler::OutputHandlerLayer, RocksdbStorageOptions, StateKeeperLayer,
},
tee_verifier_input_producer::TeeVerifierInputProducerLayer,
vm_runner::{
bwip::BasicWitnessInputProducerLayer, playground::VmPlaygroundLayer,
protective_reads::ProtectiveReadsWriterLayer,
Expand Down Expand Up @@ -494,14 +493,6 @@ impl MainNodeBuilder {
Ok(self)
}

fn add_tee_verifier_input_producer_layer(mut self) -> anyhow::Result<Self> {
self.node.add_layer(TeeVerifierInputProducerLayer::new(
self.genesis_config.l2_chain_id,
));

Ok(self)
}

fn add_da_client_layer(mut self) -> anyhow::Result<Self> {
let Some(da_client_config) = self.configs.da_client_config.clone() else {
tracing::warn!("No config for DA client, using the NoDA client");
Expand Down Expand Up @@ -744,9 +735,6 @@ impl MainNodeBuilder {
Component::EthTxManager => {
self = self.add_eth_tx_manager_layer()?;
}
Component::TeeVerifierInputProducer => {
self = self.add_tee_verifier_input_producer_layer()?;
}
Component::Housekeeper => {
self = self
.add_house_keeper_layer()?
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

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

Loading

0 comments on commit ef9a41d

Please sign in to comment.