From 982d6381dbaa0d5e9870268edc8383e91a456a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Onorato?= Date: Fri, 26 Jan 2024 19:04:51 -0300 Subject: [PATCH 1/5] - add basic abstraction for DataProvider for eth_tx_aggregator - Needs to fix errors in tests related to the new Generic Data Type --- core/lib/dal/sqlx-data.json | 3 + .../src/eth_sender/data_provider.rs | 11 + .../src/eth_sender/eth_tx_aggregator.rs | 9 +- core/lib/zksync_core/src/eth_sender/mod.rs | 1 + core/lib/zksync_core/src/eth_sender/tests.rs | 34 +-- core/lib/zksync_core/src/lib.rs | 3 + era-contracts-lambda | 1 + yarn.lock | 233 ++++++++++++++++-- 8 files changed, 262 insertions(+), 33 deletions(-) create mode 100644 core/lib/dal/sqlx-data.json create mode 100644 core/lib/zksync_core/src/eth_sender/data_provider.rs create mode 160000 era-contracts-lambda diff --git a/core/lib/dal/sqlx-data.json b/core/lib/dal/sqlx-data.json new file mode 100644 index 000000000000..95c8c858baaf --- /dev/null +++ b/core/lib/dal/sqlx-data.json @@ -0,0 +1,3 @@ +{ + "db": "PostgreSQL" +} \ No newline at end of file diff --git a/core/lib/zksync_core/src/eth_sender/data_provider.rs b/core/lib/zksync_core/src/eth_sender/data_provider.rs new file mode 100644 index 000000000000..b1abd4ce58d9 --- /dev/null +++ b/core/lib/zksync_core/src/eth_sender/data_provider.rs @@ -0,0 +1,11 @@ +pub trait DataProvider {} + +#[derive(Debug)] +pub struct Rollup {} + +#[derive(Debug)] +pub struct 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 6211b6363849..70cb9f862d39 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,6 +29,8 @@ use crate::{ metrics::BlockL1Stage, }; +use super::data_provider::{DataProvider, Rollup, Validium}; + /// Data queried from L1 using multicall contract. #[derive(Debug)] pub struct MulticallData { @@ -42,7 +44,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 { +pub struct EthTxAggregator where T: DataProvider { aggregator: Aggregator, eth_client: Arc, config: SenderConfig, @@ -51,9 +53,10 @@ pub struct EthTxAggregator { pub(super) main_zksync_contract_address: Address, functions: ZkSyncFunctions, base_nonce: u64, + data_provider: T, } -impl EthTxAggregator { +impl EthTxAggregator where T: DataProvider{ pub fn new( config: SenderConfig, aggregator: Aggregator, @@ -62,6 +65,7 @@ impl EthTxAggregator { l1_multicall3_address: Address, main_zksync_contract_address: Address, base_nonce: u64, + data_provider: T, ) -> Self { let functions = ZkSyncFunctions::default(); Self { @@ -73,6 +77,7 @@ impl EthTxAggregator { main_zksync_contract_address, functions, base_nonce, + data_provider, } } diff --git a/core/lib/zksync_core/src/eth_sender/mod.rs b/core/lib/zksync_core/src/eth_sender/mod.rs index e5a47d3f62f8..d8d46bf8bca8 100644 --- a/core/lib/zksync_core/src/eth_sender/mod.rs +++ b/core/lib/zksync_core/src/eth_sender/mod.rs @@ -5,6 +5,7 @@ mod eth_tx_manager; mod metrics; mod publish_criterion; mod zksync_functions; +pub mod data_provider; #[cfg(test)] mod tests; diff --git a/core/lib/zksync_core/src/eth_sender/tests.rs b/core/lib/zksync_core/src/eth_sender/tests.rs index 73f484a1fd77..4b9f7791f78c 100644 --- a/core/lib/zksync_core/src/eth_sender/tests.rs +++ b/core/lib/zksync_core/src/eth_sender/tests.rs @@ -29,6 +29,8 @@ 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; @@ -43,15 +45,15 @@ static DUMMY_OPERATION: Lazy = Lazy::new(|| { }); #[derive(Debug)] -struct EthSenderTester { +struct EthSenderTester where T: DataProvider { conn: ConnectionPool, gateway: Arc, manager: MockEthTxManager, - aggregator: EthTxAggregator, + aggregator: EthTxAggregator, gas_adjuster: Arc>>, } -impl EthSenderTester { +impl EthSenderTester where T: DataProvider { const WAIT_CONFIRMATIONS: u64 = 10; const MAX_BASE_FEE_SAMPLES: usize = 3; @@ -94,8 +96,9 @@ impl EthSenderTester { .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() @@ -111,6 +114,7 @@ impl EthSenderTester { contracts_config.l1_multicall3_addr, Address::random(), 0, + data_provider, ); let manager = EthTxManager::new( @@ -870,7 +874,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 @@ -879,7 +883,7 @@ async fn insert_genesis_protocol_version(tester: &EthSenderTester) { .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 @@ -905,8 +909,8 @@ async fn insert_l1_batch(tester: &EthSenderTester, number: L1BatchNumber) -> L1B header } -async fn execute_l1_batches( - tester: &mut EthSenderTester, +async fn execute_l1_batches( + tester: &mut EthSenderTester, l1_batches: Vec, confirm: bool, ) -> H256 { @@ -916,8 +920,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, @@ -931,8 +935,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, @@ -944,8 +948,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 { @@ -976,7 +980,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 8d7a9d630dc0..ab9edda7d80a 100644 --- a/core/lib/zksync_core/src/lib.rs +++ b/core/lib/zksync_core/src/lib.rs @@ -72,6 +72,7 @@ use crate::{ state_keeper::{ create_state_keeper, MempoolFetcher, MempoolGuard, MiniblockSealer, SequencerSealer, }, + eth_sender::data_provider::{DataProvider, Rollup, Validium} }; pub mod api_server; @@ -550,6 +551,7 @@ 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( @@ -561,6 +563,7 @@ 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/era-contracts-lambda b/era-contracts-lambda new file mode 160000 index 000000000000..c1ecf8a3c363 --- /dev/null +++ b/era-contracts-lambda @@ -0,0 +1 @@ +Subproject commit c1ecf8a3c3632423feb392e8ad6d0075e5ef42a3 diff --git a/yarn.lock b/yarn.lock index 3a7645da5c66..239b0faf45f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3077,9 +3077,9 @@ form-data "^4.0.0" "@types/node-fetch@^2.6.1": - version "2.6.10" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.10.tgz#ff5c1ceacab782f2b7ce69957d38c1c27b0dc469" - integrity sha512-PPpPK6F9ALFTn59Ka3BaL+qGuipRfxNE8qVgkp0bVixeiR2c2/L+IVOiBdu9JhhT22sWnQEp6YyHGI2b2+CMcA== + version "2.6.11" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.11.tgz#9b39b78665dae0e82a08f02f4967d62c66f95d24" + integrity sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g== dependencies: "@types/node" "*" form-data "^4.0.0" @@ -3789,6 +3789,11 @@ async@^2.4.0: dependencies: lodash "^4.17.14" +async@^3.2.4: + version "3.2.5" + resolved "https://registry.yarnpkg.com/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66" + integrity sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg== + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -4009,6 +4014,11 @@ bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== +boolbase@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== + bplist-parser@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/bplist-parser/-/bplist-parser-0.2.0.tgz#43a9d183e5bf9d545200ceac3e712f79ebbe8d0e" @@ -4259,9 +4269,9 @@ chai-as-promised@^7.1.1: check-error "^1.0.2" chai@^4.3.10: - version "4.4.0" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.4.0.tgz#f9ac79f26726a867ac9d90a9b382120479d5f55b" - integrity sha512-x9cHNq1uvkCdU+5xTkNh5WtgD4e4yDFCsp9jVc7N7qVeKeftv3gO/ZrviX5d+3ZfxdYnZXZYujjRInu1RogU6A== + version "4.4.1" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.4.1.tgz#3603fa6eba35425b0f2ac91a009fe924106e50d1" + integrity sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g== dependencies: assertion-error "^1.1.0" check-error "^1.0.3" @@ -4335,6 +4345,31 @@ check-error@^1.0.2, check-error@^1.0.3: dependencies: get-func-name "^2.0.2" +cheerio-select@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cheerio-select/-/cheerio-select-2.1.0.tgz#4d8673286b8126ca2a8e42740d5e3c4884ae21b4" + integrity sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g== + dependencies: + boolbase "^1.0.0" + css-select "^5.1.0" + css-what "^6.1.0" + domelementtype "^2.3.0" + domhandler "^5.0.3" + domutils "^3.0.1" + +cheerio@^1.0.0-rc.10: + version "1.0.0-rc.12" + resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.12.tgz#788bf7466506b1c6bf5fae51d24a2c4d62e47683" + integrity sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q== + dependencies: + cheerio-select "^2.1.0" + dom-serializer "^2.0.0" + domhandler "^5.0.3" + domutils "^3.0.1" + htmlparser2 "^8.0.1" + parse5 "^7.0.0" + parse5-htmlparser2-tree-adapter "^7.0.0" + chokidar@3.5.3, chokidar@^3.4.0: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" @@ -4548,7 +4583,7 @@ commander@3.0.2: resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== -commander@^10.0.0: +commander@^10.0.0, commander@^10.0.1: version "10.0.1" resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== @@ -4844,7 +4879,7 @@ cspell-trie-lib@8.3.2: "@cspell/cspell-types" "8.3.2" gensequence "^6.0.0" -cspell@*: +cspell@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/cspell/-/cspell-8.3.2.tgz#56e7e919d87d38016b4c34b8c8ee745404c230a7" integrity sha512-V8Ub3RO/a5lwSsltW/ib3Z3G/sczKtSpBBN1JChzbSCfEgaY2mJY8JW0BpkSV+Ug6uJitpXNOOaxa3Xr489i7g== @@ -4868,6 +4903,22 @@ cspell@*: strip-ansi "^7.1.0" vscode-uri "^3.0.8" +css-select@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-5.1.0.tgz#b8ebd6554c3637ccc76688804ad3f6a6fdaea8a6" + integrity sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg== + dependencies: + boolbase "^1.0.0" + css-what "^6.1.0" + domhandler "^5.0.2" + domutils "^3.0.1" + nth-check "^2.0.1" + +css-what@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" + integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -5127,6 +5178,36 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +dom-serializer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53" + integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg== + dependencies: + domelementtype "^2.3.0" + domhandler "^5.0.2" + entities "^4.2.0" + +domelementtype@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" + integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== + +domhandler@^5.0.2, domhandler@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31" + integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w== + dependencies: + domelementtype "^2.3.0" + +domutils@^3.0.1: + version "3.1.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.1.0.tgz#c47f551278d3dc4b0b1ab8cbb42d751a6f0d824e" + integrity sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA== + dependencies: + dom-serializer "^2.0.0" + domelementtype "^2.3.0" + domhandler "^5.0.3" + dot-prop@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-6.0.1.tgz#fc26b3cf142b9e59b74dbd39ed66ce620c681083" @@ -5240,6 +5321,11 @@ enquirer@^2.3.0, enquirer@^2.3.5: ansi-colors "^4.1.1" strip-ansi "^6.0.1" +entities@^4.2.0, entities@^4.4.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + entities@~2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/entities/-/entities-2.0.3.tgz#5c487e5742ab93c15abb5da22759b8590ec03b7f" @@ -6895,6 +6981,23 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== +html-link-extractor@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/html-link-extractor/-/html-link-extractor-1.0.5.tgz#a4be345cb13b8c3352d82b28c8b124bb7bf5dd6f" + integrity sha512-ADd49pudM157uWHwHQPUSX4ssMsvR/yHIswOR5CUfBdK9g9ZYGMhVSE6KZVHJ6kCkR0gH4htsfzU6zECDNVwyw== + dependencies: + cheerio "^1.0.0-rc.10" + +htmlparser2@^8.0.1: + version "8.0.2" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-8.0.2.tgz#f002151705b383e62433b5cf466f5b716edaec21" + integrity sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA== + dependencies: + domelementtype "^2.3.0" + domhandler "^5.0.3" + domutils "^3.0.1" + entities "^4.4.0" + http-basic@^8.1.1: version "8.1.3" resolved "https://registry.yarnpkg.com/http-basic/-/http-basic-8.1.3.tgz#a7cabee7526869b9b710136970805b1004261bbf" @@ -6957,6 +7060,13 @@ iconv-lite@0.4.24, iconv-lite@^0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" +iconv-lite@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + ieee754@^1.1.13, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" @@ -7101,6 +7211,11 @@ io-ts@1.10.4: dependencies: fp-ts "^1.0.0" +is-absolute-url@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-4.0.1.tgz#16e4d487d4fded05cfe0685e53ec86804a5e94dc" + integrity sha512-/51/TKE88Lmm7Gc4/8btclNXWS+g50wXhYJq8HWIBAGUBnoAdRu1aXeh364t/O7wXDAcTJDP8PNuNKWUDWie+A== + is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" @@ -7255,6 +7370,13 @@ is-regex@^1.1.4: call-bind "^1.0.2" has-tostringtag "^1.0.0" +is-relative-url@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-relative-url/-/is-relative-url-4.0.0.tgz#4d8371999ff6033b76e4d9972fb5bf496fddfa97" + integrity sha512-PkzoL1qKAYXNFct5IKdKRH/iBQou/oCC85QhXj6WKtUQBliZ4Yfd3Zk27RHu9KQG8r6zgvAA2AQKC9p+rqTszg== + dependencies: + is-absolute-url "^4.0.1" + is-shared-array-buffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" @@ -7337,6 +7459,13 @@ isarray@~1.0.0: resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== +isemail@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/isemail/-/isemail-3.2.0.tgz#59310a021931a9fb06bbb51e155ce0b3f236832c" + integrity sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg== + dependencies: + punycode "2.x.x" + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -8166,6 +8295,16 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== +link-check@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/link-check/-/link-check-5.2.0.tgz#595a339d305900bed8c1302f4342a29c366bf478" + integrity sha512-xRbhYLaGDw7eRDTibTAcl6fXtmUQ13vkezQiTqshHHdGueQeumgxxmQMIOmJYsh2p8BF08t8thhDQ++EAOOq3w== + dependencies: + is-relative-url "^4.0.0" + isemail "^3.2.0" + ms "^2.1.3" + needle "^3.1.0" + linkify-it@^3.0.1: version "3.0.3" resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" @@ -8382,6 +8521,28 @@ markdown-it@13.0.1: mdurl "^1.0.1" uc.micro "^1.0.5" +markdown-link-check@^3.11.2: + version "3.11.2" + resolved "https://registry.yarnpkg.com/markdown-link-check/-/markdown-link-check-3.11.2.tgz#303a8a03d4a34c42ef3158e0b245bced26b5d904" + integrity sha512-zave+vI4AMeLp0FlUllAwGbNytSKsS3R2Zgtf3ufVT892Z/L6Ro9osZwE9PNA7s0IkJ4onnuHqatpsaCiAShJw== + dependencies: + async "^3.2.4" + chalk "^5.2.0" + commander "^10.0.1" + link-check "^5.2.0" + lodash "^4.17.21" + markdown-link-extractor "^3.1.0" + needle "^3.2.0" + progress "^2.0.3" + +markdown-link-extractor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/markdown-link-extractor/-/markdown-link-extractor-3.1.0.tgz#0d5a703630d791a9e2017449e1a9b294f2d2b676" + integrity sha512-r0NEbP1dsM+IqB62Ru9TXLP/HDaTdBNIeylYXumuBi6Xv4ufjE1/g3TnslYL8VNqNcGAGbMptQFHrrdfoZ/Sug== + dependencies: + html-link-extractor "^1.0.5" + marked "^4.1.0" + markdown-table@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.3.tgz#9fcb69bcfdb8717bfd0398c6ec2d93036ef8de60" @@ -8441,6 +8602,11 @@ markdownlint@~0.27.0: dependencies: markdown-it "13.0.1" +marked@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3" + integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A== + mcl-wasm@^0.7.1: version "0.7.9" resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.9.tgz#c1588ce90042a8700c3b60e40efb339fc07ab87f" @@ -8747,7 +8913,7 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3, ms@^2.1.1: +ms@2.1.3, ms@^2.1.1, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -8806,6 +8972,14 @@ nearley@^2.20.1: railroad-diagrams "^1.0.0" randexp "0.4.6" +needle@^3.1.0, needle@^3.2.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/needle/-/needle-3.3.1.tgz#63f75aec580c2e77e209f3f324e2cdf3d29bd049" + integrity sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q== + dependencies: + iconv-lite "^0.6.3" + sax "^1.2.4" + neo-async@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" @@ -8916,6 +9090,13 @@ npm-run-path@^5.1.0: dependencies: path-key "^4.0.0" +nth-check@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" + integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== + dependencies: + boolbase "^1.0.0" + number-to-bn@1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" @@ -9172,6 +9353,21 @@ parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" +parse5-htmlparser2-tree-adapter@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz#23c2cc233bcf09bb7beba8b8a69d46b08c62c2f1" + integrity sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g== + dependencies: + domhandler "^5.0.2" + parse5 "^7.0.0" + +parse5@^7.0.0: + version "7.1.2" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" + integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== + dependencies: + entities "^4.4.0" + path-browserify@^1.0.0, path-browserify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" @@ -9507,7 +9703,7 @@ process@^0.11.1: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== -progress@^2.0.0: +progress@^2.0.0, progress@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== @@ -9593,6 +9789,11 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" +punycode@2.x.x, punycode@^2.1.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== + punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -9603,11 +9804,6 @@ punycode@^2.1.0: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== -punycode@^2.1.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" - integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== - pure-rand@^6.0.0: version "6.0.4" resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.4.tgz#50b737f6a925468679bff00ad20eade53f37d5c7" @@ -10017,11 +10213,16 @@ safe-regex-test@^1.0.0: get-intrinsic "^1.1.3" is-regex "^1.1.4" -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +sax@^1.2.4: + version "1.3.0" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.3.0.tgz#a5dbe77db3be05c9d1ee7785dbd3ea9de51593d0" + integrity sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA== + sc-istanbul@^0.4.5: version "0.4.6" resolved "https://registry.yarnpkg.com/sc-istanbul/-/sc-istanbul-0.4.6.tgz#cf6784355ff2076f92d70d59047d71c13703e839" From d9548c8f1d123cb4db5937be236fe14a636447e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Onorato?= Date: Fri, 26 Jan 2024 19:07:51 -0300 Subject: [PATCH 2/5] run zk fmt --- .../src/eth_sender/eth_tx_aggregator.rs | 10 ++++++++-- core/lib/zksync_core/src/eth_sender/mod.rs | 2 +- core/lib/zksync_core/src/eth_sender/tests.rs | 17 +++++++++++++---- core/lib/zksync_core/src/lib.rs | 4 ++-- 4 files changed, 24 insertions(+), 9 deletions(-) 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 70cb9f862d39..5afd1f1e46e4 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 @@ -44,7 +44,10 @@ 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 +where + T: DataProvider, +{ aggregator: Aggregator, eth_client: Arc, config: SenderConfig, @@ -56,7 +59,10 @@ pub struct EthTxAggregator where T: DataProvider { data_provider: T, } -impl EthTxAggregator where T: DataProvider{ +impl EthTxAggregator +where + T: DataProvider, +{ pub fn new( config: SenderConfig, aggregator: Aggregator, diff --git a/core/lib/zksync_core/src/eth_sender/mod.rs b/core/lib/zksync_core/src/eth_sender/mod.rs index d8d46bf8bca8..9a8f237e0a5b 100644 --- a/core/lib/zksync_core/src/eth_sender/mod.rs +++ b/core/lib/zksync_core/src/eth_sender/mod.rs @@ -1,11 +1,11 @@ mod aggregator; +pub mod data_provider; mod error; mod eth_tx_aggregator; mod eth_tx_manager; mod metrics; mod publish_criterion; mod zksync_functions; -pub mod data_provider; #[cfg(test)] mod tests; diff --git a/core/lib/zksync_core/src/eth_sender/tests.rs b/core/lib/zksync_core/src/eth_sender/tests.rs index 4b9f7791f78c..71f5609af531 100644 --- a/core/lib/zksync_core/src/eth_sender/tests.rs +++ b/core/lib/zksync_core/src/eth_sender/tests.rs @@ -45,7 +45,10 @@ static DUMMY_OPERATION: Lazy = Lazy::new(|| { }); #[derive(Debug)] -struct EthSenderTester where T: DataProvider { +struct EthSenderTester +where + T: DataProvider, +{ conn: ConnectionPool, gateway: Arc, manager: MockEthTxManager, @@ -53,7 +56,10 @@ struct EthSenderTester where T: DataProvider { gas_adjuster: Arc>>, } -impl EthSenderTester where T: DataProvider { +impl EthSenderTester +where + T: DataProvider, +{ const WAIT_CONFIRMATIONS: u64 = 10; const MAX_BASE_FEE_SAMPLES: usize = 3; @@ -96,7 +102,7 @@ impl EthSenderTester where T: DataProvider { .unwrap(), ); let store_factory = ObjectStoreFactory::mock(); - let data_provider = Validium{}; + let data_provider = Validium {}; let aggregator = EthTxAggregator::::new( SenderConfig { @@ -883,7 +889,10 @@ 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 diff --git a/core/lib/zksync_core/src/lib.rs b/core/lib/zksync_core/src/lib.rs index ab9edda7d80a..469c5eeb208a 100644 --- a/core/lib/zksync_core/src/lib.rs +++ b/core/lib/zksync_core/src/lib.rs @@ -52,6 +52,7 @@ 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::{ @@ -72,7 +73,6 @@ use crate::{ state_keeper::{ create_state_keeper, MempoolFetcher, MempoolGuard, MiniblockSealer, SequencerSealer, }, - eth_sender::data_provider::{DataProvider, Rollup, Validium} }; pub mod api_server; @@ -551,7 +551,7 @@ 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 data_provider = Validium {}; let eth_tx_aggregator_actor = EthTxAggregator::new( eth_sender.sender.clone(), Aggregator::new( From c8b69b8d77e763c8137e3e5c9ce3976c632e9239 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Mon, 29 Jan 2024 15:53:18 -0300 Subject: [PATCH 3/5] Add PubdataStorageMode enum --- core/bin/external_node/src/main.rs | 5 ++- core/lib/config/src/configs/eth_sender.rs | 9 ++++ core/lib/env_config/src/eth_sender.rs | 6 ++- core/lib/types/src/aggregated_operations.rs | 5 ++- core/lib/types/src/commitment.rs | 31 ++++++++----- .../src/consistency_checker/mod.rs | 15 +++++-- .../src/consistency_checker/tests/mod.rs | 26 +++++++---- .../zksync_core/src/eth_sender/aggregator.rs | 15 ++++++- .../src/eth_sender/data_provider.rs | 19 +++++--- .../src/eth_sender/eth_tx_aggregator.rs | 17 ++------ .../src/eth_sender/publish_criterion.rs | 12 ++++-- core/lib/zksync_core/src/eth_sender/tests.rs | 43 +++++++------------ core/lib/zksync_core/src/lib.rs | 3 -- etc/env/base/eth_sender.toml | 2 + 14 files changed, 124 insertions(+), 84 deletions(-) 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 From 7e64af24434a7c9de503c3c14cf85f075e63b14b Mon Sep 17 00:00:00 2001 From: ilitteri Date: Mon, 29 Jan 2024 21:50:19 -0300 Subject: [PATCH 4/5] Remove era-lambda-contracts submodule --- era-contracts-lambda | 1 - 1 file changed, 1 deletion(-) delete mode 160000 era-contracts-lambda diff --git a/era-contracts-lambda b/era-contracts-lambda deleted file mode 160000 index c1ecf8a3c363..000000000000 --- a/era-contracts-lambda +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c1ecf8a3c3632423feb392e8ad6d0075e5ef42a3 From 56d098ad2fe3ff3e7b658de7f29f02cbb6a245fc Mon Sep 17 00:00:00 2001 From: ilitteri Date: Mon, 29 Jan 2024 21:50:53 -0300 Subject: [PATCH 5/5] Fix ETHSenderConfig test --- core/lib/env_config/src/eth_sender.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/core/lib/env_config/src/eth_sender.rs b/core/lib/env_config/src/eth_sender.rs index f8c21e0f22d6..61c3d0482d77 100644 --- a/core/lib/env_config/src/eth_sender.rs +++ b/core/lib/env_config/src/eth_sender.rs @@ -102,6 +102,7 @@ mod tests { ETH_SENDER_SENDER_L1_BATCH_MIN_AGE_BEFORE_EXECUTE_SECONDS="1000" ETH_SENDER_SENDER_MAX_ACCEPTABLE_PRIORITY_FEE_IN_GWEI="100000000000" ETH_SENDER_SENDER_PROOF_LOADING_MODE="OldProofFromDb" + ETH_SENDER_SENDER_PUBDATA_STORAGE_MODE="Rollup" "#; lock.set_env(config);