From 2442c4a503bfbcabf3eaae313b92b25611fb0f6c Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Wed, 20 Mar 2024 16:15:10 -0500 Subject: [PATCH] fix: l2 gas price was decreased (#271) --- Cargo.lock | 61 +++++++++++++++++---------------- Cargo.toml | 16 ++++----- SUPPORTED_APIS.md | 4 +-- e2e-tests/test/zks-apis.test.ts | 7 ++-- src/http_fork_source.rs | 2 +- src/node/debug.rs | 5 +-- src/node/eth.rs | 2 +- src/node/fee_model.rs | 2 +- src/node/in_memory.rs | 6 ++-- src/node/in_memory_ext.rs | 6 ++-- src/node/zks.rs | 10 +++--- src/testing.rs | 15 ++++---- src/utils.rs | 2 +- 13 files changed, 68 insertions(+), 70 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0605f758..26fa7da3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4573,7 +4573,7 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "multivm" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "anyhow", "circuit_sequencer_api 0.1.0", @@ -5625,7 +5625,7 @@ dependencies = [ [[package]] name = "prometheus_exporter" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "anyhow", "metrics", @@ -8353,7 +8353,7 @@ dependencies = [ [[package]] name = "vlog" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "chrono", "sentry", @@ -8365,7 +8365,7 @@ dependencies = [ [[package]] name = "vm_utils" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "anyhow", "multivm", @@ -9065,7 +9065,7 @@ dependencies = [ [[package]] name = "zksync_basic_types" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "serde", "serde_json", @@ -9075,7 +9075,7 @@ dependencies = [ [[package]] name = "zksync_circuit_breaker" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "anyhow", "async-trait", @@ -9095,7 +9095,7 @@ dependencies = [ [[package]] name = "zksync_commitment_utils" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "circuit_sequencer_api 0.1.40", "circuit_sequencer_api 0.1.41", @@ -9127,7 +9127,7 @@ dependencies = [ [[package]] name = "zksync_config" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "anyhow", "rand 0.8.5", @@ -9284,7 +9284,7 @@ dependencies = [ [[package]] name = "zksync_contracts" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "envy", "ethabi 18.0.0", @@ -9298,7 +9298,7 @@ dependencies = [ [[package]] name = "zksync_core" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "actix-cors", "actix-rt", @@ -9372,7 +9372,7 @@ dependencies = [ [[package]] name = "zksync_crypto" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", "hex", @@ -9386,7 +9386,7 @@ dependencies = [ [[package]] name = "zksync_dal" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "anyhow", "bigdecimal 0.3.1", @@ -9420,7 +9420,7 @@ dependencies = [ [[package]] name = "zksync_env_config" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "anyhow", "envy", @@ -9432,7 +9432,7 @@ dependencies = [ [[package]] name = "zksync_eth_client" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "async-trait", "jsonrpc-core 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -9450,7 +9450,7 @@ dependencies = [ [[package]] name = "zksync_eth_signer" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "async-trait", "hex", @@ -9468,7 +9468,7 @@ dependencies = [ [[package]] name = "zksync_health_check" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "async-trait", "futures 0.3.30", @@ -9482,7 +9482,7 @@ dependencies = [ [[package]] name = "zksync_l1_contract_interface" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "circuit_sequencer_api 0.1.0", "codegen", @@ -9498,7 +9498,7 @@ dependencies = [ [[package]] name = "zksync_mempool" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "tracing", "zksync_types", @@ -9507,7 +9507,7 @@ dependencies = [ [[package]] name = "zksync_merkle_tree" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "leb128", "once_cell", @@ -9525,7 +9525,7 @@ dependencies = [ [[package]] name = "zksync_mini_merkle_tree" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "once_cell", "zksync_basic_types", @@ -9535,7 +9535,7 @@ dependencies = [ [[package]] name = "zksync_object_store" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "anyhow", "async-trait", @@ -9591,7 +9591,7 @@ dependencies = [ [[package]] name = "zksync_protobuf_config" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "anyhow", "pretty_assertions", @@ -9609,7 +9609,7 @@ dependencies = [ [[package]] name = "zksync_prover_interface" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "chrono", "circuit_sequencer_api 0.1.42", @@ -9623,7 +9623,7 @@ dependencies = [ [[package]] name = "zksync_queued_job_processor" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "anyhow", "async-trait", @@ -9636,7 +9636,7 @@ dependencies = [ [[package]] name = "zksync_state" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "anyhow", "itertools 0.10.5", @@ -9653,7 +9653,7 @@ dependencies = [ [[package]] name = "zksync_storage" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "num_cpus", "once_cell", @@ -9665,7 +9665,7 @@ dependencies = [ [[package]] name = "zksync_system_constants" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "once_cell", "zksync_basic_types", @@ -9675,12 +9675,13 @@ dependencies = [ [[package]] name = "zksync_types" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "anyhow", "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", "chrono", "hex", + "itertools 0.10.5", "num", "num_enum 0.6.1", "once_cell", @@ -9705,7 +9706,7 @@ dependencies = [ [[package]] name = "zksync_utils" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "anyhow", "bigdecimal 0.3.1", @@ -9727,7 +9728,7 @@ dependencies = [ [[package]] name = "zksync_web3_decl" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=cd748e9593949222fe6516fc18c987b6cdf39882#cd748e9593949222fe6516fc18c987b6cdf39882" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=90dee732295d8eaf48a5308c39238a0f5838cc35#90dee732295d8eaf48a5308c39238a0f5838cc35" dependencies = [ "anyhow", "jsonrpsee", diff --git a/Cargo.toml b/Cargo.toml index 1295edc8..84f31fee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,14 +11,14 @@ categories = ["cryptography"] publish = false # We don't want to publish our binaries. [dependencies] -zksync_basic_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "cd748e9593949222fe6516fc18c987b6cdf39882" } -zksync_core = { git = "https://github.com/matter-labs/zksync-era.git", rev = "cd748e9593949222fe6516fc18c987b6cdf39882" } -multivm = { git = "https://github.com/matter-labs/zksync-era.git", rev = "cd748e9593949222fe6516fc18c987b6cdf39882" } -zksync_contracts = { git = "https://github.com/matter-labs/zksync-era.git", rev = "cd748e9593949222fe6516fc18c987b6cdf39882" } -zksync_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "cd748e9593949222fe6516fc18c987b6cdf39882" } -zksync_utils = { git = "https://github.com/matter-labs/zksync-era.git", rev = "cd748e9593949222fe6516fc18c987b6cdf39882" } -zksync_state = { git = "https://github.com/matter-labs/zksync-era.git", rev = "cd748e9593949222fe6516fc18c987b6cdf39882" } -zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", rev = "cd748e9593949222fe6516fc18c987b6cdf39882" } +zksync_basic_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "90dee732295d8eaf48a5308c39238a0f5838cc35" } +zksync_core = { git = "https://github.com/matter-labs/zksync-era.git", rev = "90dee732295d8eaf48a5308c39238a0f5838cc35" } +multivm = { git = "https://github.com/matter-labs/zksync-era.git", rev = "90dee732295d8eaf48a5308c39238a0f5838cc35" } +zksync_contracts = { git = "https://github.com/matter-labs/zksync-era.git", rev = "90dee732295d8eaf48a5308c39238a0f5838cc35" } +zksync_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "90dee732295d8eaf48a5308c39238a0f5838cc35" } +zksync_utils = { git = "https://github.com/matter-labs/zksync-era.git", rev = "90dee732295d8eaf48a5308c39238a0f5838cc35" } +zksync_state = { git = "https://github.com/matter-labs/zksync-era.git", rev = "90dee732295d8eaf48a5308c39238a0f5838cc35" } +zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", rev = "90dee732295d8eaf48a5308c39238a0f5838cc35" } sha3 = "0.10.6" diff --git a/SUPPORTED_APIS.md b/SUPPORTED_APIS.md index daff9004..15db090c 100644 --- a/SUPPORTED_APIS.md +++ b/SUPPORTED_APIS.md @@ -33,8 +33,8 @@ The `status` options are: | [`ETH`](#eth-namespace) | [`eth_chainId`](#eth_chainid) | `SUPPORTED` | Returns the currently configured chain id
_(default is `260`)_ | | `ETH` | `eth_coinbase` | `NOT IMPLEMENTED` | Returns the client coinbase address | | [`ETH`](#eth-namespace) | [`eth_estimateGas`](#eth_estimategas) | `SUPPORTED` | Generates and returns an estimate of how much gas is necessary for the transaction to complete | -| [`ETH`](#eth-namespace) | [`eth_feeHistory`](#eth_feehistory) | `SUPPORTED` | Returns a collection of historical block gas data
_(hardcoded with gas price of `250_000_000`)_ | -| [`ETH`](#eth-namespace) | [`eth_gasPrice`](#eth_gasprice) | `SUPPORTED` | Returns the current price per gas in wei
_(hardcoded to `250_000_000`)_ | +| [`ETH`](#eth-namespace) | [`eth_feeHistory`](#eth_feehistory) | `SUPPORTED` | Returns a collection of historical block gas data
_(hardcoded with gas price of `50_000_000`)_ | +| [`ETH`](#eth-namespace) | [`eth_gasPrice`](#eth_gasprice) | `SUPPORTED` | Returns the current price per gas in wei
_(hardcoded to `50_000_000`)_ | | [`ETH`](#eth-namespace) | [`eth_getBalance`](#eth_getbalance) | `SUPPORTED` | Returns the balance of the account of given address | | [`ETH`](#eth-namespace) | [`eth_getBlockByHash`](#eth_getblockbyhash) | `SUPPORTED` | Returns information about a block by block hash | | [`ETH`](#eth-namespace) | [`eth_getBlockByNumber`](#eth_getblockbynumber) | `SUPPORTED` | Returns information about a block by block number | diff --git a/e2e-tests/test/zks-apis.test.ts b/e2e-tests/test/zks-apis.test.ts index 80984965..f7498315 100644 --- a/e2e-tests/test/zks-apis.test.ts +++ b/e2e-tests/test/zks-apis.test.ts @@ -29,15 +29,14 @@ 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("1447745"), "Unexpected gas_limit"); + expect(ethers.BigNumber.from(response.gas_limit)).to.eql(ethers.BigNumber.from("2407036"), "Unexpected gas_limit"); expect(ethers.BigNumber.from(response.gas_per_pubdata_limit)).to.eql( - ethers.BigNumber.from("18750"), + ethers.BigNumber.from("32000"), "Unexpected gas_per_pubdata_limit" ); expect(ethers.BigNumber.from(response.max_fee_per_gas)).to.eql( - ethers.BigNumber.from("100000000"), + ethers.BigNumber.from("58593750"), "Unexpected max_fee_per_gas" ); expect(ethers.BigNumber.from(response.max_priority_fee_per_gas)).to.eql( diff --git a/src/http_fork_source.rs b/src/http_fork_source.rs index 4cbb3439..a729ac49 100644 --- a/src/http_fork_source.rs +++ b/src/http_fork_source.rs @@ -657,7 +657,7 @@ mod tests { "executeTxHash": null, "executedAt": null, "l1GasPrice": 6156252068u64, - "l2FairGasPrice": 250000000u64, + "l2FairGasPrice": 50000000u64, "baseSystemContractsHashes": { "bootloader": "0x0100089b8a2f2e6a20ba28f02c9e0ed0c13d702932364561a0ea61621f65f0a8", "default_aa": "0x0100067d16a5485875b4249040bf421f53e869337fe118ec747cf40a4c777e5f" diff --git a/src/node/debug.rs b/src/node/debug.rs index 83c3f80a..278d35af 100644 --- a/src/node/debug.rs +++ b/src/node/debug.rs @@ -165,7 +165,6 @@ impl DebugNames return Err(into_jsrpc_error(error)); } }; - let execution_mode = multivm::interface::TxExecutionMode::EthCall; let storage = StorageView::new(&inner.fork_storage).into_rc_ptr(); @@ -195,8 +194,8 @@ impl DebugNames let call_tracer_result = Arc::new(OnceCell::default()); let tracer = CallTracer::new(call_tracer_result.clone()).into_tracer_pointer(); - let tx_result = vm.inspect(tracer.into(), multivm::interface::VmExecutionMode::OneTx); + let tx_result = vm.inspect(tracer.into(), multivm::interface::VmExecutionMode::OneTx); let call_traces = if only_top { vec![] } else { @@ -295,7 +294,6 @@ mod tests { let node = InMemoryNode::::default(); let (primary_deployed_address, secondary_deployed_address) = deploy_test_contracts(&node); - // trace a call to the primary contract let func = HumanReadableParser::parse_function("calculate(uint)").unwrap(); let calldata = func.encode_input(&[Token::Uint(U256::from(42))]).unwrap(); @@ -396,7 +394,6 @@ mod tests { // call should revert assert!(trace.revert_reason.is_some()); - // find the call to primary contract in the trace let contract_call = trace .calls diff --git a/src/node/eth.rs b/src/node/eth.rs index 27c5553b..3152b888 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!(3, result.len()), + FilterChanges::Logs(result) => assert_eq!(2, result.len()), changes => panic!("unexpected filter changes: {:?}", changes), } diff --git a/src/node/fee_model.rs b/src/node/fee_model.rs index f8a28aa4..c2790f57 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: 100000000, + minimal_l2_gas_price: 50_000_000, compute_overhead_part: 0.0, pubdata_overhead_part: 1.0, batch_overhead_l1_gas: 800000, diff --git a/src/node/in_memory.rs b/src/node/in_memory.rs index 20362c51..fb0bbfed 100644 --- a/src/node/in_memory.rs +++ b/src/node/in_memory.rs @@ -83,8 +83,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.1 gwei). -pub const L2_GAS_PRICE: u64 = 100_000_000; +/// L2 Gas Price (0.05 gwei). +pub const L2_GAS_PRICE: u64 = 50_000_000; /// L1 Gas Price Scale Factor for gas estimation. pub const ESTIMATE_GAS_PRICE_SCALE_FACTOR: f64 = 1.5; /// The max possible number of gas that `eth_estimateGas` is allowed to overestimate. @@ -1894,7 +1894,7 @@ mod tests { gas_limit: U256::from(815563), 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(20000), + gas_per_pubdata_limit: U256::from(25000), }, U256::from(0), zksync_basic_types::L2ChainId::from(260), diff --git a/src/node/in_memory_ext.rs b/src/node/in_memory_ext.rs index 279b58cd..2f0d2182 100644 --- a/src/node/in_memory_ext.rs +++ b/src/node/in_memory_ext.rs @@ -448,9 +448,9 @@ mod tests { Nonce(0), Fee { gas_limit: U256::from(1_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(20000), + 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), }, to_impersonate, U256::one(), diff --git a/src/node/zks.rs b/src/node/zks.rs index fd4ca598..5dd990e7 100644 --- a/src/node/zks.rs +++ b/src/node/zks.rs @@ -588,10 +588,10 @@ mod tests { let result = node.estimate_fee(mock_request).await.unwrap(); - assert_eq!(result.gas_limit, U256::from(1784965)); - assert_eq!(result.max_fee_per_gas, U256::from(100000000)); + assert_eq!(result.gas_limit, U256::from(2950553)); + assert_eq!(result.max_fee_per_gas, U256::from(58593750)); assert_eq!(result.max_priority_fee_per_gas, U256::from(0)); - assert_eq!(result.gas_per_pubdata_limit, U256::from(18750)); + assert_eq!(result.gas_per_pubdata_limit, U256::from(32000)); } #[tokio::test] @@ -778,7 +778,7 @@ mod tests { "executeTxHash": null, "executedAt": null, "l1GasPrice": 6156252068u64, - "l2FairGasPrice": 250000000u64, + "l2FairGasPrice": 50000000u64, "baseSystemContractsHashes": { "bootloader": "0x0100089b8a2f2e6a20ba28f02c9e0ed0c13d702932364561a0ea61621f65f0a8", "default_aa": "0x0100067d16a5485875b4249040bf421f53e869337fe118ec747cf40a4c777e5f" @@ -1110,7 +1110,7 @@ mod tests { "l1BatchNumber": 0, "l1GasPrice": 0, "l1TxCount": 1, - "l2FairGasPrice": 250000000, + "l2FairGasPrice": 50000000, "l2TxCount": 0, "number": 0, "operatorAddress": "0x0000000000000000000000000000000000000000", diff --git a/src/testing.rs b/src/testing.rs index bd150752..0c447a35 100644 --- a/src/testing.rs +++ b/src/testing.rs @@ -373,9 +373,9 @@ impl Default for TransactionBuilder { Self { tx_hash: H256::repeat_byte(0x01), from_account_private_key: H256::random(), - gas_limit: U256::from(1_000_000), - max_fee_per_gas: U256::from(250_000_000), - max_priority_fee_per_gas: U256::from(250_000_000), + gas_limit: U256::from(2_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(20000), + gas_per_pubdata_limit: U256::from(25000), }, U256::from(1), L2ChainId::from(260), @@ -441,6 +441,7 @@ pub fn apply_tx( let produced_block_hash = compute_hash(next_miniblock, tx_hash); let tx = TransactionBuilder::new().set_hash(tx_hash).build(); + node.set_rich_account(tx.common_data.initiator_address); node.apply_txs(vec![tx]).expect("failed applying tx"); @@ -511,9 +512,9 @@ pub fn deploy_contract( data.to_vec(), nonce, Fee { - gas_limit: U256::from(82511299), - max_fee_per_gas: U256::from(250_000_000), - max_priority_fee_per_gas: U256::from(250_000_000), + gas_limit: U256::from(92511299), + 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), }, U256::from(0), diff --git a/src/utils.rs b/src/utils.rs index ad275bf9..49724f25 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -291,7 +291,7 @@ mod tests { assert_eq!("12_345", to_human_size(U256::from(12345u64))); assert_eq!("0", to_human_size(U256::from(0))); assert_eq!("1", to_human_size(U256::from(1))); - assert_eq!("250_000_000", to_human_size(U256::from(250000000u64))); + assert_eq!("50_000_000", to_human_size(U256::from(50000000u64))); } #[test]