From 286ec47c33694dfbd56bd95fb8b6f9ac0fa1b67c Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Fri, 13 Oct 2023 04:02:28 +0200 Subject: [PATCH 01/24] Use nightly rust in the CI --- .github/workflows/checks.yaml | 2 +- .github/workflows/docs.yaml | 2 +- .github/workflows/release.yml | 10 +++++----- .github/workflows/tests.yaml | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 5100a085..52019a67 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -47,7 +47,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: stable + toolchain: nightly - name: Rust Cache uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 312a3320..13ae382f 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -34,7 +34,7 @@ jobs: - name: Generate rust docs run: | echo "Generating docs..." - cargo doc --no-deps + cargo +nightly doc --no-deps - name: Make index.html run: echo ' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 487e1ca3..9dfc34a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,15 +44,15 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v3 - - name: Get latest version of stable Rust - run: rustup update stable + - name: Get latest version of nightly Rust + run: rustup update nightly - name: Install target run: rustup target add ${{ matrix.arch }} - uses: Swatinem/rust-cache@v2 with: cache-on-failure: false - - name: Run cargo clean - run: cargo clean + - name: Run cargo +nightly clean + run: cargo +nightly clean # ============================== # Builds @@ -60,7 +60,7 @@ jobs: - name: Install cross from source run: | - cargo install --git https://github.com/cross-rs/cross cross --branch main + cargo +nightly install --git https://github.com/cross-rs/cross cross --branch main - name: Build era-test-node for ${{ matrix.arch }} run: | diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ad01072b..d08e1ff9 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -23,13 +23,13 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: stable + toolchain: nightly - name: Cache Rust Dependencies uses: Swatinem/rust-cache@v2 - name: Install cargo-nextest - run: cargo +stable install cargo-nextest + run: cargo +nightly install cargo-nextest - name: Run tests - run: cargo nextest run + run: cargo +nightly nextest run From 3863568bb0c56c7498ebd82fc539aa24d9643321 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Fri, 13 Oct 2023 04:14:24 +0200 Subject: [PATCH 02/24] Run not only for the main --- .github/workflows/checks.yaml | 2 -- .github/workflows/docs.yaml | 1 - .github/workflows/tests.yaml | 4 ---- 3 files changed, 7 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 52019a67..8e6992dd 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -2,11 +2,9 @@ name: checks on: push: - branches: [main] tags: - 'v*' pull_request: - branches: [main] workflow_dispatch: jobs: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 13ae382f..3cc0824c 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -3,7 +3,6 @@ name: Deploy static content to Pages on: push: - branches: ["main"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d08e1ff9..293ef8b2 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -2,11 +2,7 @@ name: run on: push: - branches: [main] - tags: - - 'v*' pull_request: - branches: [main] workflow_dispatch: jobs: test: From 8814e16c309b7b3f2b043747e46ee3a1af9c3fa6 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Fri, 13 Oct 2023 04:21:33 +0200 Subject: [PATCH 03/24] oops --- .github/workflows/checks.yaml | 1 + .github/workflows/docs.yaml | 1 + .github/workflows/tests.yaml | 3 +++ 3 files changed, 5 insertions(+) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 8e6992dd..2b1bd7e6 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -2,6 +2,7 @@ name: checks on: push: + branches: [main] tags: - 'v*' pull_request: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 3cc0824c..13ae382f 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -3,6 +3,7 @@ name: Deploy static content to Pages on: push: + branches: ["main"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 293ef8b2..ab25b11f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -2,6 +2,9 @@ name: run on: push: + branches: [ main ] + tags: + - 'v*' pull_request: workflow_dispatch: jobs: From ada8af447031621b2548ebf2436215c4a82c709f Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Fri, 13 Oct 2023 04:45:57 +0200 Subject: [PATCH 04/24] nightly in the makefile --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index ceabeed9..446c83f7 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ rebuild-contracts: # Build the Rust project rust-build: - cargo build --release + cargo +nightly build --release # Run local run: rust-build @@ -27,23 +27,23 @@ build-%: # Build the Rust documentation rust-doc: - cargo doc --no-deps --open + cargo +nightly doc --no-deps --open # Lint checks for Rust code lint: cd e2e-tests && yarn && yarn lint && yarn fmt && yarn typecheck - cargo fmt --all -- --check - cargo clippy -Zunstable-options -- -D warnings --allow clippy::unwrap_used + cargo +nightly fmt --all -- --check + cargo +nightly clippy -Zunstable-options -- -D warnings --allow clippy::unwrap_used # Fix lint errors for Rust code lint-fix: cd e2e-tests && yarn && yarn lint:fix && yarn fmt:fix - cargo clippy --fix - cargo fmt + cargo +nightly clippy --fix + cargo +nightly fmt # Run unit tests for Rust code test: - cargo test + cargo +nightly test # Run e2e tests against running era_test_node test-e2e: From 75decc1e9193ad2776bdbdbb962f1e57ec501799 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Fri, 13 Oct 2023 12:49:47 +0200 Subject: [PATCH 05/24] Fix lint --- src/node.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/node.rs b/src/node.rs index c50b7259..f4b65069 100644 --- a/src/node.rs +++ b/src/node.rs @@ -435,14 +435,9 @@ impl InMemoryNodeInner { let execution_mode = TxExecutionMode::EstimateFee; let (mut batch_env, _) = self.create_l1_batch_env(storage.clone()); batch_env.l1_gas_price = l1_gas_price; - let impersonating = if self + let impersonating = self .impersonated_accounts - .contains(&l2_tx.common_data.initiator_address) - { - true - } else { - false - }; + .contains(&l2_tx.common_data.initiator_address); let system_env = self.create_system_env( self.system_contracts .contracts_for_fee_estimate(impersonating) From 4f56a69c8ea87140e2ea95c215d77a02820accb6 Mon Sep 17 00:00:00 2001 From: MexicanAce Date: Fri, 13 Oct 2023 14:38:04 +0100 Subject: [PATCH 06/24] Update to latest commit hash for zksync-era boojum branch --- Cargo.lock | 85 ++++++++++++++++++++++++++++++++------------------ Cargo.toml | 18 +++++------ src/fork.rs | 8 +++-- src/main.rs | 2 +- src/node.rs | 8 ++--- src/testing.rs | 6 ++-- src/zks.rs | 2 +- 7 files changed, 78 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 42177043..4ca4222d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3855,13 +3855,14 @@ dependencies = [ [[package]] name = "multivm" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "vlog", "vm", "vm_1_3_2", "vm_m5", "vm_m6", + "vm_virtual_blocks", "zksync_contracts", "zksync_state", "zksync_types", @@ -4761,7 +4762,7 @@ dependencies = [ [[package]] name = "prometheus_exporter" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "metrics", @@ -6929,7 +6930,7 @@ dependencies = [ [[package]] name = "vlog" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "chrono", "sentry", @@ -6941,7 +6942,7 @@ dependencies = [ [[package]] name = "vm" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "hex", @@ -6950,7 +6951,7 @@ dependencies = [ "thiserror", "tracing", "vise", - "zk_evm 1.3.3", + "zk_evm 1.4.0", "zksync_config", "zksync_contracts", "zksync_state", @@ -6961,7 +6962,7 @@ dependencies = [ [[package]] name = "vm_1_3_2" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "ethabi 18.0.0", @@ -6982,7 +6983,7 @@ dependencies = [ [[package]] name = "vm_m5" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "hex", "itertools", @@ -7003,7 +7004,7 @@ dependencies = [ [[package]] name = "vm_m6" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "hex", "itertools", @@ -7022,6 +7023,26 @@ dependencies = [ "zksync_utils", ] +[[package]] +name = "vm_virtual_blocks" +version = "0.1.0" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" +dependencies = [ + "anyhow", + "hex", + "itertools", + "once_cell", + "thiserror", + "tracing", + "vise", + "zk_evm 1.3.3", + "zksync_config", + "zksync_contracts", + "zksync_state", + "zksync_types", + "zksync_utils", +] + [[package]] name = "walkdir" version = "2.3.3" @@ -7567,16 +7588,17 @@ dependencies = [ [[package]] name = "zksync_basic_types" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "serde", + "serde_json", "web3", ] [[package]] name = "zksync_circuit_breaker" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "async-trait", @@ -7599,7 +7621,7 @@ dependencies = [ [[package]] name = "zksync_config" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "bigdecimal", @@ -7618,7 +7640,7 @@ dependencies = [ [[package]] name = "zksync_contracts" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "envy", "ethabi 18.0.0", @@ -7632,7 +7654,7 @@ dependencies = [ [[package]] name = "zksync_core" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "actix-cors", "actix-rt", @@ -7695,7 +7717,7 @@ dependencies = [ [[package]] name = "zksync_crypto" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "base64 0.13.1", "blake2 0.10.6", @@ -7710,7 +7732,7 @@ dependencies = [ [[package]] name = "zksync_dal" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "bigdecimal", @@ -7737,7 +7759,7 @@ dependencies = [ [[package]] name = "zksync_eth_client" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "async-trait", @@ -7757,7 +7779,7 @@ dependencies = [ [[package]] name = "zksync_eth_signer" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "async-trait", "hex", @@ -7776,7 +7798,7 @@ dependencies = [ [[package]] name = "zksync_health_check" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "async-trait", "futures 0.3.28", @@ -7789,7 +7811,7 @@ dependencies = [ [[package]] name = "zksync_mempool" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "tracing", "zksync_types", @@ -7798,7 +7820,7 @@ dependencies = [ [[package]] name = "zksync_merkle_tree" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "leb128", "once_cell", @@ -7815,7 +7837,7 @@ dependencies = [ [[package]] name = "zksync_mini_merkle_tree" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "once_cell", "zksync_basic_types", @@ -7825,7 +7847,7 @@ dependencies = [ [[package]] name = "zksync_object_store" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "async-trait", @@ -7843,7 +7865,7 @@ dependencies = [ [[package]] name = "zksync_prover_utils" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "async-trait", @@ -7863,7 +7885,7 @@ dependencies = [ [[package]] name = "zksync_queued_job_processor" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "async-trait", @@ -7875,9 +7897,10 @@ dependencies = [ [[package]] name = "zksync_state" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", + "itertools", "metrics", "mini-moka", "tokio", @@ -7892,7 +7915,7 @@ dependencies = [ [[package]] name = "zksync_storage" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "num_cpus", "once_cell", @@ -7904,12 +7927,13 @@ dependencies = [ [[package]] name = "zksync_types" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "blake2 0.10.6", "chrono", "codegen 0.1.0", "ethereum-types 0.12.1", + "hex", "num 0.3.1", "num_enum", "once_cell", @@ -7921,6 +7945,7 @@ dependencies = [ "strum", "thiserror", "zk_evm 1.3.3", + "zk_evm 1.4.0", "zkevm_test_harness 1.3.3", "zksync_basic_types", "zksync_config", @@ -7932,7 +7957,7 @@ dependencies = [ [[package]] name = "zksync_utils" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "bigdecimal", @@ -7954,7 +7979,7 @@ dependencies = [ [[package]] name = "zksync_verification_key_generator_and_server" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "anyhow", "bincode", @@ -7974,7 +7999,7 @@ dependencies = [ [[package]] name = "zksync_web3_decl" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=9557e3e3f6505c6e2ccbcd98242948e844baaf59#9557e3e3f6505c6e2ccbcd98242948e844baaf59" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=5e7bc64b393ee529e0473b79569931c326118893#5e7bc64b393ee529e0473b79569931c326118893" dependencies = [ "bigdecimal", "chrono", diff --git a/Cargo.toml b/Cargo.toml index c602f2dc..167e6425 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,15 +11,15 @@ 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 = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -zksync_core = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -vm = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -vlog = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -zksync_contracts = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -zksync_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -zksync_utils = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -zksync_state = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } -zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", rev = "9557e3e3f6505c6e2ccbcd98242948e844baaf59" } +zksync_basic_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } +zksync_core = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } +vm = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } +vlog = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } +zksync_contracts = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } +zksync_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } +zksync_utils = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } +zksync_state = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } +zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", rev = "5e7bc64b393ee529e0473b79569931c326118893" } diff --git a/src/fork.rs b/src/fork.rs index 177e4356..fdc0ae41 100644 --- a/src/fork.rs +++ b/src/fork.rs @@ -5,7 +5,7 @@ use std::{ collections::HashMap, - convert::TryInto, + convert::{TryFrom, TryInto}, future::Future, sync::{Arc, RwLock}, }; @@ -74,7 +74,7 @@ impl ForkStorage { let chain_id = fork .as_ref() .and_then(|d| d.overwrite_chain_id) - .unwrap_or(L2ChainId(TEST_NODE_NETWORK_ID)); + .unwrap_or(L2ChainId::from(TEST_NODE_NETWORK_ID)); log::info!("Starting network with chain id: {:?}", chain_id); ForkStorage { @@ -353,7 +353,9 @@ impl ForkDetails { pub async fn from_network_tx(fork: &str, tx: H256, cache_config: CacheConfig) -> Self { let (url, client) = Self::fork_to_url_and_client(fork); let tx_details = client.get_transaction_by_hash(tx).await.unwrap().unwrap(); - let overwrite_chain_id = Some(L2ChainId(tx_details.chain_id.as_u32() as u16)); + let overwrite_chain_id = Some(L2ChainId::try_from(tx_details.chain_id).unwrap_or_else( + |err| panic!("erroneous chain id {}: {:?}", tx_details.chain_id, err,), + )); let miniblock_number = MiniblockNumber(tx_details.block_number.unwrap().as_u32()); // We have to sync to the one-miniblock before the one where transaction is. let l2_miniblock = miniblock_number.saturating_sub(1) as u64; diff --git a/src/main.rs b/src/main.rs index 98418579..51b79eb5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -370,7 +370,7 @@ async fn main() -> anyhow::Result<()> { log::info!(""); } - let net = NetNamespace::new(L2ChainId(TEST_NODE_NETWORK_ID)); + let net = NetNamespace::new(L2ChainId::from(TEST_NODE_NETWORK_ID)); let config_api = ConfigurationApiNamespace::new(node.get_inner()); let evm = EvmNamespaceImpl::new(node.get_inner()); let zks = ZkMockNamespaceImpl::new(node.get_inner()); diff --git a/src/node.rs b/src/node.rs index f4b65069..279caefc 100644 --- a/src/node.rs +++ b/src/node.rs @@ -73,7 +73,7 @@ pub const MAX_TX_SIZE: usize = 1_000_000; /// Timestamp of the first block (if not running in fork mode). pub const NON_FORK_FIRST_BLOCK_TIMESTAMP: u64 = 1_000; /// Network ID we use for the test node. -pub const TEST_NODE_NETWORK_ID: u16 = 260; +pub const TEST_NODE_NETWORK_ID: u32 = 260; /// L1 Gas Price. pub const L1_GAS_PRICE: u64 = 50_000_000_000; /// L2 Gas Price (0.25 gwei). @@ -1463,7 +1463,7 @@ impl EthNamespaceT for /// Returns the chain ID of the node. fn chain_id(&self) -> jsonrpc_core::BoxFuture> { match self.inner.read() { - Ok(inner) => Ok(U64::from(inner.fork_storage.chain_id.0 as u64)).into_boxed_future(), + Ok(inner) => Ok(U64::from(inner.fork_storage.chain_id.as_u64())).into_boxed_future(), Err(_) => Err(into_jsrpc_error(Web3Error::InternalError)).into_boxed_future(), } } @@ -1778,7 +1778,7 @@ impl EthNamespaceT for } }; - let (tx_req, hash) = match TransactionRequest::from_bytes(&tx_bytes.0, chain_id.0) { + let (tx_req, hash) = match TransactionRequest::from_bytes(&tx_bytes.0, chain_id) { Ok(result) => result, Err(e) => { return futures::future::err(into_jsrpc_error(Web3Error::SerializationError(e))) @@ -1951,7 +1951,7 @@ impl EthNamespaceT for max_priority_fee_per_gas: Some( info.tx.common_data.fee.max_priority_fee_per_gas, ), - chain_id: chain_id.into(), + chain_id, l1_batch_number: Some(U64::from(info.batch_number as u64)), l1_batch_tx_index: None, }) diff --git a/src/testing.rs b/src/testing.rs index a2f9399d..15f8bddf 100644 --- a/src/testing.rs +++ b/src/testing.rs @@ -94,7 +94,7 @@ impl MockServer { "default_aa": "0x0100038dc66b69be75ec31653c64cb931678299b9b659472772b2550b703f41c" }, "operatorAddress": "0xfeee860e7aae671124e9a4e61139f3a5085dfeee", - "protocolVersion": ProtocolVersionId::latest(), + "protocolVersion": ProtocolVersionId::Version15, }, }))), ); @@ -273,7 +273,7 @@ impl TransactionResponseBuilder { "type": "0xff", "maxFeePerGas": "0x0", "maxPriorityFeePerGas": "0x0", - "chainId": "0x144", + "chainId": 260, "l1BatchNumber": "0x1", "l1BatchTxIndex": "0x0", }) @@ -379,7 +379,7 @@ pub fn apply_tx(node: &InMemoryNode, tx_hash gas_per_pubdata_limit: U256::from(20000), }, U256::from(1), - L2ChainId(260), + L2ChainId::from(260), &private_key, None, Default::default(), diff --git a/src/zks.rs b/src/zks.rs index 1aee8599..ee7f56ac 100644 --- a/src/zks.rs +++ b/src/zks.rs @@ -284,7 +284,7 @@ mod tests { let result = namespace.estimate_fee(mock_request).await.unwrap(); - assert_eq!(result.gas_limit, U256::from(1087416)); + assert_eq!(result.gas_limit, U256::from(731457)); assert_eq!(result.max_fee_per_gas, U256::from(250000000)); assert_eq!(result.max_priority_fee_per_gas, U256::from(0)); assert_eq!(result.gas_per_pubdata_limit, U256::from(4080)); From 7847546fde260d9d5928ba1a85046e06583260e0 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Mon, 16 Oct 2023 15:50:48 +0400 Subject: [PATCH 07/24] Try to disable cache for the tests CI --- .github/workflows/tests.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ab25b11f..d61dbbbc 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -23,9 +23,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: nightly - - - name: Cache Rust Dependencies - uses: Swatinem/rust-cache@v2 - name: Install cargo-nextest run: cargo +nightly install cargo-nextest From 444e21e368a51552f25c2d37ff362c86e9a950a5 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Mon, 16 Oct 2023 16:35:28 +0400 Subject: [PATCH 08/24] Restore rust cache for the tests CI --- .github/workflows/tests.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d61dbbbc..c1f7842b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -23,9 +23,12 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: nightly - + + - name: Cache Rust Dependencies + uses: Swatinem/rust-cache@v2 + - name: Install cargo-nextest run: cargo +nightly install cargo-nextest - + - name: Run tests run: cargo +nightly nextest run From 4a698fc8fdfaba86bd225891502c8acb038a6ba3 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Tue, 17 Oct 2023 16:59:27 +0400 Subject: [PATCH 09/24] Try more powerful machine --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c1f7842b..44dc8b9e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -12,7 +12,7 @@ jobs: name: unit-tests strategy: matrix: - platform: [ubuntu-latest, macos-latest] + platform: [ubuntu-22.04-github-hosted-16core] runs-on: ${{ matrix.platform }} steps: From 5b31d781ee7a6df96e3b178763cb282004cd289d Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Tue, 17 Oct 2023 18:22:36 +0400 Subject: [PATCH 10/24] try without nightly --- .github/workflows/tests.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 44dc8b9e..e984bd51 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -12,7 +12,7 @@ jobs: name: unit-tests strategy: matrix: - platform: [ubuntu-22.04-github-hosted-16core] + platform: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.platform }} steps: @@ -28,7 +28,7 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Install cargo-nextest - run: cargo +nightly install cargo-nextest + run: cargo install cargo-nextest - name: Run tests - run: cargo +nightly nextest run + run: cargo nextest run From b91754e2739db2d0b4b8a2b4f0cedb91f1fe25cb Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Wed, 18 Oct 2023 12:20:07 +0400 Subject: [PATCH 11/24] Try another rust --- .github/workflows/tests.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e984bd51..49369a27 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -19,10 +19,10 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: nightly + - name: Install rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: nightly-2023-04-17 - name: Cache Rust Dependencies uses: Swatinem/rust-cache@v2 From 5dfdd44aca32936e3f8dd4eee99b71ef955136c3 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Wed, 18 Oct 2023 13:15:53 +0400 Subject: [PATCH 12/24] Set rust version --- .github/workflows/checks.yaml | 3 ++- .github/workflows/docs.yaml | 2 +- .github/workflows/release.yml | 10 +++++----- .github/workflows/tests.yaml | 9 +++++---- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 2b1bd7e6..f1f47bd4 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -6,6 +6,7 @@ on: tags: - 'v*' pull_request: + branches: [boojum-integration] workflow_dispatch: jobs: @@ -18,7 +19,7 @@ jobs: - name: Install latest nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly + toolchain: nightly-2023-07-21 components: rustfmt, clippy - name: Rust Cache diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 13ae382f..312a3320 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -34,7 +34,7 @@ jobs: - name: Generate rust docs run: | echo "Generating docs..." - cargo +nightly doc --no-deps + cargo doc --no-deps - name: Make index.html run: echo ' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9dfc34a7..7161527c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,15 +44,15 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v3 - - name: Get latest version of nightly Rust - run: rustup update nightly + - name: Set version of nightly Rust + run: rustup default nightly-2023-07-21 - name: Install target run: rustup target add ${{ matrix.arch }} - uses: Swatinem/rust-cache@v2 with: cache-on-failure: false - - name: Run cargo +nightly clean - run: cargo +nightly clean + - name: Run cargo clean + run: cargo clean # ============================== # Builds @@ -60,7 +60,7 @@ jobs: - name: Install cross from source run: | - cargo +nightly install --git https://github.com/cross-rs/cross cross --branch main + cargo install --git https://github.com/cross-rs/cross cross --branch main - name: Build era-test-node for ${{ matrix.arch }} run: | diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 49369a27..90d98e24 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -2,10 +2,11 @@ name: run on: push: - branches: [ main ] + branches: [boojum-integration] tags: - 'v*' pull_request: + branches: [boojum-integration] workflow_dispatch: jobs: test: @@ -19,10 +20,10 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 - - name: Install rust - uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2023-04-17 + toolchain: nightly-2023-07-21 - name: Cache Rust Dependencies uses: Swatinem/rust-cache@v2 From 04a1db465b9d80fd43a6ddebdbc3081d3a3ad43e Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Wed, 18 Oct 2023 13:25:10 +0400 Subject: [PATCH 13/24] Restore makefile --- .github/workflows/checks.yaml | 2 +- Makefile | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index f1f47bd4..d96a688a 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -47,7 +47,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly + toolchain: nightly-2023-07-21 - name: Rust Cache uses: Swatinem/rust-cache@v2 diff --git a/Makefile b/Makefile index 446c83f7..ceabeed9 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ rebuild-contracts: # Build the Rust project rust-build: - cargo +nightly build --release + cargo build --release # Run local run: rust-build @@ -27,23 +27,23 @@ build-%: # Build the Rust documentation rust-doc: - cargo +nightly doc --no-deps --open + cargo doc --no-deps --open # Lint checks for Rust code lint: cd e2e-tests && yarn && yarn lint && yarn fmt && yarn typecheck - cargo +nightly fmt --all -- --check - cargo +nightly clippy -Zunstable-options -- -D warnings --allow clippy::unwrap_used + cargo fmt --all -- --check + cargo clippy -Zunstable-options -- -D warnings --allow clippy::unwrap_used # Fix lint errors for Rust code lint-fix: cd e2e-tests && yarn && yarn lint:fix && yarn fmt:fix - cargo +nightly clippy --fix - cargo +nightly fmt + cargo clippy --fix + cargo fmt # Run unit tests for Rust code test: - cargo +nightly test + cargo test # Run e2e tests against running era_test_node test-e2e: From 9552ae40621e6482d070a1da86a0334219fe0467 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Wed, 18 Oct 2023 13:52:13 +0400 Subject: [PATCH 14/24] Change action for the rust --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 90d98e24..3687c279 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v3 - name: Install Rust - uses: dtolnay/rust-toolchain@stable + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: nightly-2023-07-21 From 0bd89dd3b30e9802bdad0d1995096d2ce86809d3 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Wed, 18 Oct 2023 14:12:46 +0400 Subject: [PATCH 15/24] Undo previous commit and change rust version --- .github/workflows/checks.yaml | 4 ++-- .github/workflows/release.yml | 2 +- .github/workflows/tests.yaml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index d96a688a..9c940f24 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -19,7 +19,7 @@ jobs: - name: Install latest nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2023-07-21 + toolchain: nightly-2023-04-17 components: rustfmt, clippy - name: Rust Cache @@ -47,7 +47,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2023-07-21 + toolchain: nightly-2023-04-17 - name: Rust Cache uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7161527c..f95396ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v3 - name: Set version of nightly Rust - run: rustup default nightly-2023-07-21 + run: rustup default nightly-2023-04-17 - name: Install target run: rustup target add ${{ matrix.arch }} - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3687c279..f8073ecd 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -21,9 +21,9 @@ jobs: uses: actions/checkout@v3 - name: Install Rust - uses: actions-rust-lang/setup-rust-toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2023-07-21 + toolchain: nightly-2023-04-17 - name: Cache Rust Dependencies uses: Swatinem/rust-cache@v2 From 9950be7c5b91eea81420ec982f438cf833a42275 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Wed, 18 Oct 2023 16:14:07 +0400 Subject: [PATCH 16/24] Another action with new version --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f8073ecd..20f11c2a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v3 - name: Install Rust - uses: dtolnay/rust-toolchain@stable + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: nightly-2023-04-17 From adce146e855987aba3e94d6a741ce45f4d86d070 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Thu, 19 Oct 2023 23:50:40 +0400 Subject: [PATCH 17/24] Update rust action everywhere --- .github/workflows/checks.yaml | 14 ++++---------- .github/workflows/tests.yaml | 3 --- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 9c940f24..118bedb7 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -16,15 +16,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Install latest nightly - uses: dtolnay/rust-toolchain@stable + - name: Install rust + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: nightly-2023-04-17 components: rustfmt, clippy - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - uses: actions/setup-node@v3 with: node-version: 18.x @@ -43,15 +40,12 @@ jobs: os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@v3 - + - name: Install Rust - uses: dtolnay/rust-toolchain@stable + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: nightly-2023-04-17 - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - name: Build Code run: make all diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 20f11c2a..7f8e694e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -25,9 +25,6 @@ jobs: with: toolchain: nightly-2023-04-17 - - name: Cache Rust Dependencies - uses: Swatinem/rust-cache@v2 - - name: Install cargo-nextest run: cargo install cargo-nextest From a94e6b1fb0b178fa781c6700b7da52ef1d7dbba6 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Fri, 20 Oct 2023 00:08:51 +0400 Subject: [PATCH 18/24] fix lints --- src/node.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/node.rs b/src/node.rs index 279caefc..99918a69 100644 --- a/src/node.rs +++ b/src/node.rs @@ -481,8 +481,8 @@ impl InMemoryNodeInner { gas_per_pubdata_byte, suggested_gas_limit, l1_gas_price, - batch_env.clone(), - system_env.clone(), + batch_env, + system_env, &self.fork_storage, ); @@ -824,7 +824,7 @@ impl InMemoryNode { } /// Runs L2 'eth call' method - that doesn't commit to a block. - fn run_l2_call(&self, l2_tx: L2Tx) -> Result { + fn run_l2_call(&self, mut l2_tx: L2Tx) -> Result { let execution_mode = TxExecutionMode::EthCall; let inner = self @@ -843,7 +843,6 @@ impl InMemoryNode { let mut vm = Vm::new(batch_env, system_env, storage, HistoryDisabled); - let mut l2_tx = l2_tx.clone(); // We must inject *some* signature (otherwise bootloader code fails to generate hash). if l2_tx.common_data.signature.is_empty() { l2_tx.common_data.signature = PackedEthSignature::default().serialize_packed().into(); From 64890f412f6c0c345a0735cc990ecbee00f4d44a Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Fri, 20 Oct 2023 15:08:04 +0400 Subject: [PATCH 19/24] Collect Workflow Telemetry --- .github/workflows/tests.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7f8e694e..addee6e2 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -20,6 +20,9 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 + - name: Collect Workflow Telemetry + uses: runforesight/workflow-telemetry-action@v1 + - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: From 45e89fbd70c5eae97e0961212d2084b2fdf45eb0 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Fri, 20 Oct 2023 15:18:20 +0400 Subject: [PATCH 20/24] Update rust to test without cache --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index addee6e2..9e67c707 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -26,7 +26,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2023-04-17 + toolchain: nightly-2023-07-20 - name: Install cargo-nextest run: cargo install cargo-nextest From fec5722ad3697666aa8d0b59a28eb8de94f7d2b8 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Fri, 20 Oct 2023 16:01:20 +0400 Subject: [PATCH 21/24] Old rust action --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9e67c707..7074bad6 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -24,7 +24,7 @@ jobs: uses: runforesight/workflow-telemetry-action@v1 - name: Install Rust - uses: actions-rust-lang/setup-rust-toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: nightly-2023-07-20 From 19d3a92a15cb84f71ddf10e6a3b56efc35de9ad0 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Sat, 21 Oct 2023 15:59:06 +0400 Subject: [PATCH 22/24] Restore old action and new rust version --- .github/workflows/checks.yaml | 14 ++++++++++---- .github/workflows/release.yml | 2 +- .github/workflows/tests.yaml | 8 ++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 118bedb7..7a7bb9cf 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -17,11 +17,14 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install rust - uses: actions-rust-lang/setup-rust-toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2023-04-17 + toolchain: nightly-2023-07-21 components: rustfmt, clippy + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - uses: actions/setup-node@v3 with: node-version: 18.x @@ -42,9 +45,12 @@ jobs: - uses: actions/checkout@v3 - name: Install Rust - uses: actions-rust-lang/setup-rust-toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2023-04-17 + toolchain: nightly-2023-07-21 + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 - name: Build Code run: make all diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f95396ab..7161527c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v3 - name: Set version of nightly Rust - run: rustup default nightly-2023-04-17 + run: rustup default nightly-2023-07-21 - name: Install target run: rustup target add ${{ matrix.arch }} - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7074bad6..90d98e24 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -20,13 +20,13 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 - - name: Collect Workflow Telemetry - uses: runforesight/workflow-telemetry-action@v1 - - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2023-07-20 + toolchain: nightly-2023-07-21 + + - name: Cache Rust Dependencies + uses: Swatinem/rust-cache@v2 - name: Install cargo-nextest run: cargo install cargo-nextest From d03b4aa440da447e0b88a72c37aa2f326e039bc5 Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Sun, 22 Oct 2023 02:13:48 +0400 Subject: [PATCH 23/24] should work --- .github/workflows/checks.yaml | 10 ++-------- .github/workflows/tests.yaml | 5 +---- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 7a7bb9cf..1c9c3125 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -17,14 +17,11 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install rust - uses: dtolnay/rust-toolchain@stable + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: nightly-2023-07-21 components: rustfmt, clippy - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - uses: actions/setup-node@v3 with: node-version: 18.x @@ -45,13 +42,10 @@ jobs: - uses: actions/checkout@v3 - name: Install Rust - uses: dtolnay/rust-toolchain@stable + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: nightly-2023-07-21 - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - name: Build Code run: make all diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 90d98e24..540d52f8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -21,13 +21,10 @@ jobs: uses: actions/checkout@v3 - name: Install Rust - uses: dtolnay/rust-toolchain@stable + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: nightly-2023-07-21 - - name: Cache Rust Dependencies - uses: Swatinem/rust-cache@v2 - - name: Install cargo-nextest run: cargo install cargo-nextest From faecbfc127501555010f5409167b5bbfb429dfed Mon Sep 17 00:00:00 2001 From: AntonD3 Date: Thu, 26 Oct 2023 11:36:03 +0400 Subject: [PATCH 24/24] Fix e2e zks_estimateFee test --- e2e-tests/test/zks-apis.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-tests/test/zks-apis.test.ts b/e2e-tests/test/zks-apis.test.ts index 35770486..dde269d5 100644 --- a/e2e-tests/test/zks-apis.test.ts +++ b/e2e-tests/test/zks-apis.test.ts @@ -31,7 +31,7 @@ describe("zks_estimateFee", function () { const response: Fee = await provider.send("zks_estimateFee", [transaction]); // Assert - expect(ethers.BigNumber.from(response.gas_limit)).to.eql(ethers.BigNumber.from("1230957"), "Unexpected gas_limit"); + expect(ethers.BigNumber.from(response.gas_limit)).to.eql(ethers.BigNumber.from("1231992"), "Unexpected gas_limit"); expect(ethers.BigNumber.from(response.gas_per_pubdata_limit)).to.eql( ethers.BigNumber.from("4080"), "Unexpected gas_per_pubdata_limit"