From 49b627d7c016cde705cec58d3e5d398a7f2143a8 Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Mon, 6 Jan 2025 18:15:58 +0400 Subject: [PATCH] feat: Support stable Rust (#510) --- .github/workflows/checks.yaml | 4 +- .github/workflows/docs.yaml | 4 +- .github/workflows/release.yml | 2 +- .github/workflows/tests.yaml | 2 +- Cargo.lock | 441 ++++---------------------- Cargo.toml | 11 +- Dockerfile | 4 +- Makefile | 6 +- SUPPORTED_APIS.md | 1 + crates/api_server/src/impls/eth.rs | 2 +- crates/api_server/src/impls/zks.rs | 4 + crates/cli/src/cli.rs | 1 + crates/core/Cargo.toml | 1 - crates/core/src/bootloader_debug.rs | 5 +- crates/core/src/fork.rs | 4 +- crates/core/src/node/eth.rs | 27 +- crates/core/src/node/in_memory.rs | 7 +- crates/core/src/node/in_memory_ext.rs | 35 +- crates/core/src/node/storage_logs.rs | 2 +- crates/core/src/node/zks.rs | 7 +- crates/core/src/system_contracts.rs | 20 +- crates/core/src/testing.rs | 7 +- crates/core/src/utils.rs | 21 +- e2e-tests-rust/Cargo.lock | 438 ++++--------------------- e2e-tests-rust/src/utils.rs | 1 + rust-toolchain.toml | 4 +- 26 files changed, 219 insertions(+), 842 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 415824cf..340b2d08 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -19,7 +19,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-08-01 + toolchain: stable components: rustfmt, clippy - uses: actions/setup-node@v3 @@ -44,7 +44,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-08-01 + toolchain: stable - name: Build Code run: make all diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index de8b82c1..ba14251e 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -33,7 +33,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-08-01 + toolchain: stable - name: Setup Pages uses: actions/configure-pages@v3 @@ -75,4 +75,4 @@ jobs: path: 'target/doc' - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v2 \ No newline at end of file + uses: actions/deploy-pages@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41c73a04..ebfb1d3b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,7 +55,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-08-01 + toolchain: stable - name: Install target run: rustup target add ${{ matrix.arch }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d1888bc6..d0895f3a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -24,7 +24,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-08-01 + toolchain: stable - name: Install cargo-nextest run: cargo install cargo-nextest diff --git a/Cargo.lock b/Cargo.lock index 491ce9a8..b0d99420 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -497,7 +497,6 @@ dependencies = [ "zksync_contracts", "zksync_multivm", "zksync_types", - "zksync_utils", "zksync_web3_decl", ] @@ -888,15 +887,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - [[package]] name = "bindgen" version = "0.69.5" @@ -1040,37 +1030,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "boojum" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ec2f007ff8f90cc459f03e9f30ca1065440170f013c868823646e2e48d0234" -dependencies = [ - "arrayvec 0.7.6", - "bincode", - "blake2", - "const_format", - "convert_case", - "crossbeam", - "crypto-bigint 0.5.5", - "derivative", - "ethereum-types 0.14.1", - "firestorm", - "itertools 0.10.5", - "lazy_static", - "num-modular", - "num_cpus", - "rand 0.8.5", - "rayon", - "serde", - "sha2 0.10.8", - "sha3_ce", - "smallvec", - "unroll", - "zksync_cs_derive", - "zksync_pairing", -] - [[package]] name = "bs58" version = "0.5.1" @@ -1244,119 +1203,16 @@ dependencies = [ "inout", ] -[[package]] -name = "circuit_encodings" -version = "0.140.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf6b7cc842eadb4c250cdc6a8bc1dd97624d9f08bbe54db3e11fb23c3a72be07" -dependencies = [ - "derivative", - "serde", - "zk_evm 0.140.0", - "zkevm_circuits 0.140.3", -] - -[[package]] -name = "circuit_encodings" -version = "0.141.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7898ffbf3cd413576b4b674fe1545a35488c67eb16bd5a4148425e42c2a2b65b" -dependencies = [ - "derivative", - "serde", - "zk_evm 0.141.0", - "zkevm_circuits 0.141.2", -] - -[[package]] -name = "circuit_encodings" -version = "0.142.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8364ecafcc4b2c896023f8d3af952c52a500aa55f14fd268bb5d9ab07f837369" -dependencies = [ - "derivative", - "serde", - "zk_evm 0.141.0", - "zkevm_circuits 0.141.2", -] - -[[package]] -name = "circuit_encodings" -version = "0.150.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2501cc688ef391013019495ae7035cfd54f86987e36d10f73976ce4c5d413c5a" -dependencies = [ - "derivative", - "serde", - "zk_evm 0.150.7", - "zkevm_circuits 0.150.7", -] - -[[package]] -name = "circuit_sequencer_api" -version = "0.133.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb959b1f8c6bbd8be711994d182e85452a26a5d2213a709290b71c8262af1331" -dependencies = [ - "derivative", - "rayon", - "serde", - "zk_evm 0.133.0", - "zksync_bellman", -] - [[package]] name = "circuit_sequencer_api" -version = "0.140.3" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa5f22311ce609d852d7d9f4943535ea4610aeb785129ae6ff83d5201c4fb387" +checksum = "d13ed70909e8390a4f2599d5a76d9ac4189e5bbbf16146d11b7999788740f291" dependencies = [ - "circuit_encodings 0.140.3", - "derivative", - "rayon", - "serde", - "zk_evm 0.140.0", - "zksync_bellman", -] - -[[package]] -name = "circuit_sequencer_api" -version = "0.141.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c47c71d6ba83a8beb0af13af70beffd627f5497caf3d44c6f96363e788b07ea" -dependencies = [ - "circuit_encodings 0.141.2", - "derivative", - "rayon", - "serde", - "zk_evm 0.141.0", - "zksync_bellman", -] - -[[package]] -name = "circuit_sequencer_api" -version = "0.142.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e264723359e6a1aad98110bdccf1ae3ad596e93e7d31da9e40f6adc07e4add54" -dependencies = [ - "circuit_encodings 0.142.2", - "derivative", - "rayon", - "serde", - "zk_evm 0.141.0", - "zksync_bellman", -] - -[[package]] -name = "circuit_sequencer_api" -version = "0.150.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917d27db531fdd98a51e42ea465bc097f48cc849e7fad68d7856087d15125be1" -dependencies = [ - "circuit_encodings 0.150.7", "derivative", "rayon", "serde", + "zk_evm 0.150.18", "zksync_bellman", ] @@ -1555,6 +1411,15 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bed69047ed42e52c7e38d6421eeb8ceefb4f2a2b52eed59137f7bad7908f6800" +[[package]] +name = "const-decoder" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b381abde2cdc1bc3817e394b24e05667a2dc89f37570cbd34d9c397d99e56e3f" +dependencies = [ + "compile-fmt", +] + [[package]] name = "const-hex" version = "1.14.0" @@ -1574,41 +1439,12 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "const_format" -version = "0.2.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c655d81ff1114fb0dcdea9225ea9f0cc712a6f8d189378e82bdf62a473a64b" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff1a44b93f47b1bac19a27932f5c591e43d1ba357ee4f61526c8a25603f0eb1" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - [[package]] name = "constant_time_eq" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "core-foundation" version = "0.9.4" @@ -1837,7 +1673,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", - "serde", ] [[package]] @@ -2550,12 +2385,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "firestorm" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c5f6c2c942da57e2aaaa84b8a521489486f14e75e7fa91dab70aba913975f98" - [[package]] name = "fixed-hash" version = "0.7.0" @@ -4208,16 +4037,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-modular" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a5fe11d4135c3bcdf3a95b18b194afa9608a5f6ff034f5d857bc9a27fb0119" -dependencies = [ - "num-integer", - "num-traits", -] - [[package]] name = "num-rational" version = "0.4.2" @@ -4914,30 +4733,6 @@ dependencies = [ "toml_edit 0.22.22", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -6041,12 +5836,6 @@ dependencies = [ "uuid 1.11.0", ] -[[package]] -name = "seq-macro" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" - [[package]] name = "serde" version = "1.0.215" @@ -6310,9 +6099,6 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -dependencies = [ - "serde", -] [[package]] name = "socket2" @@ -7182,12 +6968,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" -[[package]] -name = "unicode-segmentation" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - [[package]] name = "unicode-width" version = "0.1.14" @@ -7200,16 +6980,6 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" -[[package]] -name = "unroll" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad948c1cb799b1a70f836077721a92a35ac177d4daddf4c20a633786d4cf618" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "unsafe-libyaml" version = "0.2.11" @@ -8000,9 +7770,9 @@ dependencies = [ [[package]] name = "zk_evm" -version = "0.150.7" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cc74fbe2b45fd19e95c59ea792c795feebdb616ebaa463f0ac567f495f47387" +checksum = "3278d0f75408ab35d25998e1124124cd108b48b2a81ed8e71e892ddc5a6be0aa" dependencies = [ "anyhow", "lazy_static", @@ -8010,7 +7780,7 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "zk_evm_abstractions 0.150.7", + "zk_evm_abstractions 0.150.18", ] [[package]] @@ -8041,79 +7811,15 @@ dependencies = [ [[package]] name = "zk_evm_abstractions" -version = "0.150.7" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37f333a3b059899df09e40deb041af881bc03e496fda5eec618ffb5e854ee7df" +checksum = "88b4e5a89cfe1594b6476be16c8c1d45f22ce12bff31c49e077b381a398edd8a" dependencies = [ "anyhow", "num_enum 0.6.1", "serde", "static_assertions", - "zkevm_opcode_defs 0.150.7", -] - -[[package]] -name = "zkevm_circuits" -version = "0.140.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c365c801e0c6eda83fbd153df45575172beb406bfb663d386f9154b4325eda" -dependencies = [ - "arrayvec 0.7.6", - "bincode", - "boojum", - "derivative", - "hex", - "itertools 0.10.5", - "rand 0.4.6", - "rand 0.8.5", - "seq-macro", - "serde", - "serde_json", - "smallvec", - "zkevm_opcode_defs 0.132.0", - "zksync_cs_derive", -] - -[[package]] -name = "zkevm_circuits" -version = "0.141.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ccd0352e122a4e6f0046d2163b7e692e627b23fc3264faa77331a21b65833fd" -dependencies = [ - "arrayvec 0.7.6", - "bincode", - "boojum", - "derivative", - "hex", - "itertools 0.10.5", - "rand 0.4.6", - "rand 0.8.5", - "seq-macro", - "serde", - "serde_json", - "smallvec", - "zkevm_opcode_defs 0.141.0", - "zksync_cs_derive", -] - -[[package]] -name = "zkevm_circuits" -version = "0.150.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06fb35b00699d25175a2ad447f86a9088af8b0bc698bb57086fb04c13e52eab" -dependencies = [ - "arrayvec 0.7.6", - "boojum", - "derivative", - "hex", - "itertools 0.10.5", - "rand 0.4.6", - "rand 0.8.5", - "seq-macro", - "serde", - "smallvec", - "zkevm_opcode_defs 0.150.7", - "zksync_cs_derive", + "zkevm_opcode_defs 0.150.18", ] [[package]] @@ -8160,9 +7866,9 @@ dependencies = [ [[package]] name = "zkevm_opcode_defs" -version = "0.150.7" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b83f3b279248af4ca86dec20a54127f02110b45570f3f6c1d13df49ba75c28a5" +checksum = "5bad437d4891536fdcc0054a3f04562c408817ff19d83b6c27569217692e6e74" dependencies = [ "bitflags 2.6.0", "blake2", @@ -8199,10 +7905,11 @@ dependencies = [ [[package]] name = "zksync_basic_types" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", "chrono", + "const-decoder", "ethabi 18.0.0", "hex", "num_enum 0.7.3", @@ -8210,6 +7917,7 @@ dependencies = [ "serde", "serde_json", "serde_with", + "sha2 0.10.8", "strum", "thiserror", "tiny-keccak 2.0.2", @@ -8218,9 +7926,9 @@ dependencies = [ [[package]] name = "zksync_bellman" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffa03efe9bdb137a4b36b97d1a74237e18c9ae42b755163d903a9d48c1a5d80" +checksum = "6b7c0061db44757522f2d82cad02f45dc98267210ac362071234ed08e30fd4d6" dependencies = [ "arrayvec 0.7.6", "bit-vec", @@ -8241,9 +7949,9 @@ dependencies = [ [[package]] name = "zksync_concurrency" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "035269d811b3770debca372141ab64cad067dce8e58cb39a48cb7617d30c626b" +checksum = "e8312ab73d3caa55775bd531795b507fa8f76bd9dabfaeb0954fe43e8fc1323b" dependencies = [ "anyhow", "once_cell", @@ -8261,17 +7969,12 @@ dependencies = [ [[package]] name = "zksync_config" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", "rand 0.8.5", "secrecy", "serde", - "strum", - "strum_macros", - "time", - "url", - "vise", "zksync_basic_types", "zksync_concurrency", "zksync_consensus_utils", @@ -8280,9 +7983,9 @@ dependencies = [ [[package]] name = "zksync_consensus_utils" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10bac8f471b182d4fa3d40cf158aac3624fe636a1ff0b4cf3fe26a0e20c68a42" +checksum = "723e2a4b056cc5af192a83163c89a6951ee75c098cc5c4a4cdc435f4232d88bd" dependencies = [ "anyhow", "rand 0.8.5", @@ -8293,21 +7996,21 @@ dependencies = [ [[package]] name = "zksync_contracts" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "envy", - "ethabi 18.0.0", "hex", "once_cell", "serde", "serde_json", + "zksync_basic_types", "zksync_utils", ] [[package]] name = "zksync_crypto_primitives" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", "blake2", @@ -8319,26 +8022,13 @@ dependencies = [ "sha2 0.10.8", "thiserror", "zksync_basic_types", - "zksync_utils", -] - -[[package]] -name = "zksync_cs_derive" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5939e2df4288c263c706ff18ac718e984149223ad4289d6d957d767dcfc04c81" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", ] [[package]] name = "zksync_ff" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9524b06780b5e164e84b38840c7c428c739f051f35af6efc4d1285f629ceb88e" +checksum = "e6a500c97d9286f73540c26b63ae33b159bd48fec0c8bd206b4a9b4fe1217b8a" dependencies = [ "byteorder", "hex", @@ -8349,9 +8039,9 @@ dependencies = [ [[package]] name = "zksync_ff_derive" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f91e58e75d65877f09f83bc3dca8f054847ae7ec4f3e64bfa610a557edd8e8e" +checksum = "97bd48f18ebf350623093022d86be2f1ce23af332efa91890b751209aec8617a" dependencies = [ "num-bigint", "num-integer", @@ -8365,7 +8055,7 @@ dependencies = [ [[package]] name = "zksync_mini_merkle_tree" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "once_cell", "zksync_basic_types", @@ -8375,14 +8065,10 @@ dependencies = [ [[package]] name = "zksync_multivm" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", - "circuit_sequencer_api 0.133.1", - "circuit_sequencer_api 0.140.3", - "circuit_sequencer_api 0.141.2", - "circuit_sequencer_api 0.142.2", - "circuit_sequencer_api 0.150.7", + "circuit_sequencer_api", "ethabi 18.0.0", "hex", "itertools 0.10.5", @@ -8394,21 +8080,20 @@ dependencies = [ "zk_evm 0.133.0", "zk_evm 0.140.0", "zk_evm 0.141.0", - "zk_evm 0.150.7", + "zk_evm 0.150.18", "zksync_contracts", "zksync_mini_merkle_tree", "zksync_system_constants", "zksync_types", - "zksync_utils", "zksync_vm2", "zksync_vm_interface", ] [[package]] name = "zksync_pairing" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8412ae5574472fa567a097e183f9a01974b99dd0b5da3bfa1bbe6c57c579aa2" +checksum = "3b91b38db3a3f0f80d8b1f2342c77751ee8d63b746268e5719abbb5dfb150a8c" dependencies = [ "byteorder", "cfg-if", @@ -8419,9 +8104,9 @@ dependencies = [ [[package]] name = "zksync_protobuf" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abd55c64f54cb10967a435422f66ff5880ae14a232b245517c7ce38da32e0cab" +checksum = "e8986ad796f8e00d8999fee72effba1a21bce40f5f877d681ac9cd89a94834d8" dependencies = [ "anyhow", "bit-vec", @@ -8440,9 +8125,9 @@ dependencies = [ [[package]] name = "zksync_protobuf_build" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4121952bcaf711005dd554612fc6e2de9b30cb58088508df87f1d38046ce8ac8" +checksum = "8d870b31995e3acb8e47afeb68ebeeffcf6121e70020e65b3d5d31692115d236" dependencies = [ "anyhow", "heck", @@ -8458,17 +8143,16 @@ dependencies = [ [[package]] name = "zksync_system_constants" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "once_cell", "zksync_basic_types", - "zksync_utils", ] [[package]] name = "zksync_types" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", "bigdecimal", @@ -8495,35 +8179,28 @@ dependencies = [ "zksync_protobuf", "zksync_protobuf_build", "zksync_system_constants", - "zksync_utils", ] [[package]] name = "zksync_utils" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", - "bigdecimal", "futures 0.3.31", - "hex", - "num", "once_cell", "reqwest 0.12.9", - "serde", "serde_json", - "thiserror", + "sha2 0.10.8", "tokio", "tracing", - "zk_evm 0.133.0", - "zksync_basic_types", "zksync_vlog", ] [[package]] name = "zksync_vlog" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", "chrono", @@ -8549,19 +8226,19 @@ dependencies = [ [[package]] name = "zksync_vm2" version = "0.2.1" -source = "git+https://github.com/matter-labs/vm2.git?rev=df5bec3d04d64d434f9b0ccb285ba4681008f7b3#df5bec3d04d64d434f9b0ccb285ba4681008f7b3" +source = "git+https://github.com/matter-labs/vm2.git?rev=457d8a7eea9093af9440662e33e598c13ba41633#457d8a7eea9093af9440662e33e598c13ba41633" dependencies = [ "enum_dispatch", "primitive-types 0.12.2", - "zk_evm_abstractions 0.150.7", - "zkevm_opcode_defs 0.150.7", + "zk_evm_abstractions 0.150.18", + "zkevm_opcode_defs 0.150.18", "zksync_vm2_interface", ] [[package]] name = "zksync_vm2_interface" version = "0.2.1" -source = "git+https://github.com/matter-labs/vm2.git?rev=df5bec3d04d64d434f9b0ccb285ba4681008f7b3#df5bec3d04d64d434f9b0ccb285ba4681008f7b3" +source = "git+https://github.com/matter-labs/vm2.git?rev=457d8a7eea9093af9440662e33e598c13ba41633#457d8a7eea9093af9440662e33e598c13ba41633" dependencies = [ "primitive-types 0.12.2", ] @@ -8569,7 +8246,7 @@ dependencies = [ [[package]] name = "zksync_vm_interface" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", "async-trait", @@ -8586,7 +8263,7 @@ dependencies = [ [[package]] name = "zksync_web3_decl" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", "async-trait", @@ -8632,4 +8309,4 @@ checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", -] \ No newline at end of file +] diff --git a/Cargo.toml b/Cargo.toml index 5ecabfc7..d7df0337 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,12 +26,11 @@ categories = ["cryptography"] ######################### # ZKsync dependencies # ######################### -zksync_multivm = { git = "https://github.com/matter-labs/zksync-era.git", rev = "6c034f6e180cc92e99766f14c8840c90efa56cec" } -zksync_contracts = { git = "https://github.com/matter-labs/zksync-era.git", rev = "6c034f6e180cc92e99766f14c8840c90efa56cec" } -zksync_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "6c034f6e180cc92e99766f14c8840c90efa56cec" } -zksync_utils = { git = "https://github.com/matter-labs/zksync-era.git", rev = "6c034f6e180cc92e99766f14c8840c90efa56cec" } -zksync_vm_interface = { git = "https://github.com/matter-labs/zksync-era.git", rev = "6c034f6e180cc92e99766f14c8840c90efa56cec" } -zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", rev = "6c034f6e180cc92e99766f14c8840c90efa56cec", features = [ +zksync_multivm = { git = "https://github.com/matter-labs/zksync-era.git", rev = "core-v25.4.0" } +zksync_contracts = { git = "https://github.com/matter-labs/zksync-era.git", rev = "core-v25.4.0" } +zksync_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "core-v25.4.0" } +zksync_vm_interface = { git = "https://github.com/matter-labs/zksync-era.git", rev = "core-v25.4.0" } +zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", rev = "core-v25.4.0", features = [ "server", ] } diff --git a/Dockerfile b/Dockerfile index 4320e3c5..578352ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,8 +12,8 @@ ENV RUSTUP_HOME=/usr/local/rustup \ PATH=/usr/local/cargo/bin:$PATH RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \ - rustup install nightly-2024-08-01 && \ - rustup default nightly-2024-08-01 + rustup install stable && \ + rustup default stable WORKDIR /usr/src/anvil-zksync COPY . . diff --git a/Makefile b/Makefile index c6b3e0b9..40a11209 100644 --- a/Makefile +++ b/Makefile @@ -42,9 +42,9 @@ lint: cd e2e-tests-rust && cargo fmt --all -- --check cd spec-tests && cargo fmt --all -- --check cargo fmt --all -- --check - cargo clippy --tests -p anvil-zksync -Zunstable-options -- -D warnings --allow clippy::unwrap_used - cd e2e-tests-rust && cargo clippy --tests -Zunstable-options -- -D warnings --allow clippy::unwrap_used - cd spec-tests && cargo clippy --tests -Zunstable-options -- -D warnings --allow clippy::unwrap_used + cargo clippy --tests -p anvil-zksync -- -D warnings --allow clippy::unwrap_used + cd e2e-tests-rust && cargo clippy --tests -- -D warnings --allow clippy::unwrap_used + cd spec-tests && cargo clippy --tests -- -D warnings --allow clippy::unwrap_used # Fix lint errors for Rust code lint-fix: diff --git a/SUPPORTED_APIS.md b/SUPPORTED_APIS.md index 2f01151e..5832430c 100644 --- a/SUPPORTED_APIS.md +++ b/SUPPORTED_APIS.md @@ -171,6 +171,7 @@ The `status` options are: | `ZKS` | `zks_L1BatchNumber` | `NOT IMPLEMENTED` | Returns the latest L1 batch number | | [`ZKS`](#zks-namespace) | [`zks_L1ChainId`](#zks_l1chainid) | `IMPLEMENTED` | Returns the chain id of the underlying L1 | | `ZKS` | `zks_sendRawTransactionWithDetailedOutput` | `NOT IMPLEMENTED` | Executes a transaction with detailed output | +| `ZKS` | `zks_getTimestampAsserter` | `NOT IMPLEMENTED` | Returns an address of timestamp asserter contract | ## `CONFIG NAMESPACE` diff --git a/crates/api_server/src/impls/eth.rs b/crates/api_server/src/impls/eth.rs index ba3db206..7bea08c9 100644 --- a/crates/api_server/src/impls/eth.rs +++ b/crates/api_server/src/impls/eth.rs @@ -314,7 +314,7 @@ impl EthNamespaceServer for EthNamespace { &self, block_count: U64Number, newest_block: BlockNumber, - reward_percentiles: Vec, + reward_percentiles: Option>, ) -> RpcResult { Ok(self .node diff --git a/crates/api_server/src/impls/zks.rs b/crates/api_server/src/impls/zks.rs index 2fa49250..575d2619 100644 --- a/crates/api_server/src/impls/zks.rs +++ b/crates/api_server/src/impls/zks.rs @@ -208,4 +208,8 @@ impl ZksNamespaceServer for ZksNamespace { ) -> RpcResult { Err(RpcError::Unsupported.into()) } + + async fn get_timestamp_asserter(&self) -> RpcResult> { + Err(RpcError::Unsupported.into()) + } } diff --git a/crates/cli/src/cli.rs b/crates/cli/src/cli.rs index 4159068c..788e718c 100644 --- a/crates/cli/src/cli.rs +++ b/crates/cli/src/cli.rs @@ -541,6 +541,7 @@ impl PeriodicStateDumper { } } + #[allow(dead_code)] // TODO: Remove this once the method is used pub async fn dump(&self) { if let Some(state) = self.dump_state.clone() { Self::dump_state(self.node.clone(), state, self.preserve_historical_states).await diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 118b6092..ae05d588 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -16,7 +16,6 @@ anvil_zksync_config.workspace = true zksync_multivm.workspace = true zksync_contracts.workspace = true zksync_types.workspace = true -zksync_utils.workspace = true zksync_web3_decl.workspace = true anyhow.workspace = true diff --git a/crates/core/src/bootloader_debug.rs b/crates/core/src/bootloader_debug.rs index afc2c31e..97c1995a 100644 --- a/crates/core/src/bootloader_debug.rs +++ b/crates/core/src/bootloader_debug.rs @@ -61,9 +61,8 @@ pub struct BootloaderDebug { /// Fixed amount of gas for each transaction. pub intrinsic_overhead: U256, - /// Closing a block has a non-trivial cost for the operator (they have to run the prover, and commit results to L1). - /// That's why we have to judge how much a given transaction is contributing the operator closer to sealing the block. - + // Closing a block has a non-trivial cost for the operator (they have to run the prover, and commit results to L1). + // That's why we have to judge how much a given transaction is contributing the operator closer to sealing the block. /// The maximum amount that operator could have requested. pub required_overhead: U256, diff --git a/crates/core/src/fork.rs b/crates/core/src/fork.rs index bbbdda41..9f98be2d 100644 --- a/crates/core/src/fork.rs +++ b/crates/core/src/fork.rs @@ -35,10 +35,10 @@ use zksync_types::{ url::SensitiveUrl, ProtocolVersionId, StorageKey, SYSTEM_CONTEXT_CHAIN_ID_POSITION, }; +use zksync_types::{bytecode::BytecodeHash, h256_to_u256}; use zksync_types::{ Address, L1BatchNumber, L2BlockNumber, L2ChainId, StorageValue, H256, U256, U64, }; -use zksync_utils::{bytecode::hash_bytecode, h256_to_u256}; use zksync_web3_decl::{ client::{Client, L2}, namespaces::ZksNamespaceClient, @@ -135,7 +135,7 @@ impl ForkStorage { inner: Arc::new(RwLock::new(ForkStorageInner { raw_storage: InMemoryStorage::with_system_contracts_and_chain_id( chain_id, - hash_bytecode, + |b| BytecodeHash::for_bytecode(b).value(), system_contracts_options, use_evm_emulator, ), diff --git a/crates/core/src/node/eth.rs b/crates/core/src/node/eth.rs index d8f24a7c..a1bb4690 100644 --- a/crates/core/src/node/eth.rs +++ b/crates/core/src/node/eth.rs @@ -13,11 +13,11 @@ use zksync_types::{ utils::storage_key_for_standard_token_balance, PackedEthSignature, StorageKey, L2_BASE_TOKEN_ADDRESS, MAX_L1_TRANSACTION_GAS_LIMIT, }; +use zksync_types::{h256_to_u256, u256_to_h256}; use zksync_types::{ web3::{self, Bytes}, AccountTreeId, Address, H160, H256, U256, U64, }; -use zksync_utils::{h256_to_u256, u256_to_h256}; use zksync_web3_decl::{ error::Web3Error, types::{FeeHistory, Filter, FilterChanges, SyncState}, @@ -396,8 +396,9 @@ impl InMemoryNode { gas: Default::default(), input: input_data.data.into(), v: Some(chain_id.into()), - r: Some(U256::zero()), - s: Some(U256::zero()), + r: Some(U256::zero()), // TODO: Shouldn't we set the signature? + s: Some(U256::zero()), // TODO: Shouldn't we set the signature? + y_parity: Some(U64::zero()), // TODO: Shouldn't we set the signature? raw: None, transaction_type: { let tx_type = match info.tx.common_data.transaction_type { @@ -838,7 +839,7 @@ impl InMemoryNode { block_count: u64, // TODO: Support _newest_block: BlockNumber, - reward_percentiles: Vec, + reward_percentiles: Option>, ) -> anyhow::Result { let reader = self.read_inner()?; @@ -855,7 +856,10 @@ impl InMemoryNode { let gas_used_ratio = vec![0.0; base_fee_per_gas.len()]; // Effective priority gas price is currently 0. let reward = Some(vec![ - vec![U256::zero(); reward_percentiles.len()]; + vec![ + U256::zero(); + reward_percentiles.map_or(0, |v| v.len()) + ]; base_fee_per_gas.len() ]); @@ -924,7 +928,7 @@ mod tests { let node = InMemoryNode::default(); let fee_history = node - .fee_history_impl(1, BlockNumber::Latest, vec![25.0, 50.0, 75.0]) + .fee_history_impl(1, BlockNumber::Latest, Some(vec![25.0, 50.0, 75.0])) .await .expect("fee_history failed") .inner; @@ -946,7 +950,7 @@ mod tests { let node = InMemoryNode::default(); let fee_history = node - .fee_history_impl(1, BlockNumber::Latest, vec![]) + .fee_history_impl(1, BlockNumber::Latest, Some(vec![])) .await .expect("fee_history failed") .inner; @@ -975,7 +979,7 @@ mod tests { .await .expect("Block number fetch failed"); let fee_history = node - .fee_history_impl(2, BlockNumber::Latest, vec![25.0, 50.0, 75.0]) + .fee_history_impl(2, BlockNumber::Latest, Some(vec![25.0, 50.0, 75.0])) .await .expect("fee_history failed") .inner; @@ -1271,9 +1275,10 @@ mod tests { gas_price: Some(tx.common_data.fee.max_fee_per_gas), gas: tx.common_data.fee.gas_limit, input: Default::default(), - v: actual_tx.v, // Checked separately, see below - r: actual_tx.r, // Checked separately, see below - s: actual_tx.s, // Checked separately, see below + v: actual_tx.v, // Checked separately, see below + r: actual_tx.r, // Checked separately, see below + s: actual_tx.s, // Checked separately, see below + y_parity: actual_tx.y_parity, // Checked separately, see below raw: None, transaction_type: Some(U64::from(TransactionType::EIP712Transaction as u32)), access_list: None, diff --git a/crates/core/src/node/in_memory.rs b/crates/core/src/node/in_memory.rs index cc346fed..e01e4961 100644 --- a/crates/core/src/node/in_memory.rs +++ b/crates/core/src/node/in_memory.rs @@ -64,6 +64,7 @@ use zksync_multivm::{ }, HistoryMode, VmVersion, }; +use zksync_types::bytecode::BytecodeHash; use zksync_types::transaction_request::CallRequest; use zksync_types::{ api::{Block, DebugCall, Log, TransactionReceipt, TransactionVariant}, @@ -79,7 +80,7 @@ use zksync_types::{ H256, H64, MAX_L2_TX_GAS_LIMIT, SYSTEM_CONTEXT_ADDRESS, SYSTEM_CONTEXT_BLOCK_INFO_POSITION, U256, U64, }; -use zksync_utils::{bytecode::hash_bytecode, h256_to_account_address, h256_to_u256, u256_to_h256}; +use zksync_types::{h256_to_address, h256_to_u256, u256_to_h256}; use zksync_web3_decl::error::Web3Error; /// Max possible size of an ABI encoded tx (in bytes). @@ -1094,7 +1095,7 @@ pub struct InMemoryNode { fn contract_address_from_tx_result(execution_result: &VmExecutionResultAndLogs) -> Option { for query in execution_result.logs.storage_logs.iter().rev() { if query.log.is_write() && query.log.key.address() == &ACCOUNT_CODE_STORAGE_ADDRESS { - return Some(h256_to_account_address(query.log.key.key())); + return Some(h256_to_address(query.log.key.key())); } } None @@ -1938,7 +1939,7 @@ impl InMemoryNode { let code_key = get_code_key(address); - let bytecode_hash = hash_bytecode(bytecode); + let bytecode_hash = BytecodeHash::for_bytecode(bytecode).value(); inner .fork_storage diff --git a/crates/core/src/node/in_memory_ext.rs b/crates/core/src/node/in_memory_ext.rs index 21696c84..2cd59dea 100644 --- a/crates/core/src/node/in_memory_ext.rs +++ b/crates/core/src/node/in_memory_ext.rs @@ -6,13 +6,13 @@ use anyhow::anyhow; use std::time::Duration; use zksync_multivm::interface::TxExecutionMode; use zksync_types::api::{Block, TransactionVariant}; +use zksync_types::u256_to_h256; use zksync_types::{ get_code_key, get_nonce_key, utils::{nonces_to_full_nonce, storage_key_for_eth_balance}, L2BlockNumber, StorageKey, }; use zksync_types::{AccountTreeId, Address, H256, U256, U64}; -use zksync_utils::u256_to_h256; type Result = anyhow::Result; @@ -503,8 +503,7 @@ mod tests { use std::sync::{Arc, RwLock}; use zksync_multivm::interface::storage::ReadStorage; use zksync_types::{api::BlockNumber, fee::Fee, l2::L2Tx, PackedEthSignature}; - use zksync_types::{L2ChainId, Nonce, H256}; - use zksync_utils::h256_to_u256; + use zksync_types::{h256_to_u256, L2ChainId, Nonce, H256}; #[tokio::test] async fn test_set_balance() { @@ -799,7 +798,7 @@ mod tests { let expected_response = increase_value_seconds; let actual_response = node - .increase_time(increase_value_seconds.into()) + .increase_time(increase_value_seconds) .expect("failed increasing timestamp"); let timestamp_after = node.time.current_timestamp(); @@ -821,7 +820,7 @@ mod tests { let expected_response = increase_value_seconds; let actual_response = node - .increase_time(increase_value_seconds.into()) + .increase_time(increase_value_seconds) .expect("failed increasing timestamp"); let timestamp_after = node.time.current_timestamp(); @@ -842,7 +841,7 @@ mod tests { let expected_response = increase_value_seconds; let actual_response = node - .increase_time(increase_value_seconds.into()) + .increase_time(increase_value_seconds) .expect("failed increasing timestamp"); let timestamp_after = node.time.current_timestamp(); @@ -865,7 +864,7 @@ mod tests { "timestamps must be different" ); - node.set_next_block_timestamp(new_timestamp.into()) + node.set_next_block_timestamp(new_timestamp) .expect("failed setting timestamp"); node.mine_block().expect("failed to mine a block"); let timestamp_after = node.time.current_timestamp(); @@ -883,12 +882,12 @@ mod tests { let timestamp_before = node.time.current_timestamp(); let new_timestamp = timestamp_before + 500; - node.set_next_block_timestamp(new_timestamp.into()) + node.set_next_block_timestamp(new_timestamp) .expect("failed setting timestamp"); node.mine_block().expect("failed to mine a block"); - let result = node.set_next_block_timestamp(timestamp_before.into()); + let result = node.set_next_block_timestamp(timestamp_before); assert!(result.is_err(), "expected an error for timestamp in past"); } @@ -901,7 +900,7 @@ mod tests { let timestamp_before = node.time.current_timestamp(); assert_eq!(timestamp_before, new_timestamp, "timestamps must be same"); - let response = node.set_next_block_timestamp(new_timestamp.into()); + let response = node.set_next_block_timestamp(new_timestamp); assert!(response.is_err()); let timestamp_after = node.time.current_timestamp(); @@ -920,9 +919,7 @@ mod tests { assert_ne!(timestamp_before, new_time, "timestamps must be different"); let expected_response = 9000; - let actual_response = node - .set_time(new_time.into()) - .expect("failed setting timestamp"); + let actual_response = node.set_time(new_time).expect("failed setting timestamp"); let timestamp_after = node.time.current_timestamp(); assert_eq!(expected_response, actual_response, "erroneous response"); @@ -938,9 +935,7 @@ mod tests { assert_ne!(timestamp_before, new_time, "timestamps must be different"); let expected_response = -990; - let actual_response = node - .set_time(new_time.into()) - .expect("failed setting timestamp"); + let actual_response = node.set_time(new_time).expect("failed setting timestamp"); let timestamp_after = node.time.current_timestamp(); assert_eq!(expected_response, actual_response, "erroneous response"); @@ -956,9 +951,7 @@ mod tests { assert_eq!(timestamp_before, new_time, "timestamps must be same"); let expected_response = 0; - let actual_response = node - .set_time(new_time.into()) - .expect("failed setting timestamp"); + let actual_response = node.set_time(new_time).expect("failed setting timestamp"); let timestamp_after = node.time.current_timestamp(); assert_eq!(expected_response, actual_response, "erroneous response"); @@ -980,9 +973,7 @@ mod tests { ); let expected_response = (new_time as i128).saturating_sub(timestamp_before as i128); - let actual_response = node - .set_time(new_time.into()) - .expect("failed setting timestamp"); + let actual_response = node.set_time(new_time).expect("failed setting timestamp"); let timestamp_after = node.time.current_timestamp(); assert_eq!( diff --git a/crates/core/src/node/storage_logs.rs b/crates/core/src/node/storage_logs.rs index 27c9131d..6e0ecc56 100644 --- a/crates/core/src/node/storage_logs.rs +++ b/crates/core/src/node/storage_logs.rs @@ -4,6 +4,7 @@ use crate::formatter::{self, PubdataBytesInfo}; use anvil_zksync_types::ShowStorageLogs; use zksync_multivm::interface::VmExecutionResultAndLogs; +use zksync_types::h256_to_u256; use zksync_types::{ utils::storage_key_for_eth_balance, writes::{ @@ -13,7 +14,6 @@ use zksync_types::{ StorageKey, BOOTLOADER_ADDRESS, SYSTEM_CONTEXT_ADDRESS, }; use zksync_types::{StorageLogKind, StorageLogWithPreviousValue}; -use zksync_utils::h256_to_u256; fn is_storage_key_free(key: &StorageKey) -> bool { key.address() == &SYSTEM_CONTEXT_ADDRESS diff --git a/crates/core/src/node/zks.rs b/crates/core/src/node/zks.rs index dea40bd7..42f25238 100644 --- a/crates/core/src/node/zks.rs +++ b/crates/core/src/node/zks.rs @@ -6,13 +6,13 @@ use zksync_types::api::{ TransactionStatus, TransactionVariant, }; use zksync_types::fee::Fee; +use zksync_types::h256_to_u256; use zksync_types::transaction_request::CallRequest; use zksync_types::utils::storage_key_for_standard_token_balance; use zksync_types::{ AccountTreeId, Address, ExecuteTransactionCommon, L1BatchNumber, L2BlockNumber, ProtocolVersionId, Transaction, H160, H256, L2_BASE_TOKEN_ADDRESS, U256, }; -use zksync_utils::h256_to_u256; use zksync_web3_decl::error::Web3Error; impl InMemoryNode { @@ -198,10 +198,13 @@ impl InMemoryNode { root_hash: Some(block.hash), status: BlockStatus::Verified, commit_tx_hash: None, + commit_chain_id: None, committed_at: None, prove_tx_hash: None, + prove_chain_id: None, proven_at: None, execute_tx_hash: None, + execute_chain_id: None, executed_at: None, l1_gas_price: 0, l2_fair_gas_price: reader.fee_input_provider.gas_price(), @@ -319,12 +322,12 @@ mod tests { use std::str::FromStr; use anvil_zksync_config::types::CacheConfig; + use zksync_types::u256_to_h256; use zksync_types::{ api::{self, Block, TransactionReceipt, TransactionVariant}, transaction_request::CallRequest, Address, H160, H256, }; - use zksync_utils::u256_to_h256; use super::*; use crate::{ diff --git a/crates/core/src/system_contracts.rs b/crates/core/src/system_contracts.rs index d7c9b0cb..c628cb84 100644 --- a/crates/core/src/system_contracts.rs +++ b/crates/core/src/system_contracts.rs @@ -5,7 +5,7 @@ use zksync_contracts::{ BaseSystemContractsHashes, ContractLanguage, SystemContractCode, }; use zksync_multivm::interface::TxExecutionMode; -use zksync_utils::{bytecode::hash_bytecode, bytes_to_be_words}; +use zksync_types::bytecode::BytecodeHash; /// Holds the system contracts (and bootloader) that are used by the in-memory node. #[derive(Debug, Clone)] @@ -84,11 +84,11 @@ fn bsc_load_with_bootloader( options: &SystemContractsOptions, use_evm_emulator: bool, ) -> BaseSystemContracts { - let hash = hash_bytecode(&bootloader_bytecode); + let hash = BytecodeHash::for_bytecode(&bootloader_bytecode); let bootloader = SystemContractCode { - code: bytes_to_be_words(bootloader_bytecode), - hash, + code: bootloader_bytecode, + hash: hash.value(), }; let aa_bytecode = match options { @@ -105,10 +105,10 @@ fn bsc_load_with_bootloader( ), }; - let aa_hash = hash_bytecode(&aa_bytecode); + let aa_hash = BytecodeHash::for_bytecode(&aa_bytecode); let default_aa = SystemContractCode { - code: bytes_to_be_words(aa_bytecode), - hash: aa_hash, + code: aa_bytecode, + hash: aa_hash.value(), }; let evm_emulator = if use_evm_emulator { @@ -120,10 +120,10 @@ fn bsc_load_with_bootloader( panic!("no built-in EVM emulator yet") } }; - let evm_emulator_hash = hash_bytecode(&evm_emulator_bytecode); + let evm_emulator_hash = BytecodeHash::for_bytecode(&evm_emulator_bytecode); Some(SystemContractCode { - code: bytes_to_be_words(evm_emulator_bytecode), - hash: evm_emulator_hash, + code: evm_emulator_bytecode, + hash: evm_emulator_hash.value(), }) } else { None diff --git a/crates/core/src/testing.rs b/crates/core/src/testing.rs index d4cdced5..d51875e2 100644 --- a/crates/core/src/testing.rs +++ b/crates/core/src/testing.rs @@ -23,10 +23,10 @@ use zksync_types::api::{ BlockDetailsBase, BlockIdVariant, BlockStatus, BridgeAddresses, DebugCall, DebugCallType, Log, }; use zksync_types::block::pack_block_info; +use zksync_types::u256_to_h256; use zksync_types::{fee::Fee, l2::L2Tx, Address, L2ChainId, Nonce, ProtocolVersionId, H256, U256}; use zksync_types::{AccountTreeId, L1BatchNumber, L2BlockNumber, H160, U64}; use zksync_types::{K256PrivateKey, StorageKey}; -use zksync_utils::u256_to_h256; /// Configuration for the [MockServer]'s initial block. #[derive(Default, Debug, Clone)] @@ -821,10 +821,13 @@ impl ForkSource for ExternalStorage { status: BlockStatus::Sealed, commit_tx_hash: None, committed_at: None, + commit_chain_id: None, prove_tx_hash: None, proven_at: None, + prove_chain_id: None, execute_tx_hash: None, executed_at: None, + execute_chain_id: None, l1_gas_price: 123, l2_fair_gas_price: 234, fair_pubdata_price: Some(345), @@ -882,7 +885,7 @@ impl ForkSource for ExternalStorage { mod test { use maplit::hashmap; use zksync_types::block::unpack_block_info; - use zksync_utils::h256_to_u256; + use zksync_types::h256_to_u256; use super::*; diff --git a/crates/core/src/utils.rs b/crates/core/src/utils.rs index 57403ca6..ba04a5e3 100644 --- a/crates/core/src/utils.rs +++ b/crates/core/src/utils.rs @@ -14,9 +14,17 @@ use zksync_types::{ web3::Bytes, CONTRACT_DEPLOYER_ADDRESS, H256, U256, U64, }; -use zksync_utils::bytes_to_be_words; use zksync_web3_decl::error::Web3Error; +pub(crate) fn bytes_to_be_words(bytes: &[u8]) -> Vec { + assert_eq!( + bytes.len() % 32, + 0, + "Bytes must be divisible by 32 to split into chunks" + ); + bytes.chunks(32).map(U256::from_big_endian).collect() +} + /// Takes long integers and returns them in human friendly format with "_". /// For example: 12_334_093 pub fn to_human_size(input: U256) -> String { @@ -36,12 +44,17 @@ pub fn to_human_size(input: U256) -> String { tmp.iter().rev().collect() } +// TODO: Approach to encoding bytecode has changed in the core, so this function is likely no +// longer needed. See `zksync_contracts::SystemContractCode` for general approach. +// +// Use of `bytecode_to_factory_dep` needs to be refactored and vendored `bytes_to_be_words` +// should be removed. pub fn bytecode_to_factory_dep(bytecode: Vec) -> Result<(U256, Vec), anyhow::Error> { - zksync_utils::bytecode::validate_bytecode(&bytecode).context("Invalid bytecode")?; - let bytecode_hash = zksync_utils::bytecode::hash_bytecode(&bytecode); + zksync_types::bytecode::validate_bytecode(&bytecode).context("Invalid bytecode")?; + let bytecode_hash = zksync_types::bytecode::BytecodeHash::for_bytecode(&bytecode).value(); let bytecode_hash = U256::from_big_endian(bytecode_hash.as_bytes()); - let bytecode_words = bytes_to_be_words(bytecode); + let bytecode_words = bytes_to_be_words(&bytecode); Ok((bytecode_hash, bytecode_words)) } diff --git a/e2e-tests-rust/Cargo.lock b/e2e-tests-rust/Cargo.lock index aa9071b1..cdbf102e 100644 --- a/e2e-tests-rust/Cargo.lock +++ b/e2e-tests-rust/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -1006,7 +1006,6 @@ dependencies = [ "zksync_contracts", "zksync_multivm", "zksync_types", - "zksync_utils", "zksync_web3_decl", ] @@ -1390,15 +1389,6 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - [[package]] name = "bindgen" version = "0.69.5" @@ -1542,37 +1532,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "boojum" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ec2f007ff8f90cc459f03e9f30ca1065440170f013c868823646e2e48d0234" -dependencies = [ - "arrayvec 0.7.6", - "bincode", - "blake2", - "const_format", - "convert_case", - "crossbeam", - "crypto-bigint 0.5.5", - "derivative", - "ethereum-types 0.14.1", - "firestorm", - "itertools 0.10.5", - "lazy_static", - "num-modular", - "num_cpus", - "rand 0.8.5", - "rayon", - "serde", - "sha2", - "sha3_ce", - "smallvec", - "unroll", - "zksync_cs_derive", - "zksync_pairing", -] - [[package]] name = "bs58" version = "0.5.1" @@ -1672,119 +1631,16 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "circuit_encodings" -version = "0.140.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf6b7cc842eadb4c250cdc6a8bc1dd97624d9f08bbe54db3e11fb23c3a72be07" -dependencies = [ - "derivative", - "serde", - "zk_evm 0.140.0", - "zkevm_circuits 0.140.3", -] - -[[package]] -name = "circuit_encodings" -version = "0.141.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7898ffbf3cd413576b4b674fe1545a35488c67eb16bd5a4148425e42c2a2b65b" -dependencies = [ - "derivative", - "serde", - "zk_evm 0.141.0", - "zkevm_circuits 0.141.2", -] - -[[package]] -name = "circuit_encodings" -version = "0.142.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8364ecafcc4b2c896023f8d3af952c52a500aa55f14fd268bb5d9ab07f837369" -dependencies = [ - "derivative", - "serde", - "zk_evm 0.141.0", - "zkevm_circuits 0.141.2", -] - -[[package]] -name = "circuit_encodings" -version = "0.150.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2501cc688ef391013019495ae7035cfd54f86987e36d10f73976ce4c5d413c5a" -dependencies = [ - "derivative", - "serde", - "zk_evm 0.150.7", - "zkevm_circuits 0.150.7", -] - [[package]] name = "circuit_sequencer_api" -version = "0.133.1" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb959b1f8c6bbd8be711994d182e85452a26a5d2213a709290b71c8262af1331" +checksum = "d13ed70909e8390a4f2599d5a76d9ac4189e5bbbf16146d11b7999788740f291" dependencies = [ "derivative", "rayon", "serde", - "zk_evm 0.133.0", - "zksync_bellman", -] - -[[package]] -name = "circuit_sequencer_api" -version = "0.140.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa5f22311ce609d852d7d9f4943535ea4610aeb785129ae6ff83d5201c4fb387" -dependencies = [ - "circuit_encodings 0.140.3", - "derivative", - "rayon", - "serde", - "zk_evm 0.140.0", - "zksync_bellman", -] - -[[package]] -name = "circuit_sequencer_api" -version = "0.141.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c47c71d6ba83a8beb0af13af70beffd627f5497caf3d44c6f96363e788b07ea" -dependencies = [ - "circuit_encodings 0.141.2", - "derivative", - "rayon", - "serde", - "zk_evm 0.141.0", - "zksync_bellman", -] - -[[package]] -name = "circuit_sequencer_api" -version = "0.142.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e264723359e6a1aad98110bdccf1ae3ad596e93e7d31da9e40f6adc07e4add54" -dependencies = [ - "circuit_encodings 0.142.2", - "derivative", - "rayon", - "serde", - "zk_evm 0.141.0", - "zksync_bellman", -] - -[[package]] -name = "circuit_sequencer_api" -version = "0.150.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917d27db531fdd98a51e42ea465bc097f48cc849e7fad68d7856087d15125be1" -dependencies = [ - "circuit_encodings 0.150.7", - "derivative", - "rayon", - "serde", + "zk_evm 0.150.18", "zksync_bellman", ] @@ -1931,6 +1787,15 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bed69047ed42e52c7e38d6421eeb8ceefb4f2a2b52eed59137f7bad7908f6800" +[[package]] +name = "const-decoder" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b381abde2cdc1bc3817e394b24e05667a2dc89f37570cbd34d9c397d99e56e3f" +dependencies = [ + "compile-fmt", +] + [[package]] name = "const-hex" version = "1.14.0" @@ -1950,41 +1815,12 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "const_format" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - [[package]] name = "constant_time_eq" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "core-foundation" version = "0.9.4" @@ -2218,7 +2054,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", - "serde", ] [[package]] @@ -2581,12 +2416,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "firestorm" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c5f6c2c942da57e2aaaa84b8a521489486f14e75e7fa91dab70aba913975f98" - [[package]] name = "fixed-hash" version = "0.7.0" @@ -4078,16 +3907,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-modular" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a5fe11d4135c3bcdf3a95b18b194afa9608a5f6ff034f5d857bc9a27fb0119" -dependencies = [ - "num-integer", - "num-traits", -] - [[package]] name = "num-rational" version = "0.4.2" @@ -4670,30 +4489,6 @@ dependencies = [ "toml_edit 0.22.22", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -5707,12 +5502,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "seq-macro" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" - [[package]] name = "serde" version = "1.0.215" @@ -6672,12 +6461,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" -[[package]] -name = "unicode-segmentation" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - [[package]] name = "unicode-width" version = "0.1.14" @@ -6690,16 +6473,6 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" -[[package]] -name = "unroll" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad948c1cb799b1a70f836077721a92a35ac177d4daddf4c20a633786d4cf618" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "unsafe-libyaml" version = "0.2.11" @@ -7462,9 +7235,9 @@ dependencies = [ [[package]] name = "zk_evm" -version = "0.150.7" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cc74fbe2b45fd19e95c59ea792c795feebdb616ebaa463f0ac567f495f47387" +checksum = "3278d0f75408ab35d25998e1124124cd108b48b2a81ed8e71e892ddc5a6be0aa" dependencies = [ "anyhow", "lazy_static", @@ -7472,7 +7245,7 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "zk_evm_abstractions 0.150.7", + "zk_evm_abstractions 0.150.18", ] [[package]] @@ -7503,79 +7276,15 @@ dependencies = [ [[package]] name = "zk_evm_abstractions" -version = "0.150.7" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37f333a3b059899df09e40deb041af881bc03e496fda5eec618ffb5e854ee7df" +checksum = "88b4e5a89cfe1594b6476be16c8c1d45f22ce12bff31c49e077b381a398edd8a" dependencies = [ "anyhow", "num_enum 0.6.1", "serde", "static_assertions", - "zkevm_opcode_defs 0.150.7", -] - -[[package]] -name = "zkevm_circuits" -version = "0.140.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c365c801e0c6eda83fbd153df45575172beb406bfb663d386f9154b4325eda" -dependencies = [ - "arrayvec 0.7.6", - "bincode", - "boojum", - "derivative", - "hex", - "itertools 0.10.5", - "rand 0.4.6", - "rand 0.8.5", - "seq-macro", - "serde", - "serde_json", - "smallvec", - "zkevm_opcode_defs 0.132.0", - "zksync_cs_derive", -] - -[[package]] -name = "zkevm_circuits" -version = "0.141.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ccd0352e122a4e6f0046d2163b7e692e627b23fc3264faa77331a21b65833fd" -dependencies = [ - "arrayvec 0.7.6", - "bincode", - "boojum", - "derivative", - "hex", - "itertools 0.10.5", - "rand 0.4.6", - "rand 0.8.5", - "seq-macro", - "serde", - "serde_json", - "smallvec", - "zkevm_opcode_defs 0.141.0", - "zksync_cs_derive", -] - -[[package]] -name = "zkevm_circuits" -version = "0.150.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06fb35b00699d25175a2ad447f86a9088af8b0bc698bb57086fb04c13e52eab" -dependencies = [ - "arrayvec 0.7.6", - "boojum", - "derivative", - "hex", - "itertools 0.10.5", - "rand 0.4.6", - "rand 0.8.5", - "seq-macro", - "serde", - "smallvec", - "zkevm_opcode_defs 0.150.7", - "zksync_cs_derive", + "zkevm_opcode_defs 0.150.18", ] [[package]] @@ -7622,9 +7331,9 @@ dependencies = [ [[package]] name = "zkevm_opcode_defs" -version = "0.150.7" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b83f3b279248af4ca86dec20a54127f02110b45570f3f6c1d13df49ba75c28a5" +checksum = "5bad437d4891536fdcc0054a3f04562c408817ff19d83b6c27569217692e6e74" dependencies = [ "bitflags 2.6.0", "blake2", @@ -7640,10 +7349,11 @@ dependencies = [ [[package]] name = "zksync_basic_types" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", "chrono", + "const-decoder", "ethabi 18.0.0", "hex", "num_enum 0.7.3", @@ -7651,6 +7361,7 @@ dependencies = [ "serde", "serde_json", "serde_with", + "sha2", "strum", "thiserror 1.0.69", "tiny-keccak 2.0.2", @@ -7659,9 +7370,9 @@ dependencies = [ [[package]] name = "zksync_bellman" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffa03efe9bdb137a4b36b97d1a74237e18c9ae42b755163d903a9d48c1a5d80" +checksum = "6b7c0061db44757522f2d82cad02f45dc98267210ac362071234ed08e30fd4d6" dependencies = [ "arrayvec 0.7.6", "bit-vec", @@ -7682,9 +7393,9 @@ dependencies = [ [[package]] name = "zksync_concurrency" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "035269d811b3770debca372141ab64cad067dce8e58cb39a48cb7617d30c626b" +checksum = "e8312ab73d3caa55775bd531795b507fa8f76bd9dabfaeb0954fe43e8fc1323b" dependencies = [ "anyhow", "once_cell", @@ -7702,17 +7413,12 @@ dependencies = [ [[package]] name = "zksync_config" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", "rand 0.8.5", "secrecy", "serde", - "strum", - "strum_macros", - "time", - "url", - "vise", "zksync_basic_types", "zksync_concurrency", "zksync_consensus_utils", @@ -7721,9 +7427,9 @@ dependencies = [ [[package]] name = "zksync_consensus_utils" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10bac8f471b182d4fa3d40cf158aac3624fe636a1ff0b4cf3fe26a0e20c68a42" +checksum = "723e2a4b056cc5af192a83163c89a6951ee75c098cc5c4a4cdc435f4232d88bd" dependencies = [ "anyhow", "rand 0.8.5", @@ -7734,21 +7440,21 @@ dependencies = [ [[package]] name = "zksync_contracts" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "envy", - "ethabi 18.0.0", "hex", "once_cell", "serde", "serde_json", + "zksync_basic_types", "zksync_utils", ] [[package]] name = "zksync_crypto_primitives" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", "blake2", @@ -7760,26 +7466,13 @@ dependencies = [ "sha2", "thiserror 1.0.69", "zksync_basic_types", - "zksync_utils", -] - -[[package]] -name = "zksync_cs_derive" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5939e2df4288c263c706ff18ac718e984149223ad4289d6d957d767dcfc04c81" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", ] [[package]] name = "zksync_ff" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9524b06780b5e164e84b38840c7c428c739f051f35af6efc4d1285f629ceb88e" +checksum = "e6a500c97d9286f73540c26b63ae33b159bd48fec0c8bd206b4a9b4fe1217b8a" dependencies = [ "byteorder", "hex", @@ -7790,9 +7483,9 @@ dependencies = [ [[package]] name = "zksync_ff_derive" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f91e58e75d65877f09f83bc3dca8f054847ae7ec4f3e64bfa610a557edd8e8e" +checksum = "97bd48f18ebf350623093022d86be2f1ce23af332efa91890b751209aec8617a" dependencies = [ "num-bigint", "num-integer", @@ -7806,7 +7499,7 @@ dependencies = [ [[package]] name = "zksync_mini_merkle_tree" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "once_cell", "zksync_basic_types", @@ -7816,14 +7509,10 @@ dependencies = [ [[package]] name = "zksync_multivm" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", - "circuit_sequencer_api 0.133.1", - "circuit_sequencer_api 0.140.3", - "circuit_sequencer_api 0.141.2", - "circuit_sequencer_api 0.142.2", - "circuit_sequencer_api 0.150.7", + "circuit_sequencer_api", "ethabi 18.0.0", "hex", "itertools 0.10.5", @@ -7835,21 +7524,20 @@ dependencies = [ "zk_evm 0.133.0", "zk_evm 0.140.0", "zk_evm 0.141.0", - "zk_evm 0.150.7", + "zk_evm 0.150.18", "zksync_contracts", "zksync_mini_merkle_tree", "zksync_system_constants", "zksync_types", - "zksync_utils", "zksync_vm2", "zksync_vm_interface", ] [[package]] name = "zksync_pairing" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8412ae5574472fa567a097e183f9a01974b99dd0b5da3bfa1bbe6c57c579aa2" +checksum = "3b91b38db3a3f0f80d8b1f2342c77751ee8d63b746268e5719abbb5dfb150a8c" dependencies = [ "byteorder", "cfg-if", @@ -7860,9 +7548,9 @@ dependencies = [ [[package]] name = "zksync_protobuf" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abd55c64f54cb10967a435422f66ff5880ae14a232b245517c7ce38da32e0cab" +checksum = "e8986ad796f8e00d8999fee72effba1a21bce40f5f877d681ac9cd89a94834d8" dependencies = [ "anyhow", "bit-vec", @@ -7881,9 +7569,9 @@ dependencies = [ [[package]] name = "zksync_protobuf_build" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4121952bcaf711005dd554612fc6e2de9b30cb58088508df87f1d38046ce8ac8" +checksum = "8d870b31995e3acb8e47afeb68ebeeffcf6121e70020e65b3d5d31692115d236" dependencies = [ "anyhow", "heck", @@ -7899,17 +7587,16 @@ dependencies = [ [[package]] name = "zksync_system_constants" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "once_cell", "zksync_basic_types", - "zksync_utils", ] [[package]] name = "zksync_types" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", "bigdecimal", @@ -7936,35 +7623,28 @@ dependencies = [ "zksync_protobuf", "zksync_protobuf_build", "zksync_system_constants", - "zksync_utils", ] [[package]] name = "zksync_utils" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", - "bigdecimal", "futures 0.3.31", - "hex", - "num", "once_cell", "reqwest 0.12.9", - "serde", "serde_json", - "thiserror 1.0.69", + "sha2", "tokio", "tracing", - "zk_evm 0.133.0", - "zksync_basic_types", "zksync_vlog", ] [[package]] name = "zksync_vlog" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", "chrono", @@ -7990,19 +7670,19 @@ dependencies = [ [[package]] name = "zksync_vm2" version = "0.2.1" -source = "git+https://github.com/matter-labs/vm2.git?rev=df5bec3d04d64d434f9b0ccb285ba4681008f7b3#df5bec3d04d64d434f9b0ccb285ba4681008f7b3" +source = "git+https://github.com/matter-labs/vm2.git?rev=457d8a7eea9093af9440662e33e598c13ba41633#457d8a7eea9093af9440662e33e598c13ba41633" dependencies = [ "enum_dispatch", "primitive-types 0.12.2", - "zk_evm_abstractions 0.150.7", - "zkevm_opcode_defs 0.150.7", + "zk_evm_abstractions 0.150.18", + "zkevm_opcode_defs 0.150.18", "zksync_vm2_interface", ] [[package]] name = "zksync_vm2_interface" version = "0.2.1" -source = "git+https://github.com/matter-labs/vm2.git?rev=df5bec3d04d64d434f9b0ccb285ba4681008f7b3#df5bec3d04d64d434f9b0ccb285ba4681008f7b3" +source = "git+https://github.com/matter-labs/vm2.git?rev=457d8a7eea9093af9440662e33e598c13ba41633#457d8a7eea9093af9440662e33e598c13ba41633" dependencies = [ "primitive-types 0.12.2", ] @@ -8010,7 +7690,7 @@ dependencies = [ [[package]] name = "zksync_vm_interface" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", "async-trait", @@ -8027,7 +7707,7 @@ dependencies = [ [[package]] name = "zksync_web3_decl" version = "0.1.0" -source = "git+https://github.com/matter-labs/zksync-era.git?rev=6c034f6e180cc92e99766f14c8840c90efa56cec#6c034f6e180cc92e99766f14c8840c90efa56cec" +source = "git+https://github.com/matter-labs/zksync-era.git?rev=core-v25.4.0#3ce7e8a6f695c8a04e718a4953ac919319f9572d" dependencies = [ "anyhow", "async-trait", diff --git a/e2e-tests-rust/src/utils.rs b/e2e-tests-rust/src/utils.rs index 2a62bd53..64bf62e6 100644 --- a/e2e-tests-rust/src/utils.rs +++ b/e2e-tests-rust/src/utils.rs @@ -49,6 +49,7 @@ impl LockedPort { /// Acquire the requested port and lock it (meaning no other competing callers of this method /// can take this lock). Lock lasts until the returned `LockedPort` instance is dropped. + #[allow(dead_code)] // TODO: Is it needed? pub async fn acquire(port: u16) -> anyhow::Result { let port = Self::check_port_is_unused(port).await?; let lockpath = std::env::temp_dir().join(format!("anvil-zksync-port{}.lock", port)); diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 9d2c847f..73cb934d 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-08-01" -components = ["rustfmt", "clippy"] \ No newline at end of file +channel = "stable" +components = ["rustfmt", "clippy"]