From 939eedad1327b94c1a82a97611a65436c2453f94 Mon Sep 17 00:00:00 2001 From: Vaclav Barta Date: Mon, 20 May 2024 09:31:13 +0200 Subject: [PATCH 1/8] changed L2_GAS_PRICE --- src/node/in_memory.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/in_memory.rs b/src/node/in_memory.rs index 2d6ab60f..2b472643 100644 --- a/src/node/in_memory.rs +++ b/src/node/in_memory.rs @@ -79,8 +79,8 @@ pub const TEST_NODE_NETWORK_ID: u32 = 260; /// L1 Gas Price. pub const L1_GAS_PRICE: u64 = 50_000_000_000; // TODO: for now, that's fine, as computation overhead is set to zero, but we may consider using calculated fee input everywhere. -/// L2 Gas Price (0.05 gwei). -pub const L2_GAS_PRICE: u64 = 50_000_000; +/// L2 Gas Price. +pub const L2_GAS_PRICE: u64 = 25_000_000; /// L1 Gas Price Scale Factor for gas estimation. pub const ESTIMATE_GAS_PRICE_SCALE_FACTOR: f64 = 1.5; /// Acceptable gas overestimation limit. From cdffc277ae366f88e8b8624ac28f8804757620b3 Mon Sep 17 00:00:00 2001 From: Vaclav Barta Date: Mon, 20 May 2024 09:38:45 +0200 Subject: [PATCH 2/8] changed FeeModelConfigV2.minimal_l2_gas_price --- src/node/fee_model.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/fee_model.rs b/src/node/fee_model.rs index a39ff0b0..dedbeb81 100644 --- a/src/node/fee_model.rs +++ b/src/node/fee_model.rs @@ -4,7 +4,7 @@ use zksync_types::fee_model::{FeeModelConfigV2, FeeParams, FeeParamsV2}; use zksync_types::L1_GAS_PER_PUBDATA_BYTE; pub const CONFIG: FeeModelConfigV2 = FeeModelConfigV2 { - minimal_l2_gas_price: 50_000_000, + minimal_l2_gas_price: 20_000_000, compute_overhead_part: 0.0, pubdata_overhead_part: 1.0, batch_overhead_l1_gas: 800000, From db97a4b09ef8088c5193af9df748eacd9b9ee719 Mon Sep 17 00:00:00 2001 From: Vaclav Barta Date: Mon, 20 May 2024 09:52:34 +0200 Subject: [PATCH 3/8] changed default test transaction gas limits --- src/testing.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/testing.rs b/src/testing.rs index d67ee0db..a5406b70 100644 --- a/src/testing.rs +++ b/src/testing.rs @@ -373,7 +373,7 @@ impl Default for TransactionBuilder { Self { tx_hash: H256::repeat_byte(0x01), from_account_private_key: K256PrivateKey::from_bytes(H256::random()).unwrap(), - gas_limit: U256::from(2_000_000), + gas_limit: U256::from(4_000_000), max_fee_per_gas: U256::from(50_000_000), max_priority_fee_per_gas: U256::from(50_000_000), } @@ -414,7 +414,7 @@ impl TransactionBuilder { gas_limit: self.gas_limit, max_fee_per_gas: self.max_fee_per_gas, max_priority_fee_per_gas: self.max_priority_fee_per_gas, - gas_per_pubdata_limit: U256::from(25000), + gas_per_pubdata_limit: U256::from(50000), }, U256::from(1), L2ChainId::from(260), From 096f047a5e2ebe96d9879482d87901ae5ca2ffb5 Mon Sep 17 00:00:00 2001 From: Vaclav Barta Date: Mon, 20 May 2024 15:41:40 +0200 Subject: [PATCH 4/8] changed default test contract deployment gas limit --- src/testing.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testing.rs b/src/testing.rs index a5406b70..9572f722 100644 --- a/src/testing.rs +++ b/src/testing.rs @@ -512,7 +512,7 @@ pub fn deploy_contract( data.to_vec(), nonce, Fee { - gas_limit: U256::from(92511299), + gas_limit: U256::from(400_000_000), max_fee_per_gas: U256::from(50_000_000), max_priority_fee_per_gas: U256::from(50_000_000), gas_per_pubdata_limit: U256::from(50000), From 4946b3ca4f2cdfd049951c49d50757c20adabdef Mon Sep 17 00:00:00 2001 From: Vaclav Barta Date: Mon, 20 May 2024 16:28:35 +0200 Subject: [PATCH 5/8] changed transaction gas limits for test_transact_returns_data_in_built_in_without_security_mode --- src/node/in_memory.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/in_memory.rs b/src/node/in_memory.rs index 2b472643..5e558dd1 100644 --- a/src/node/in_memory.rs +++ b/src/node/in_memory.rs @@ -1897,10 +1897,10 @@ mod tests { hex::decode("bbf55335").unwrap(), // keccak selector for "transact_retrieve1()" Nonce(1), Fee { - gas_limit: U256::from(815563), + gas_limit: U256::from(4_000_000), max_fee_per_gas: U256::from(250_000_000), max_priority_fee_per_gas: U256::from(250_000_000), - gas_per_pubdata_limit: U256::from(25000), + gas_per_pubdata_limit: U256::from(50000), }, U256::from(0), zksync_basic_types::L2ChainId::from(260), From 618795c2c80a6176ac0644fdb8534722ae74fb9b Mon Sep 17 00:00:00 2001 From: Vaclav Barta Date: Mon, 20 May 2024 16:29:35 +0200 Subject: [PATCH 6/8] changed transaction gas limits for test_impersonate_account --- src/node/in_memory_ext.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/in_memory_ext.rs b/src/node/in_memory_ext.rs index 2f0d2182..77c25e62 100644 --- a/src/node/in_memory_ext.rs +++ b/src/node/in_memory_ext.rs @@ -447,10 +447,10 @@ mod tests { vec![], Nonce(0), Fee { - gas_limit: U256::from(1_000_000), + gas_limit: U256::from(100_000_000), max_fee_per_gas: U256::from(50_000_000), max_priority_fee_per_gas: U256::from(50_000_000), - gas_per_pubdata_limit: U256::from(25000), + gas_per_pubdata_limit: U256::from(50000), }, to_impersonate, U256::one(), From 89a6640d675cec8dc73d4af45656c225076fa055 Mon Sep 17 00:00:00 2001 From: Vaclav Barta Date: Mon, 20 May 2024 16:31:18 +0200 Subject: [PATCH 7/8] changed expected log count of get_filter_changes --- src/node/eth.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/eth.rs b/src/node/eth.rs index 5c093408..1d2d329b 100644 --- a/src/node/eth.rs +++ b/src/node/eth.rs @@ -2226,7 +2226,7 @@ mod tests { .await .expect("failed getting filter changes") { - FilterChanges::Logs(result) => assert_eq!(2, result.len()), + FilterChanges::Logs(result) => assert_eq!(3, result.len()), changes => panic!("unexpected filter changes: {:?}", changes), } From 6646b87f0ef2dae26dc93179ab1824c265ac9478 Mon Sep 17 00:00:00 2001 From: Vaclav Barta Date: Mon, 20 May 2024 16:32:26 +0200 Subject: [PATCH 8/8] changed expected fees --- e2e-tests/test/zks-apis.test.ts | 6 +++--- src/node/zks.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/e2e-tests/test/zks-apis.test.ts b/e2e-tests/test/zks-apis.test.ts index 1028573d..df7e7f6a 100644 --- a/e2e-tests/test/zks-apis.test.ts +++ b/e2e-tests/test/zks-apis.test.ts @@ -30,13 +30,13 @@ describe("zks_estimateFee", function () { // Act const response: Fee = await provider.send("zks_estimateFee", [transaction]); // Assert - expect(ethers.BigNumber.from(response.gas_limit)).to.eql(ethers.BigNumber.from("5448356"), "Unexpected gas_limit"); + expect(ethers.BigNumber.from(response.gas_limit)).to.eql(ethers.BigNumber.from("7203486"), "Unexpected gas_limit"); expect(ethers.BigNumber.from(response.gas_per_pubdata_limit)).to.eql( - ethers.BigNumber.from("37500"), + ethers.BigNumber.from("50000"), "Unexpected gas_per_pubdata_limit" ); expect(ethers.BigNumber.from(response.max_fee_per_gas)).to.eql( - ethers.BigNumber.from("50000000"), + ethers.BigNumber.from("37500000"), "Unexpected max_fee_per_gas" ); expect(ethers.BigNumber.from(response.max_priority_fee_per_gas)).to.eql( diff --git a/src/node/zks.rs b/src/node/zks.rs index 2bdf243a..eb4486b0 100644 --- a/src/node/zks.rs +++ b/src/node/zks.rs @@ -590,10 +590,10 @@ mod tests { let result = node.estimate_fee(mock_request).await.unwrap(); - assert_eq!(result.gas_limit, U256::from(6793236)); - assert_eq!(result.max_fee_per_gas, U256::from(50000000)); + assert_eq!(result.gas_limit, U256::from(8970736)); + assert_eq!(result.max_fee_per_gas, U256::from(37500000)); assert_eq!(result.max_priority_fee_per_gas, U256::from(0)); - assert_eq!(result.gas_per_pubdata_limit, U256::from(37500)); + assert_eq!(result.gas_per_pubdata_limit, U256::from(50000)); } #[tokio::test]