diff --git a/core/bin/external_node/src/main.rs b/core/bin/external_node/src/main.rs index 07ee4140602d..8ce24431ebce 100644 --- a/core/bin/external_node/src/main.rs +++ b/core/bin/external_node/src/main.rs @@ -7,7 +7,7 @@ use metrics::EN_METRICS; use prometheus_exporter::PrometheusExporterConfig; use tokio::{sync::watch, task, time::sleep}; use zksync_basic_types::{Address, L2ChainId}; -use zksync_config::configs::database::MerkleTreeMode; +use zksync_config::configs::{database::MerkleTreeMode, eth_sender::PubdataStorageMode}; use zksync_core::{ api_server::{ execution_sandbox::VmConcurrencyLimiter, @@ -228,7 +228,8 @@ async fn init_tasks( .context("failed to build a tree_pool")?; let tree_handle = task::spawn(metadata_calculator.run(tree_pool, tree_stop_receiver)); - let consistency_checker_handle = tokio::spawn(consistency_checker.run(stop_receiver.clone())); + let consistency_checker_handle = + tokio::spawn(consistency_checker.run(stop_receiver.clone(), &PubdataStorageMode::Rollup)); let updater_handle = task::spawn(batch_status_updater.run(stop_receiver.clone())); let sk_handle = task::spawn(state_keeper.run()); diff --git a/core/lib/config/src/configs/eth_sender.rs b/core/lib/config/src/configs/eth_sender.rs index cd44daed17f8..9730387087c4 100644 --- a/core/lib/config/src/configs/eth_sender.rs +++ b/core/lib/config/src/configs/eth_sender.rs @@ -35,6 +35,7 @@ impl ETHSenderConfig { l1_batch_min_age_before_execute_seconds: None, max_acceptable_priority_fee_in_gwei: 100000000000, proof_loading_mode: ProofLoadingMode::OldProofFromDb, + pubdata_storage_mode: PubdataStorageMode::Rollup, }, gas_adjuster: GasAdjusterConfig { default_priority_fee_per_gas: 1000000000, @@ -63,6 +64,12 @@ pub enum ProofLoadingMode { FriProofFromGcs, } +#[derive(Debug, Deserialize, Clone, Copy, PartialEq)] +pub enum PubdataStorageMode { + Rollup, + Validium, +} + #[derive(Debug, Deserialize, Clone, PartialEq)] pub struct SenderConfig { pub aggregated_proof_sizes: Vec, @@ -96,6 +103,8 @@ pub struct SenderConfig { /// The mode in which proofs are loaded, either from DB/GCS for FRI/Old proof. pub proof_loading_mode: ProofLoadingMode, + + pub pubdata_storage_mode: PubdataStorageMode, } impl SenderConfig { diff --git a/core/lib/env_config/src/eth_sender.rs b/core/lib/env_config/src/eth_sender.rs index f0ee6030b029..f8c21e0f22d6 100644 --- a/core/lib/env_config/src/eth_sender.rs +++ b/core/lib/env_config/src/eth_sender.rs @@ -26,7 +26,9 @@ impl FromEnv for GasAdjusterConfig { #[cfg(test)] mod tests { - use zksync_config::configs::eth_sender::{ProofLoadingMode, ProofSendingMode}; + use zksync_config::configs::eth_sender::{ + ProofLoadingMode, ProofSendingMode, PubdataStorageMode, + }; use super::*; use crate::test_utils::{hash, EnvMutex}; @@ -54,6 +56,8 @@ mod tests { l1_batch_min_age_before_execute_seconds: Some(1000), max_acceptable_priority_fee_in_gwei: 100_000_000_000, proof_loading_mode: ProofLoadingMode::OldProofFromDb, + + pubdata_storage_mode: PubdataStorageMode::Rollup, }, gas_adjuster: GasAdjusterConfig { default_priority_fee_per_gas: 20000000000, diff --git a/core/lib/types/src/aggregated_operations.rs b/core/lib/types/src/aggregated_operations.rs index 006eca562e71..84d834a5fbab 100644 --- a/core/lib/types/src/aggregated_operations.rs +++ b/core/lib/types/src/aggregated_operations.rs @@ -8,6 +8,7 @@ use zkevm_test_harness::{ witness::oracle::VmWitnessOracle, }; use zksync_basic_types::{ethabi::Token, L1BatchNumber}; +use zksync_config::configs::eth_sender::PubdataStorageMode; use crate::{commitment::L1BatchWithMetadata, ProtocolVersionId, U256}; @@ -32,12 +33,12 @@ pub struct L1BatchCommitOperation { } impl L1BatchCommitOperation { - pub fn get_eth_tx_args(&self) -> Vec { + pub fn get_eth_tx_args(&self, pubdata_storage_mode: &PubdataStorageMode) -> Vec { let stored_batch_info = self.last_committed_l1_batch.l1_header_data(); let l1_batches_to_commit = self .l1_batches .iter() - .map(L1BatchWithMetadata::l1_commit_data) + .map(|batch| L1BatchWithMetadata::l1_commit_data(batch, pubdata_storage_mode)) .collect(); vec![stored_batch_info, Token::Array(l1_batches_to_commit)] diff --git a/core/lib/types/src/commitment.rs b/core/lib/types/src/commitment.rs index 8a2cd794d9b1..b016709b4889 100644 --- a/core/lib/types/src/commitment.rs +++ b/core/lib/types/src/commitment.rs @@ -9,6 +9,7 @@ use std::{collections::HashMap, convert::TryFrom}; use serde::{Deserialize, Serialize}; +use zksync_config::configs::eth_sender::PubdataStorageMode; use zksync_mini_merkle_tree::MiniMerkleTree; use zksync_system_constants::{ L2_TO_L1_LOGS_TREE_ROOT_KEY, STATE_DIFF_HASH_KEY, ZKPORTER_IS_AVAILABLE, @@ -159,7 +160,7 @@ impl L1BatchWithMetadata { } /// Encodes the L1Batch into CommitBatchInfo (see IExecutor.sol). - pub fn l1_commit_data(&self) -> Token { + pub fn l1_commit_data(&self, pubdata_storage_mode: &PubdataStorageMode) -> Token { if self.header.protocol_version.unwrap().is_pre_boojum() { Token::Tuple(vec![ Token::Uint(U256::from(self.header.number.0)), @@ -192,6 +193,19 @@ impl L1BatchWithMetadata { ), ]) } else { + let total_l2_to_l1_pubdata = match pubdata_storage_mode { + PubdataStorageMode::Rollup => + // `totalL2ToL1Pubdata` + { + Token::Bytes( + self.header + .pubdata_input + .clone() + .unwrap_or(self.construct_pubdata()), + ) + } + PubdataStorageMode::Validium => Token::Bytes(vec![]), + }; Token::Tuple(vec![ // `batchNumber` Token::Uint(U256::from(self.header.number.0)), @@ -228,19 +242,16 @@ impl L1BatchWithMetadata { ), // `systemLogs` Token::Bytes(self.metadata.l2_l1_messages_compressed.clone()), - // `totalL2ToL1Pubdata` - Token::Bytes( - self.header - .pubdata_input - .clone() - .unwrap_or(self.construct_pubdata()), - ), + total_l2_to_l1_pubdata, ]) } } - pub fn l1_commit_data_size(&self) -> usize { - crate::ethabi::encode(&[Token::Array(vec![self.l1_commit_data()])]).len() + pub fn l1_commit_data_size(&self, pubdata_storage_mode: &PubdataStorageMode) -> usize { + crate::ethabi::encode(&[Token::Array( + vec![self.l1_commit_data(pubdata_storage_mode)], + )]) + .len() } /// Packs all pubdata needed for batch commitment in boojum into one bytes array. The packing contains the diff --git a/core/lib/zksync_core/src/consistency_checker/mod.rs b/core/lib/zksync_core/src/consistency_checker/mod.rs index 768684e5fbaf..0070ee42c200 100644 --- a/core/lib/zksync_core/src/consistency_checker/mod.rs +++ b/core/lib/zksync_core/src/consistency_checker/mod.rs @@ -2,6 +2,7 @@ use std::{fmt, time::Duration}; use anyhow::Context as _; use tokio::sync::watch; +use zksync_config::configs::eth_sender::PubdataStorageMode; use zksync_contracts::PRE_BOOJUM_COMMIT_FUNCTION; use zksync_dal::{ConnectionPool, StorageProcessor}; use zksync_eth_client::{clients::QueryClient, Error as L1ClientError, EthInterface}; @@ -66,6 +67,7 @@ impl LocalL1BatchCommitData { async fn new( storage: &mut StorageProcessor<'_>, batch_number: L1BatchNumber, + pubdata_storage_mode: &PubdataStorageMode, ) -> anyhow::Result> { let Some(storage_l1_batch) = storage .blocks_dal() @@ -113,7 +115,7 @@ impl LocalL1BatchCommitData { Ok(Some(Self { is_pre_boojum, - l1_commit_data: l1_batch.l1_commit_data(), + l1_commit_data: l1_batch.l1_commit_data(pubdata_storage_mode), commit_tx_hash, })) } @@ -247,7 +249,11 @@ impl ConsistencyChecker { .await?) } - pub async fn run(mut self, mut stop_receiver: watch::Receiver) -> anyhow::Result<()> { + pub async fn run( + mut self, + mut stop_receiver: watch::Receiver, + pubdata_storage_mode: &PubdataStorageMode, + ) -> anyhow::Result<()> { // It doesn't make sense to start the checker until we have at least one L1 batch with metadata. let earliest_l1_batch_number = wait_for_l1_batch_with_metadata(&self.pool, self.sleep_interval, &mut stop_receiver) @@ -285,7 +291,10 @@ impl ConsistencyChecker { // The batch might be already committed but not yet processed by the external node's tree // OR the batch might be processed by the external node's tree but not yet committed. // We need both. - let Some(local) = LocalL1BatchCommitData::new(&mut storage, batch_number).await? else { + let Some(local) = + LocalL1BatchCommitData::new(&mut storage, batch_number, pubdata_storage_mode) + .await? + else { tokio::time::sleep(self.sleep_interval).await; continue; }; diff --git a/core/lib/zksync_core/src/consistency_checker/tests/mod.rs b/core/lib/zksync_core/src/consistency_checker/tests/mod.rs index bdea516cf9f4..447db48c2133 100644 --- a/core/lib/zksync_core/src/consistency_checker/tests/mod.rs +++ b/core/lib/zksync_core/src/consistency_checker/tests/mod.rs @@ -43,7 +43,9 @@ fn create_pre_boojum_l1_batch_with_metadata(number: u32) -> L1BatchWithMetadata } fn build_commit_tx_input_data(batches: &[L1BatchWithMetadata]) -> Vec { - let commit_tokens = batches.iter().map(L1BatchWithMetadata::l1_commit_data); + let commit_tokens = batches + .iter() + .map(|batch| L1BatchWithMetadata::l1_commit_data(batch, &PubdataStorageMode::Rollup)); let commit_tokens = ethabi::Token::Array(commit_tokens.collect()); let mut encoded = vec![]; @@ -93,7 +95,10 @@ fn build_commit_tx_input_data_is_correct() { batch.header.number, ) .unwrap(); - assert_eq!(commit_data, batch.l1_commit_data()); + assert_eq!( + commit_data, + batch.l1_commit_data(&PubdataStorageMode::Rollup) + ); } } @@ -325,7 +330,7 @@ async fn normal_checker_function( }; let (stop_sender, stop_receiver) = watch::channel(false); - let checker_task = tokio::spawn(checker.run(stop_receiver)); + let checker_task = tokio::spawn(checker.run(stop_receiver, &PubdataStorageMode::Rollup)); // Add new batches to the storage. for save_action in save_actions_mapper(&l1_batches) { @@ -399,7 +404,7 @@ async fn checker_processes_pre_boojum_batches( }; let (stop_sender, stop_receiver) = watch::channel(false); - let checker_task = tokio::spawn(checker.run(stop_receiver)); + let checker_task = tokio::spawn(checker.run(stop_receiver, &PubdataStorageMode::Rollup)); // Add new batches to the storage. for save_action in save_actions_mapper(&l1_batches) { @@ -469,7 +474,7 @@ async fn checker_functions_after_snapshot_recovery(delay_batch_insertion: bool) ..create_mock_checker(client, pool.clone()) }; let (stop_sender, stop_receiver) = watch::channel(false); - let checker_task = tokio::spawn(checker.run(stop_receiver)); + let checker_task = tokio::spawn(checker.run(stop_receiver, &PubdataStorageMode::Rollup)); if delay_batch_insertion { tokio::time::sleep(Duration::from_millis(10)).await; @@ -593,10 +598,13 @@ async fn checker_detects_incorrect_tx_data(kind: IncorrectDataKind, snapshot_rec let checker = create_mock_checker(client, pool); let (_stop_sender, stop_receiver) = watch::channel(false); // The checker must stop with an error. - tokio::time::timeout(Duration::from_secs(30), checker.run(stop_receiver)) - .await - .expect("Timed out waiting for checker to stop") - .unwrap_err(); + tokio::time::timeout( + Duration::from_secs(30), + checker.run(stop_receiver, &PubdataStorageMode::Rollup), + ) + .await + .expect("Timed out waiting for checker to stop") + .unwrap_err(); } #[tokio::test] diff --git a/core/lib/zksync_core/src/eth_sender/aggregator.rs b/core/lib/zksync_core/src/eth_sender/aggregator.rs index a043b871b1e8..f1c9b9e40303 100644 --- a/core/lib/zksync_core/src/eth_sender/aggregator.rs +++ b/core/lib/zksync_core/src/eth_sender/aggregator.rs @@ -1,6 +1,8 @@ use std::sync::Arc; -use zksync_config::configs::eth_sender::{ProofLoadingMode, ProofSendingMode, SenderConfig}; +use zksync_config::configs::eth_sender::{ + ProofLoadingMode, ProofSendingMode, PubdataStorageMode, SenderConfig, +}; use zksync_contracts::BaseSystemContractsHashes; use zksync_dal::StorageProcessor; use zksync_object_store::{ObjectStore, ObjectStoreError}; @@ -157,6 +159,7 @@ impl Aggregator { &mut self.execute_criteria, ready_for_execute_batches, last_sealed_l1_batch, + &self.config.pubdata_storage_mode, ) .await; @@ -215,6 +218,7 @@ impl Aggregator { &mut self.commit_criteria, ready_for_commit_l1_batches, last_sealed_batch, + &self.config.pubdata_storage_mode, ) .await; @@ -316,6 +320,7 @@ impl Aggregator { &mut self.proof_criteria, ready_for_proof_l1_batches, last_sealed_l1_batch, + &self.config.pubdata_storage_mode, ) .await?; @@ -400,11 +405,17 @@ async fn extract_ready_subrange( publish_criteria: &mut [Box], unpublished_l1_batches: Vec, last_sealed_l1_batch: L1BatchNumber, + pubdata_storage_mode: &PubdataStorageMode, ) -> Option> { let mut last_l1_batch: Option = None; for criterion in publish_criteria { let l1_batch_by_criterion = criterion - .last_l1_batch_to_publish(storage, &unpublished_l1_batches, last_sealed_l1_batch) + .last_l1_batch_to_publish( + storage, + &unpublished_l1_batches, + last_sealed_l1_batch, + &pubdata_storage_mode, + ) .await; if let Some(l1_batch) = l1_batch_by_criterion { last_l1_batch = Some(last_l1_batch.map_or(l1_batch, |number| number.min(l1_batch))); diff --git a/core/lib/zksync_core/src/eth_sender/data_provider.rs b/core/lib/zksync_core/src/eth_sender/data_provider.rs index b1abd4ce58d9..02356858c82d 100644 --- a/core/lib/zksync_core/src/eth_sender/data_provider.rs +++ b/core/lib/zksync_core/src/eth_sender/data_provider.rs @@ -1,11 +1,16 @@ -pub trait DataProvider {} +// pub enum DataProvider { +// Rollup(Rollup), +// Validium(Validium), +// } -#[derive(Debug)] -pub struct Rollup {} +// pub trait DataProvider {} -#[derive(Debug)] -pub struct Validium {} +// #[derive(Debug)] +// pub struct Rollup {} -impl DataProvider for Rollup {} +// #[derive(Debug)] +// pub struct Validium {} -impl DataProvider for Validium {} +// impl DataProvider for Rollup {} + +// impl DataProvider for Validium {} diff --git a/core/lib/zksync_core/src/eth_sender/eth_tx_aggregator.rs b/core/lib/zksync_core/src/eth_sender/eth_tx_aggregator.rs index 5afd1f1e46e4..be7a3c65b49e 100644 --- a/core/lib/zksync_core/src/eth_sender/eth_tx_aggregator.rs +++ b/core/lib/zksync_core/src/eth_sender/eth_tx_aggregator.rs @@ -29,8 +29,6 @@ use crate::{ metrics::BlockL1Stage, }; -use super::data_provider::{DataProvider, Rollup, Validium}; - /// Data queried from L1 using multicall contract. #[derive(Debug)] pub struct MulticallData { @@ -44,10 +42,7 @@ pub struct MulticallData { /// Such as CommitBlocks, PublishProofBlocksOnchain and ExecuteBlock /// These eth_txs will be used as a queue for generating signed txs and send them later #[derive(Debug)] -pub struct EthTxAggregator -where - T: DataProvider, -{ +pub struct EthTxAggregator { aggregator: Aggregator, eth_client: Arc, config: SenderConfig, @@ -56,13 +51,9 @@ where pub(super) main_zksync_contract_address: Address, functions: ZkSyncFunctions, base_nonce: u64, - data_provider: T, } -impl EthTxAggregator -where - T: DataProvider, -{ +impl EthTxAggregator { pub fn new( config: SenderConfig, aggregator: Aggregator, @@ -71,7 +62,6 @@ where l1_multicall3_address: Address, main_zksync_contract_address: Address, base_nonce: u64, - data_provider: T, ) -> Self { let functions = ZkSyncFunctions::default(); Self { @@ -83,7 +73,6 @@ where main_zksync_contract_address, functions, base_nonce, - data_provider, } } @@ -428,7 +417,7 @@ where .as_ref() .expect("Missing ABI for commitBatches") }; - f.encode_input(&op.get_eth_tx_args()) + f.encode_input(&op.get_eth_tx_args(&self.config.pubdata_storage_mode)) } AggregatedOperation::PublishProofOnchain(op) => { assert_eq!(contracts_are_pre_boojum, operation_is_pre_boojum); diff --git a/core/lib/zksync_core/src/eth_sender/publish_criterion.rs b/core/lib/zksync_core/src/eth_sender/publish_criterion.rs index 85f6a46c960b..2e1afc2014f6 100644 --- a/core/lib/zksync_core/src/eth_sender/publish_criterion.rs +++ b/core/lib/zksync_core/src/eth_sender/publish_criterion.rs @@ -2,6 +2,7 @@ use std::fmt; use async_trait::async_trait; use chrono::Utc; +use zksync_config::configs::eth_sender::PubdataStorageMode; use zksync_dal::StorageProcessor; use zksync_types::{ aggregated_operations::AggregatedActionType, commitment::L1BatchWithMetadata, L1BatchNumber, @@ -22,6 +23,7 @@ pub trait L1BatchPublishCriterion: fmt::Debug + Send + Sync { storage: &mut StorageProcessor<'_>, consecutive_l1_batches: &[L1BatchWithMetadata], last_sealed_l1_batch: L1BatchNumber, + pubdata_storage_mode: &PubdataStorageMode, ) -> Option; } @@ -43,6 +45,7 @@ impl L1BatchPublishCriterion for NumberCriterion { _storage: &mut StorageProcessor<'_>, consecutive_l1_batches: &[L1BatchWithMetadata], _last_sealed_l1_batch: L1BatchNumber, + _pubdata_storage_mode: &PubdataStorageMode, ) -> Option { let mut batch_numbers = consecutive_l1_batches .iter() @@ -89,6 +92,7 @@ impl L1BatchPublishCriterion for TimestampDeadlineCriterion { _storage: &mut StorageProcessor<'_>, consecutive_l1_batches: &[L1BatchWithMetadata], last_sealed_l1_batch: L1BatchNumber, + _data_provider: &PubdataStorageMode, ) -> Option { let first_l1_batch = consecutive_l1_batches.iter().next()?; let last_l1_batch_number = consecutive_l1_batches.iter().last()?.header.number.0; @@ -153,6 +157,7 @@ impl L1BatchPublishCriterion for GasCriterion { storage: &mut StorageProcessor<'_>, consecutive_l1_batches: &[L1BatchWithMetadata], _last_sealed_l1_batch: L1BatchNumber, + _data_provider: &PubdataStorageMode, ) -> Option { let base_cost = agg_l1_batch_base_cost(self.op); assert!( @@ -210,17 +215,18 @@ impl L1BatchPublishCriterion for DataSizeCriterion { _storage: &mut StorageProcessor<'_>, consecutive_l1_batches: &[L1BatchWithMetadata], _last_sealed_l1_batch: L1BatchNumber, + data_provider: &PubdataStorageMode, ) -> Option { const STORED_BLOCK_INFO_SIZE: usize = 96; // size of `StoredBlockInfo` solidity struct let mut data_size_left = self.data_limit - STORED_BLOCK_INFO_SIZE; for (index, l1_batch) in consecutive_l1_batches.iter().enumerate() { - if data_size_left < l1_batch.l1_commit_data_size() { + if data_size_left < l1_batch.l1_commit_data_size(data_provider) { if index == 0 { panic!( "L1 batch #{} requires {} data, which is more than the range limit of {}", l1_batch.header.number, - l1_batch.l1_commit_data_size(), + l1_batch.l1_commit_data_size(data_provider), self.data_limit ); } @@ -236,7 +242,7 @@ impl L1BatchPublishCriterion for DataSizeCriterion { METRICS.block_aggregation_reason[&(self.op, "data_size").into()].inc(); return Some(output); } - data_size_left -= l1_batch.l1_commit_data_size(); + data_size_left -= l1_batch.l1_commit_data_size(data_provider); } None diff --git a/core/lib/zksync_core/src/eth_sender/tests.rs b/core/lib/zksync_core/src/eth_sender/tests.rs index 71f5609af531..73f484a1fd77 100644 --- a/core/lib/zksync_core/src/eth_sender/tests.rs +++ b/core/lib/zksync_core/src/eth_sender/tests.rs @@ -29,8 +29,6 @@ use crate::{ utils::testonly::create_l1_batch, }; -use super::data_provider::{DataProvider, Rollup, Validium}; - // Alias to conveniently call static methods of `ETHSender`. type MockEthTxManager = EthTxManager; @@ -45,21 +43,15 @@ static DUMMY_OPERATION: Lazy = Lazy::new(|| { }); #[derive(Debug)] -struct EthSenderTester -where - T: DataProvider, -{ +struct EthSenderTester { conn: ConnectionPool, gateway: Arc, manager: MockEthTxManager, - aggregator: EthTxAggregator, + aggregator: EthTxAggregator, gas_adjuster: Arc>>, } -impl EthSenderTester -where - T: DataProvider, -{ +impl EthSenderTester { const WAIT_CONFIRMATIONS: u64 = 10; const MAX_BASE_FEE_SAMPLES: usize = 3; @@ -102,9 +94,8 @@ where .unwrap(), ); let store_factory = ObjectStoreFactory::mock(); - let data_provider = Validium {}; - let aggregator = EthTxAggregator::::new( + let aggregator = EthTxAggregator::new( SenderConfig { proof_sending_mode: ProofSendingMode::SkipEveryProof, ..eth_sender_config.sender.clone() @@ -120,7 +111,6 @@ where contracts_config.l1_multicall3_addr, Address::random(), 0, - data_provider, ); let manager = EthTxManager::new( @@ -880,7 +870,7 @@ async fn get_multicall_data() { assert!(multicall_data.is_ok()); } -async fn insert_genesis_protocol_version(tester: &EthSenderTester) { +async fn insert_genesis_protocol_version(tester: &EthSenderTester) { tester .storage() .await @@ -889,10 +879,7 @@ async fn insert_genesis_protocol_version(tester: &EthSenderTest .await; } -async fn insert_l1_batch( - tester: &EthSenderTester, - number: L1BatchNumber, -) -> L1BatchHeader { +async fn insert_l1_batch(tester: &EthSenderTester, number: L1BatchNumber) -> L1BatchHeader { let header = create_l1_batch(number.0); // Save L1 batch to the database @@ -918,8 +905,8 @@ async fn insert_l1_batch( header } -async fn execute_l1_batches( - tester: &mut EthSenderTester, +async fn execute_l1_batches( + tester: &mut EthSenderTester, l1_batches: Vec, confirm: bool, ) -> H256 { @@ -929,8 +916,8 @@ async fn execute_l1_batches( send_operation(tester, operation, confirm).await } -async fn prove_l1_batch( - tester: &mut EthSenderTester, +async fn prove_l1_batch( + tester: &mut EthSenderTester, last_committed_l1_batch: L1BatchHeader, l1_batch: L1BatchHeader, confirm: bool, @@ -944,8 +931,8 @@ async fn prove_l1_batch( send_operation(tester, operation, confirm).await } -async fn commit_l1_batch( - tester: &mut EthSenderTester, +async fn commit_l1_batch( + tester: &mut EthSenderTester, last_committed_l1_batch: L1BatchHeader, l1_batch: L1BatchHeader, confirm: bool, @@ -957,8 +944,8 @@ async fn commit_l1_batch( send_operation(tester, operation, confirm).await } -async fn send_operation( - tester: &mut EthSenderTester, +async fn send_operation( + tester: &mut EthSenderTester, aggregated_operation: AggregatedOperation, confirm: bool, ) -> H256 { @@ -989,7 +976,7 @@ async fn send_operation( hash } -async fn confirm_tx(tester: &mut EthSenderTester, hash: H256) { +async fn confirm_tx(tester: &mut EthSenderTester, hash: H256) { tester .gateway .execute_tx(hash, true, EthSenderTester::WAIT_CONFIRMATIONS); diff --git a/core/lib/zksync_core/src/lib.rs b/core/lib/zksync_core/src/lib.rs index 469c5eeb208a..8d7a9d630dc0 100644 --- a/core/lib/zksync_core/src/lib.rs +++ b/core/lib/zksync_core/src/lib.rs @@ -52,7 +52,6 @@ use crate::{ web3::{state::InternalApiConfig, ApiServerHandles, Namespace}, }, basic_witness_input_producer::BasicWitnessInputProducer, - eth_sender::data_provider::{DataProvider, Rollup, Validium}, eth_sender::{Aggregator, EthTxAggregator, EthTxManager}, eth_watch::start_eth_watch, house_keeper::{ @@ -551,7 +550,6 @@ pub async fn initialize_components( let eth_client = PKSigningClient::from_config(ð_sender, &contracts_config, ð_client_config); let nonce = eth_client.pending_nonce("eth_sender").await.unwrap(); - let data_provider = Validium {}; let eth_tx_aggregator_actor = EthTxAggregator::new( eth_sender.sender.clone(), Aggregator::new( @@ -563,7 +561,6 @@ pub async fn initialize_components( contracts_config.l1_multicall3_addr, main_zksync_contract_address, nonce.as_u64(), - data_provider, ); task_futures.push(tokio::spawn( eth_tx_aggregator_actor.run(eth_sender_pool, stop_receiver.clone()), diff --git a/etc/env/base/eth_sender.toml b/etc/env/base/eth_sender.toml index bfea2d2479b5..5581bd5e103e 100644 --- a/etc/env/base/eth_sender.toml +++ b/etc/env/base/eth_sender.toml @@ -46,6 +46,8 @@ max_acceptable_priority_fee_in_gwei=100000000000 proof_loading_mode="OldProofFromDb" +pubdata_storage_mode="Validium" + [eth_sender.gas_adjuster] # Priority fee to be used by GasAdjuster (in wei). default_priority_fee_per_gas=1_000_000_000