diff --git a/Cargo.lock b/Cargo.lock index 442802faea3a..019e2afdf334 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1289,9 +1289,9 @@ dependencies = [ [[package]] name = "boojum" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ec2f007ff8f90cc459f03e9f30ca1065440170f013c868823646e2e48d0234" +checksum = "4337dc7b196fc3e5e55e2857bc21638b7441429ee1a953201a9cd2be187b764e" dependencies = [ "arrayvec 0.7.6", "bincode", @@ -1690,117 +1690,26 @@ dependencies = [ [[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 = "e3dcfcb4aaa17e6a81ebd2db688d980aff50aa643d9b506d4d11c84976dbc03f" 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", + "zk_evm 0.150.18", + "zkevm_circuits", ] [[package]] name = "circuit_sequencer_api" -version = "0.150.7" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917d27db531fdd98a51e42ea465bc097f48cc849e7fad68d7856087d15125be1" +checksum = "d13ed70909e8390a4f2599d5a76d9ac4189e5bbbf16146d11b7999788740f291" dependencies = [ - "circuit_encodings 0.150.7", "derivative", "rayon", "serde", + "zk_evm 0.150.18", "zksync_bellman", ] @@ -3332,9 +3241,9 @@ dependencies = [ [[package]] name = "franklin-crypto" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "971289216ea5c91872e5e0bb6989214b537bbce375d09fabea5c3ccfe031b204" +checksum = "5c128e2cf791053b3aefdd7b07d6e5ffdc7cf5dd779ca270d727a403057dfb68" dependencies = [ "arr_macro", "bit-vec", @@ -7318,9 +7227,9 @@ dependencies = [ [[package]] name = "rescue_poseidon" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82900c877a0ba5362ac5756efbd82c5b795dc509011c1253e2389d8708f1389d" +checksum = "b62e4ce7543582ab2df1d9544674a55897e168a23afe938a57e1547d2981a7f4" dependencies = [ "addchain", "arrayvec 0.7.6", @@ -11208,9 +11117,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", @@ -11218,7 +11127,7 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "zk_evm_abstractions 0.150.7", + "zk_evm_abstractions 0.150.18", ] [[package]] @@ -11249,66 +11158,22 @@ 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", + "zkevm_opcode_defs 0.150.18", ] [[package]] name = "zkevm_circuits" -version = "0.150.7" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06fb35b00699d25175a2ad447f86a9088af8b0bc698bb57086fb04c13e52eab" +checksum = "8b94288d2e246aecd6eecd22ef27db0d1f29a91cb4f59b9e339a45237131a9ff" dependencies = [ "arrayvec 0.7.6", "boojum", @@ -11320,7 +11185,7 @@ dependencies = [ "seq-macro", "serde", "smallvec", - "zkevm_opcode_defs 0.150.7", + "zkevm_opcode_defs 0.150.18", "zksync_cs_derive", ] @@ -11368,9 +11233,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 0.10.6", @@ -11429,9 +11294,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", @@ -11493,9 +11358,7 @@ name = "zksync_commitment_generator" version = "0.1.0" dependencies = [ "anyhow", - "circuit_sequencer_api 0.140.3", - "circuit_sequencer_api 0.141.2", - "circuit_sequencer_api 0.150.7", + "circuit_encodings", "futures 0.3.31", "itertools 0.10.5", "num_cpus", @@ -11505,9 +11368,7 @@ dependencies = [ "tokio", "tracing", "vise", - "zk_evm 0.133.0", - "zk_evm 0.141.0", - "zk_evm 0.150.7", + "zk_evm 0.150.18", "zksync_contracts", "zksync_dal", "zksync_eth_client", @@ -11523,9 +11384,9 @@ dependencies = [ [[package]] name = "zksync_concurrency" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c24c9a056499823227503dd9e5fb3037d93bcc3ae9b06c1ac0a47334c6283af" +checksum = "e8312ab73d3caa55775bd531795b507fa8f76bd9dabfaeb0954fe43e8fc1323b" dependencies = [ "anyhow", "once_cell", @@ -11559,9 +11420,9 @@ dependencies = [ [[package]] name = "zksync_consensus_bft" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e7ae72c257d6a4956ecb1b9d77eb082b0b31e9f47a7860d107509fb55c474d" +checksum = "fb6b0944322f30f88cd7fb22f7875435b394a135fc1b479719a18c42d9fb724d" dependencies = [ "anyhow", "async-trait", @@ -11581,9 +11442,9 @@ dependencies = [ [[package]] name = "zksync_consensus_crypto" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da303b01f24283e93f80f361bf62c3df4a761d061c8b38b4faebeebf26362fc" +checksum = "86b539960de98df3c3bd27d2d9b97de862027686bbb3bdfc5aaad5b74bb929a1" dependencies = [ "anyhow", "blst", @@ -11602,9 +11463,9 @@ dependencies = [ [[package]] name = "zksync_consensus_executor" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33cfae30ebaaa817394718fe0858dfa7c0abfa2ed800ea283c407560aac2465" +checksum = "2a75d86368579d5aa59b1baebbdc1aebca7c9234f3e3cba734db7e9bbc4880b0" dependencies = [ "anyhow", "async-trait", @@ -11624,9 +11485,9 @@ dependencies = [ [[package]] name = "zksync_consensus_network" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0129eab96f940ce24f975a27ef9408592d64da7cff51153755dedefbcf58a73" +checksum = "30f73993b7d677dfd4e4f2598dd20906e6a5f3a2168c6cab3a599c056dc5e39a" dependencies = [ "anyhow", "async-trait", @@ -11661,9 +11522,9 @@ dependencies = [ [[package]] name = "zksync_consensus_roles" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f07db2a8ec2d2cda5cb4c5ac408101e81c8fa5d95c9f3302829dafae78d11c" +checksum = "c49949546895a10431b9daec6ec4208ef0917ace006446d304b51f5b234ba462" dependencies = [ "anyhow", "bit-vec", @@ -11683,9 +11544,9 @@ dependencies = [ [[package]] name = "zksync_consensus_storage" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a42f57cc5afcee634cbd336e9e6ea891d0171352d7c0bc7d6e17f6c8faa554" +checksum = "feb0d6a54e7d8d2adeee4ba38662161e9309180ad497299092e5641db9fb1c1e" dependencies = [ "anyhow", "async-trait", @@ -11703,9 +11564,9 @@ dependencies = [ [[package]] name = "zksync_consensus_utils" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3222410c67617a86edb192e0c4bb48afc254a17052200a0a839c90e8b0378842" +checksum = "723e2a4b056cc5af192a83163c89a6951ee75c098cc5c4a4cdc435f4232d88bd" dependencies = [ "anyhow", "rand 0.8.5", @@ -11852,9 +11713,9 @@ dependencies = [ [[package]] name = "zksync_cs_derive" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5939e2df4288c263c706ff18ac718e984149223ad4289d6d957d767dcfc04c81" +checksum = "63296ce43c432d5d0111604173e874b2f2a856e1cb1c76378fa0bb5ac6018c27" dependencies = [ "proc-macro-error", "proc-macro2 1.0.92", @@ -12181,9 +12042,9 @@ dependencies = [ [[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", @@ -12194,9 +12055,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 0.4.6", "num-integer", @@ -12239,9 +12100,9 @@ dependencies = [ [[package]] name = "zksync_kzg" -version = "0.150.7" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc58af8e4e4ad1a851ffd2275e6a44ead0f15a7eaac9dc9d60a56b3b9c9b08e8" +checksum = "6384d2475e4a7e6ed4e2a703724cac1d8972d9ec40c49fdd17bf37942a81a635" dependencies = [ "boojum", "derivative", @@ -12251,7 +12112,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "zkevm_circuits 0.150.7", + "zkevm_circuits", ] [[package]] @@ -12372,11 +12233,7 @@ version = "0.1.0" dependencies = [ "anyhow", "assert_matches", - "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", "hex", "itertools 0.10.5", @@ -12391,7 +12248,7 @@ 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_eth_signer", "zksync_mini_merkle_tree", @@ -12431,7 +12288,7 @@ dependencies = [ "tower-http 0.5.2", "tracing", "vise", - "zk_evm 0.150.7", + "zk_evm 0.150.18", "zksync_config", "zksync_consensus_roles", "zksync_contracts", @@ -12727,9 +12584,9 @@ dependencies = [ [[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", @@ -12764,9 +12621,9 @@ dependencies = [ [[package]] name = "zksync_protobuf" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05755c38b134b409736008bfdfd0fdb42bfa061947be93be4c78069aa10c9b3" +checksum = "e8986ad796f8e00d8999fee72effba1a21bce40f5f877d681ac9cd89a94834d8" dependencies = [ "anyhow", "bit-vec", @@ -12785,9 +12642,9 @@ dependencies = [ [[package]] name = "zksync_protobuf_build" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c3930a73ca667780be6dcd94e469d40a93fa52f4654c9ab732991b62238cb5" +checksum = "8d870b31995e3acb8e47afeb68ebeeffcf6121e70020e65b3d5d31692115d236" dependencies = [ "anyhow", "heck 0.5.0", @@ -12813,6 +12670,7 @@ dependencies = [ "serde_yaml", "tracing", "zksync_basic_types", + "zksync_concurrency", "zksync_config", "zksync_protobuf", "zksync_protobuf_build", @@ -12825,7 +12683,7 @@ version = "0.1.0" dependencies = [ "bincode", "chrono", - "circuit_sequencer_api 0.150.7", + "circuit_sequencer_api", "serde", "serde_json", "serde_with", @@ -12935,9 +12793,9 @@ dependencies = [ [[package]] name = "zksync_solidity_vk_codegen" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b310ab8a21681270e73f177ddf7974cabb7a96f0624ab8b008fd6ee1f9b4f687" +checksum = "6f03e137db1b29be36abfa1e1e682dd3864b0335c68282c8dab68c2d397b8cbd" dependencies = [ "ethereum-types", "franklin-crypto", @@ -13139,6 +12997,7 @@ dependencies = [ "once_cell", "reqwest 0.12.9", "serde_json", + "sha2 0.10.8", "tokio", "tracing", "zksync_vlog", @@ -13176,8 +13035,8 @@ source = "git+https://github.com/matter-labs/vm2.git?rev=457d8a7eea9093af9440662 dependencies = [ "enum_dispatch", "primitive-types", - "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", ] diff --git a/Cargo.toml b/Cargo.toml index 074d27d6574d..80e74f05c087 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -228,34 +228,31 @@ tokio-stream = "0.1.16" # We *always* pin the latest version of protocol to disallow accidental changes in the execution logic. # However, for the historical version of protocol crates, we have lax requirements. Otherwise, # Bumping a crypto dependency like `boojum` would require us to republish all the historical packages. -circuit_sequencer_api_1_3_3 = { package = "circuit_sequencer_api", version = "0.133" } -circuit_sequencer_api_1_4_0 = { package = "circuit_sequencer_api", version = "0.140" } -circuit_sequencer_api_1_4_1 = { package = "circuit_sequencer_api", version = "0.141" } -circuit_sequencer_api_1_4_2 = { package = "circuit_sequencer_api", version = "0.142" } -circuit_sequencer_api_1_5_0 = { package = "circuit_sequencer_api", version = "=0.150.7" } -crypto_codegen = { package = "zksync_solidity_vk_codegen", version = "=0.30.1" } -kzg = { package = "zksync_kzg", version = "=0.150.7" } +circuit_encodings = { package = "circuit_encodings", version = "=0.150.18" } +circuit_sequencer_api = { package = "circuit_sequencer_api", version = "=0.150.18" } +crypto_codegen = { package = "zksync_solidity_vk_codegen", version = "=0.30.11" } +kzg = { package = "zksync_kzg", version = "=0.150.18" } zk_evm = { version = "=0.133.0" } zk_evm_1_3_1 = { package = "zk_evm", version = "0.131.0-rc.2" } zk_evm_1_3_3 = { package = "zk_evm", version = "0.133" } zk_evm_1_4_0 = { package = "zk_evm", version = "0.140" } zk_evm_1_4_1 = { package = "zk_evm", version = "0.141" } -zk_evm_1_5_0 = { package = "zk_evm", version = "=0.150.7" } +zk_evm_1_5_0 = { package = "zk_evm", version = "=0.150.18" } # New VM; pinned to a specific commit because of instability zksync_vm2 = { git = "https://github.com/matter-labs/vm2.git", rev = "457d8a7eea9093af9440662e33e598c13ba41633" } # Consensus dependencies. -zksync_concurrency = "=0.6.0" -zksync_consensus_bft = "=0.6.0" -zksync_consensus_crypto = "=0.6.0" -zksync_consensus_executor = "=0.6.0" -zksync_consensus_network = "=0.6.0" -zksync_consensus_roles = "=0.6.0" -zksync_consensus_storage = "=0.6.0" -zksync_consensus_utils = "=0.6.0" -zksync_protobuf = "=0.6.0" -zksync_protobuf_build = "=0.6.0" +zksync_concurrency = "=0.7.0" +zksync_consensus_bft = "=0.7.0" +zksync_consensus_crypto = "=0.7.0" +zksync_consensus_executor = "=0.7.0" +zksync_consensus_network = "=0.7.0" +zksync_consensus_roles = "=0.7.0" +zksync_consensus_storage = "=0.7.0" +zksync_consensus_utils = "=0.7.0" +zksync_protobuf = "=0.7.0" +zksync_protobuf_build = "=0.7.0" # "Local" dependencies zksync_multivm = { version = "0.1.0", path = "core/lib/multivm" } diff --git a/core/lib/config/src/configs/consensus.rs b/core/lib/config/src/configs/consensus.rs index 7f5a0f56aa17..17359f188a70 100644 --- a/core/lib/config/src/configs/consensus.rs +++ b/core/lib/config/src/configs/consensus.rs @@ -126,6 +126,9 @@ pub struct ConsensusConfig { /// Maximal allowed size of the payload in bytes. pub max_payload_size: usize, + /// View timeout duration in milliseconds. + pub view_timeout: Option, + /// Maximal allowed size of the sync-batch payloads in bytes. /// /// The batch consists of block payloads and a Merkle proof of inclusion on L1 (~1kB), @@ -155,6 +158,10 @@ pub struct ConsensusConfig { } impl ConsensusConfig { + pub fn view_timeout(&self) -> time::Duration { + self.view_timeout.unwrap_or(time::Duration::seconds(2)) + } + pub fn rpc(&self) -> RpcConfig { self.rpc.clone().unwrap_or_default() } diff --git a/core/lib/config/src/testonly.rs b/core/lib/config/src/testonly.rs index b026aabc6111..749dba1f9548 100644 --- a/core/lib/config/src/testonly.rs +++ b/core/lib/config/src/testonly.rs @@ -809,6 +809,7 @@ impl Distribution for EncodeDist { server_addr: self.sample(rng), public_addr: Host(self.sample(rng)), max_payload_size: self.sample(rng), + view_timeout: self.sample(rng), max_batch_size: self.sample(rng), gossip_dynamic_inbound_limit: self.sample(rng), gossip_static_inbound: self diff --git a/core/lib/contracts/src/lib.rs b/core/lib/contracts/src/lib.rs index e60fdb0e59f3..4669fc2b86b8 100644 --- a/core/lib/contracts/src/lib.rs +++ b/core/lib/contracts/src/lib.rs @@ -180,7 +180,7 @@ pub fn l1_messenger_contract() -> Contract { /// Reads bytecode from the path RELATIVE to the Cargo workspace location. pub fn read_bytecode(relative_path: impl AsRef + std::fmt::Debug) -> Vec { - read_bytecode_from_path(relative_path).expect("Exists") + read_bytecode_from_path(relative_path).expect("Failed to open file") } pub fn eth_contract() -> Contract { diff --git a/core/lib/multivm/Cargo.toml b/core/lib/multivm/Cargo.toml index 128e6fc0c4af..107a168e305a 100644 --- a/core/lib/multivm/Cargo.toml +++ b/core/lib/multivm/Cargo.toml @@ -18,11 +18,7 @@ zk_evm_1_3_3.workspace = true zk_evm_1_3_1.workspace = true zksync_vm2.workspace = true -circuit_sequencer_api_1_3_3.workspace = true -circuit_sequencer_api_1_4_0.workspace = true -circuit_sequencer_api_1_4_1.workspace = true -circuit_sequencer_api_1_4_2.workspace = true -circuit_sequencer_api_1_5_0.workspace = true +circuit_sequencer_api.workspace = true zksync_types.workspace = true zksync_contracts.workspace = true diff --git a/core/lib/multivm/src/glue/types/vm/vm_block_result.rs b/core/lib/multivm/src/glue/types/vm/vm_block_result.rs index c4eb0b1741aa..1cbb9f261ad2 100644 --- a/core/lib/multivm/src/glue/types/vm/vm_block_result.rs +++ b/core/lib/multivm/src/glue/types/vm/vm_block_result.rs @@ -1,8 +1,6 @@ use std::collections::HashMap; -use circuit_sequencer_api_1_3_3::sort_storage_access::sort_storage_access_queries as sort_storage_access_queries_1_3_3; -use itertools::Itertools; -use zk_evm_1_3_1::aux_structures::LogQuery as LogQuery_1_3_1; +use circuit_sequencer_api::sort_storage_access::sort_storage_access_queries; use zksync_types::l2_to_l1_log::UserL2ToL1Log; use crate::{ @@ -11,6 +9,7 @@ use crate::{ CurrentExecutionState, ExecutionResult, Refunds, VmExecutionLogs, VmExecutionResultAndLogs, VmExecutionStatistics, }, + utils::glue_log_query, }; // Note: In version after vm `VmVirtualBlocks` the bootloader memory knowledge is encapsulated into the VM. @@ -21,18 +20,12 @@ use crate::{ impl GlueFrom for crate::interface::FinishedL1Batch { fn glue_from(value: crate::vm_m5::vm_instance::VmBlockResult) -> Self { let storage_log_queries = value.full_result.storage_log_queries.clone(); - let deduplicated_storage_logs: Vec = sort_storage_access_queries_1_3_3( - &storage_log_queries + let deduplicated_storage_logs = sort_storage_access_queries( + storage_log_queries .iter() - .map(|log| { - GlueInto::::glue_into(log.log_query) - }) - .collect_vec(), + .map(|log| glue_log_query(log.log_query)), ) - .1 - .into_iter() - .map(GlueInto::::glue_into) - .collect(); + .1; crate::interface::FinishedL1Batch { block_tip_execution_result: VmExecutionResultAndLogs { @@ -78,18 +71,12 @@ impl GlueFrom for crate::interface::Fi impl GlueFrom for crate::interface::FinishedL1Batch { fn glue_from(value: crate::vm_m6::vm_instance::VmBlockResult) -> Self { let storage_log_queries = value.full_result.storage_log_queries.clone(); - let deduplicated_storage_logs: Vec = sort_storage_access_queries_1_3_3( - &storage_log_queries + let deduplicated_storage_logs = sort_storage_access_queries( + storage_log_queries .iter() - .map(|log| { - GlueInto::::glue_into(log.log_query) - }) - .collect_vec(), + .map(|log| glue_log_query(log.log_query)), ) - .1 - .into_iter() - .map(GlueInto::::glue_into) - .collect(); + .1; crate::interface::FinishedL1Batch { block_tip_execution_result: VmExecutionResultAndLogs { @@ -135,11 +122,12 @@ impl GlueFrom for crate::interface::Fi impl GlueFrom for crate::interface::FinishedL1Batch { fn glue_from(value: crate::vm_1_3_2::vm_instance::VmBlockResult) -> Self { let storage_log_queries = value.full_result.storage_log_queries.clone(); - let deduplicated_storage_logs = - circuit_sequencer_api_1_3_3::sort_storage_access::sort_storage_access_queries( - storage_log_queries.iter().map(|log| &log.log_query), - ) - .1; + let deduplicated_storage_logs = sort_storage_access_queries( + storage_log_queries + .iter() + .map(|log| glue_log_query(log.log_query)), + ) + .1; crate::interface::FinishedL1Batch { block_tip_execution_result: VmExecutionResultAndLogs { diff --git a/core/lib/multivm/src/lib.rs b/core/lib/multivm/src/lib.rs index fc4085d9b021..202d7ce95d14 100644 --- a/core/lib/multivm/src/lib.rs +++ b/core/lib/multivm/src/lib.rs @@ -2,7 +2,7 @@ #![warn(unused_extern_crates)] #![warn(unused_imports)] -pub use circuit_sequencer_api_1_5_0 as circuit_sequencer_api_latest; +pub use circuit_sequencer_api as circuit_sequencer_api_latest; pub use zk_evm_1_5_0 as zk_evm_latest; pub use zksync_types::vm::VmVersion; pub use zksync_vm_interface as interface; diff --git a/core/lib/multivm/src/tracers/mod.rs b/core/lib/multivm/src/tracers/mod.rs index 35224d993a17..b888c3730118 100644 --- a/core/lib/multivm/src/tracers/mod.rs +++ b/core/lib/multivm/src/tracers/mod.rs @@ -1,6 +1,9 @@ pub use self::{ - call_tracer::CallTracer, multivm_dispatcher::TracerDispatcher, prestate_tracer::PrestateTracer, - storage_invocation::StorageInvocations, validator::ValidationTracer, + call_tracer::CallTracer, + multivm_dispatcher::TracerDispatcher, + prestate_tracer::PrestateTracer, + storage_invocation::StorageInvocations, + validator::{ValidationTracer, TIMESTAMP_ASSERTER_FUNCTION_SELECTOR}, }; mod call_tracer; diff --git a/core/lib/multivm/src/tracers/validator/mod.rs b/core/lib/multivm/src/tracers/validator/mod.rs index 88249467a575..c1dd311d9fd3 100644 --- a/core/lib/multivm/src/tracers/validator/mod.rs +++ b/core/lib/multivm/src/tracers/validator/mod.rs @@ -5,6 +5,7 @@ use std::{ }; use once_cell::sync::OnceCell; +pub use vm_latest::TIMESTAMP_ASSERTER_FUNCTION_SELECTOR; use zksync_system_constants::{ ACCOUNT_CODE_STORAGE_ADDRESS, BOOTLOADER_ADDRESS, CONTRACT_DEPLOYER_ADDRESS, L2_BASE_TOKEN_ADDRESS, MSG_VALUE_SIMULATOR_ADDRESS, SYSTEM_CONTEXT_ADDRESS, @@ -13,10 +14,7 @@ use zksync_types::{ address_to_u256, u256_to_h256, vm::VmVersion, web3::keccak256, AccountTreeId, Address, StorageKey, H256, U256, }; -use zksync_vm_interface::{ - tracer::{TimestampAsserterParams, ValidationTraces}, - L1BatchEnv, -}; +use zksync_vm_interface::tracer::{TimestampAsserterParams, ValidationTraces}; use self::types::{NewTrustedValidationItems, ValidationTracerMode}; use crate::{ @@ -54,7 +52,7 @@ pub struct ValidationTracer { computational_gas_limit: u32, timestamp_asserter_params: Option, vm_version: VmVersion, - l1_batch_env: L1BatchEnv, + l1_batch_timestamp: u64, pub result: Arc>, pub traces: Arc>, _marker: PhantomData H>, @@ -65,7 +63,7 @@ type ValidationRoundResult = Result ValidationTracer { const MAX_ALLOWED_SLOT_OFFSET: u32 = 127; - pub fn new(params: ValidationParams, vm_version: VmVersion, l1_batch_env: L1BatchEnv) -> Self { + pub fn new(params: ValidationParams, vm_version: VmVersion, l1_batch_timestamp: u64) -> Self { Self { validation_mode: ValidationTracerMode::NoValidation, auxilary_allowed_slots: Default::default(), @@ -83,7 +81,7 @@ impl ValidationTracer { result: Arc::new(OnceCell::new()), traces: Arc::new(Mutex::new(ValidationTraces::default())), _marker: Default::default(), - l1_batch_env, + l1_batch_timestamp, } } diff --git a/core/lib/multivm/src/tracers/validator/vm_latest/mod.rs b/core/lib/multivm/src/tracers/validator/vm_latest/mod.rs index 3c819384137f..5588dd144e95 100644 --- a/core/lib/multivm/src/tracers/validator/vm_latest/mod.rs +++ b/core/lib/multivm/src/tracers/validator/vm_latest/mod.rs @@ -1,6 +1,6 @@ use zk_evm_1_5_0::{ tracing::{BeforeExecutionData, VmLocalStateData}, - zkevm_opcode_defs::{ContextOpcode, FarCallABI, LogOpcode, Opcode}, + zkevm_opcode_defs::{ContextOpcode, FarCallABI, LogOpcode, Opcode, RetOpcode}, }; use zksync_system_constants::KECCAK256_PRECOMPILE_ADDRESS; use zksync_types::{ @@ -116,8 +116,7 @@ impl ValidationTracer { // using self.l1_batch_env.timestamp is ok here because the tracer is always // used in a oneshot execution mode if end - < self.l1_batch_env.timestamp - + params.min_time_till_end.as_secs() + < self.l1_batch_timestamp + params.min_time_till_end.as_secs() { return Err( ViolatedValidationRule::TimestampAssertionCloseToRangeEnd, @@ -168,6 +167,13 @@ impl ValidationTracer { }); } } + + Opcode::Ret(RetOpcode::Panic) + if state.vm_local_state.callstack.current.ergs_remaining == 0 => + { + // Actual gas limit was reached, not the validation gas limit. + return Err(ViolatedValidationRule::TookTooManyComputationalGas(0)); + } _ => {} } diff --git a/core/lib/multivm/src/utils/mod.rs b/core/lib/multivm/src/utils/mod.rs index 4332c0327ff1..6f350084d22a 100644 --- a/core/lib/multivm/src/utils/mod.rs +++ b/core/lib/multivm/src/utils/mod.rs @@ -5,12 +5,27 @@ use zksync_types::{ }; pub use self::deduplicator::{ModifiedSlot, StorageWritesDeduplicator}; -use crate::interface::L1BatchEnv; +use crate::{ + glue::{GlueFrom, GlueInto}, + interface::L1BatchEnv, +}; pub(crate) mod bytecode; mod deduplicator; pub(crate) mod events; +/// Allows to convert `LogQuery` between two different versions, even if they don't provide +/// direct conversion between each other. +/// It transforms the input query to the `LogQuery` from `zksync_types` (for which most of the +/// `zk_evm` versions provide conversion) and then converts it to the target version. +pub fn glue_log_query(l: L) -> R +where + L: GlueInto, + R: GlueFrom, +{ + R::glue_from(l.glue_into()) +} + /// Calculates the base fee and gas per pubdata for the given L1 gas price. pub fn derive_base_fee_and_gas_per_pubdata( batch_fee_input: BatchFeeInput, diff --git a/core/lib/multivm/src/versions/shadow/mod.rs b/core/lib/multivm/src/versions/shadow/mod.rs index a335d0fe5906..1ad5bdba5a7b 100644 --- a/core/lib/multivm/src/versions/shadow/mod.rs +++ b/core/lib/multivm/src/versions/shadow/mod.rs @@ -25,7 +25,7 @@ use crate::{ mod tests; type ReferenceVm = vm_latest::Vm, HistoryEnabled>; -type ShadowedFastVm = crate::vm_instance::ShadowedFastVm; +type ShadowedFastVm = crate::vm_instance::ShadowedFastVm; fn hash_block(block_env: L2BlockEnv, tx_hashes: &[H256]) -> H256 { let mut hasher = L2BlockHasher::new( diff --git a/core/lib/multivm/src/versions/testonly/account_validation_rules.rs b/core/lib/multivm/src/versions/testonly/account_validation_rules.rs new file mode 100644 index 000000000000..b2beb050ad41 --- /dev/null +++ b/core/lib/multivm/src/versions/testonly/account_validation_rules.rs @@ -0,0 +1,59 @@ +use assert_matches::assert_matches; +use zksync_test_contracts::TestContract; +use zksync_types::{u256_to_h256, AccountTreeId, Address, StorageKey}; +use zksync_vm_interface::tracer::ViolatedValidationRule; + +use super::{ + get_empty_storage, require_eip712::make_aa_transaction, tester::VmTesterBuilder, + ContractToDeploy, TestedVm, TestedVmForValidation, +}; +use crate::interface::TxExecutionMode; + +/// Checks that every limitation imposed on account validation results in an appropriate error. +/// The actual misbehavior cases are found in "validation-rule-breaker.sol". +pub(crate) fn test_account_validation_rules() { + assert_matches!(test_rule::(0), None); + assert_matches!( + test_rule::(1), + Some(ViolatedValidationRule::TouchedDisallowedStorageSlots(_, _)) + ); + assert_matches!( + test_rule::(2), + Some(ViolatedValidationRule::CalledContractWithNoCode(_)) + ); + assert_matches!(test_rule::(3), None); + assert_matches!( + test_rule::(4), + Some(ViolatedValidationRule::TookTooManyComputationalGas(_)) + ) +} + +fn test_rule(rule: u32) -> Option { + let aa_address = Address::repeat_byte(0x10); + let beneficiary_address = Address::repeat_byte(0x20); + + // Set the type of misbehaviour of the AA contract + let mut storage_with_rule_break_set = get_empty_storage(); + storage_with_rule_break_set.set_value( + StorageKey::new(AccountTreeId::new(aa_address), u256_to_h256(0.into())), + u256_to_h256(rule.into()), + ); + + let bytecode = TestContract::validation_test().bytecode.to_vec(); + let mut vm = VmTesterBuilder::new() + .with_empty_in_memory_storage() + .with_custom_contracts(vec![ + ContractToDeploy::account(bytecode, aa_address).funded() + ]) + .with_storage(storage_with_rule_break_set) + .with_execution_mode(TxExecutionMode::VerifyExecute) + .with_rich_accounts(1) + .build::(); + + let private_account = vm.rich_accounts[0].clone(); + + vm.vm.run_validation( + make_aa_transaction(aa_address, beneficiary_address, &private_account), + 55, + ) +} diff --git a/core/lib/multivm/src/versions/testonly/l1_messenger.rs b/core/lib/multivm/src/versions/testonly/l1_messenger.rs index daf07b2750f7..5d602b1e7d66 100644 --- a/core/lib/multivm/src/versions/testonly/l1_messenger.rs +++ b/core/lib/multivm/src/versions/testonly/l1_messenger.rs @@ -99,9 +99,7 @@ pub(crate) fn test_rollup_da_output_hash_match() { // Firstly, deploy tx. It should publish the bytecode of the "test contract" let counter_bytecode = TestContract::counter().bytecode; - let tx = account - .get_deploy_tx(&counter_bytecode, None, TxType::L2) - .tx; + let tx = account.get_deploy_tx(counter_bytecode, None, TxType::L2).tx; // We do not use compression here, to have the bytecode published in full. let (_, result) = vm .vm diff --git a/core/lib/multivm/src/versions/testonly/mod.rs b/core/lib/multivm/src/versions/testonly/mod.rs index a0f08546197c..5ab13df87337 100644 --- a/core/lib/multivm/src/versions/testonly/mod.rs +++ b/core/lib/multivm/src/versions/testonly/mod.rs @@ -24,12 +24,15 @@ use zksync_vm_interface::{ pubdata::PubdataBuilder, L1BatchEnv, L2BlockEnv, SystemEnv, TxExecutionMode, }; -pub(super) use self::tester::{TestedVm, VmTester, VmTesterBuilder}; +pub(super) use self::tester::{ + validation_params, TestedVm, TestedVmForValidation, VmTester, VmTesterBuilder, +}; use crate::{ interface::storage::InMemoryStorage, pubdata_builders::RollupPubdataBuilder, vm_latest::constants::BATCH_COMPUTATIONAL_GAS_LIMIT, }; +pub(super) mod account_validation_rules; pub(super) mod block_tip; pub(super) mod bootloader; pub(super) mod bytecode_publishing; diff --git a/core/lib/multivm/src/versions/testonly/precompiles.rs b/core/lib/multivm/src/versions/testonly/precompiles.rs index e525bd627646..dee60686a4f0 100644 --- a/core/lib/multivm/src/versions/testonly/precompiles.rs +++ b/core/lib/multivm/src/versions/testonly/precompiles.rs @@ -1,4 +1,4 @@ -use circuit_sequencer_api_1_5_0::geometry_config::get_geometry_config; +use circuit_sequencer_api::geometry_config::ProtocolGeometry; use zksync_test_contracts::TestContract; use zksync_types::{Address, Execute}; @@ -41,7 +41,9 @@ pub(crate) fn test_keccak() { assert!(!exec_result.result.is_failed(), "{exec_result:#?}"); let keccak_count = exec_result.statistics.circuit_statistic.keccak256 - * get_geometry_config().cycles_per_keccak256_circuit as f32; + * ProtocolGeometry::V1_5_0 + .config() + .cycles_per_keccak256_circuit as f32; assert!(keccak_count >= 1000.0, "{keccak_count}"); } @@ -77,7 +79,7 @@ pub(crate) fn test_sha256() { assert!(!exec_result.result.is_failed(), "{exec_result:#?}"); let sha_count = exec_result.statistics.circuit_statistic.sha256 - * get_geometry_config().cycles_per_sha256_circuit as f32; + * ProtocolGeometry::V1_5_0.config().cycles_per_sha256_circuit as f32; assert!(sha_count >= 1000.0, "{sha_count}"); } @@ -106,6 +108,8 @@ pub(crate) fn test_ecrecover() { assert!(!exec_result.result.is_failed(), "{exec_result:#?}"); let ecrecover_count = exec_result.statistics.circuit_statistic.ecrecover - * get_geometry_config().cycles_per_ecrecover_circuit as f32; + * ProtocolGeometry::V1_5_0 + .config() + .cycles_per_ecrecover_circuit as f32; assert!((ecrecover_count - 1.0).abs() < 1e-4, "{ecrecover_count}"); } diff --git a/core/lib/multivm/src/versions/testonly/require_eip712.rs b/core/lib/multivm/src/versions/testonly/require_eip712.rs index 7a934c570aea..2f17a3e7823e 100644 --- a/core/lib/multivm/src/versions/testonly/require_eip712.rs +++ b/core/lib/multivm/src/versions/testonly/require_eip712.rs @@ -1,6 +1,6 @@ use ethabi::Token; use zksync_eth_signer::TransactionParameters; -use zksync_test_contracts::TestContract; +use zksync_test_contracts::{Account, TestContract}; use zksync_types::{ fee::Fee, l2::L2Tx, transaction_request::TransactionRequest, Address, Eip712Domain, Execute, L2ChainId, Nonce, Transaction, U256, @@ -30,7 +30,6 @@ pub(crate) fn test_require_eip712() { .with_rich_accounts(1) .build::(); assert_eq!(vm.get_eth_balance(beneficiary_address), U256::from(0)); - let chain_id: u32 = 270; let mut private_account = vm.rich_accounts[0].clone(); // First, let's set the owners of the AA account to the `private_address`. @@ -97,7 +96,30 @@ pub(crate) fn test_require_eip712() { vm.get_eth_balance(private_account.address) ); - // // Now send the 'classic' EIP712 transaction + // Now send the 'classic' EIP712 transaction + + let transaction: Transaction = + make_aa_transaction(aa_address, beneficiary_address, &private_account).into(); + vm.vm.push_transaction(transaction); + vm.vm.execute(InspectExecutionMode::OneTx); + + assert_eq!( + vm.get_eth_balance(beneficiary_address), + U256::from(916375026) + ); + assert_eq!( + private_account_balance, + vm.get_eth_balance(private_account.address) + ); +} + +pub(crate) fn make_aa_transaction( + aa_address: Address, + beneficiary_address: Address, + private_account: &Account, +) -> L2Tx { + let chain_id: u32 = 270; + let tx_712 = L2Tx::new( Some(beneficiary_address), vec![], @@ -130,16 +152,5 @@ pub(crate) fn test_require_eip712() { let mut l2_tx = L2Tx::from_request(aa_txn_request, 100000, false).unwrap(); l2_tx.set_input(encoded_tx, aa_hash); - let transaction: Transaction = l2_tx.into(); - vm.vm.push_transaction(transaction); - vm.vm.execute(InspectExecutionMode::OneTx); - - assert_eq!( - vm.get_eth_balance(beneficiary_address), - U256::from(916375026) - ); - assert_eq!( - private_account_balance, - vm.get_eth_balance(private_account.address) - ); + l2_tx } diff --git a/core/lib/multivm/src/versions/testonly/tester/mod.rs b/core/lib/multivm/src/versions/testonly/tester/mod.rs index d3cf2d6f782f..c29f2dbbf8f3 100644 --- a/core/lib/multivm/src/versions/testonly/tester/mod.rs +++ b/core/lib/multivm/src/versions/testonly/tester/mod.rs @@ -3,6 +3,7 @@ use std::{collections::HashSet, fmt, rc::Rc}; use zksync_contracts::BaseSystemContracts; use zksync_test_contracts::{Account, TestContract, TxType}; use zksync_types::{ + l2::L2Tx, utils::{deployed_address_create, storage_key_for_eth_balance}, writes::StateDiffRecord, Address, L1BatchNumber, StorageKey, Transaction, H256, U256, @@ -14,6 +15,7 @@ use crate::{ interface::{ pubdata::{PubdataBuilder, PubdataInput}, storage::{InMemoryStorage, StoragePtr, StorageView}, + tracer::{ValidationParams, ViolatedValidationRule}, CurrentExecutionState, InspectExecutionMode, L1BatchEnv, L2BlockEnv, SystemEnv, TxExecutionMode, VmExecutionResultAndLogs, VmFactory, VmInterfaceExt, VmInterfaceHistoryEnabled, @@ -231,3 +233,22 @@ pub(crate) trait TestedVm: /// Returns pubdata input. fn pubdata_input(&self) -> PubdataInput; } + +pub(crate) trait TestedVmForValidation { + fn run_validation(&mut self, tx: L2Tx, timestamp: u64) -> Option; +} + +pub(crate) fn validation_params(tx: &L2Tx, system: &SystemEnv) -> ValidationParams { + let user_address = tx.common_data.initiator_address; + let paymaster_address = tx.common_data.paymaster_params.paymaster; + ValidationParams { + user_address, + paymaster_address, + trusted_slots: Default::default(), + trusted_addresses: Default::default(), + // field `trustedAddress` of ValidationRuleBreaker + trusted_address_slots: [(Address::repeat_byte(0x10), 2.into())].into(), + computational_gas_limit: system.default_validation_computational_gas_limit, + timestamp_asserter_params: None, + } +} diff --git a/core/lib/multivm/src/versions/vm_1_3_2/pubdata_utils.rs b/core/lib/multivm/src/versions/vm_1_3_2/pubdata_utils.rs index 3c10bd8c48be..f0be10d72077 100644 --- a/core/lib/multivm/src/versions/vm_1_3_2/pubdata_utils.rs +++ b/core/lib/multivm/src/versions/vm_1_3_2/pubdata_utils.rs @@ -1,12 +1,12 @@ use std::collections::HashMap; -use circuit_sequencer_api_1_3_3::sort_storage_access::sort_storage_access_queries; +use circuit_sequencer_api::sort_storage_access::sort_storage_access_queries; use zk_evm_1_3_3::aux_structures::Timestamp; use zksync_types::{StorageKey, PUBLISH_BYTECODE_OVERHEAD, SYSTEM_CONTEXT_ADDRESS}; use crate::{ interface::{storage::WriteStorage, VmEvent}, - utils::bytecode::bytecode_len_in_bytes, + utils::{bytecode::bytecode_len_in_bytes, glue_log_query}, vm_1_3_2::{history_recorder::HistoryMode, oracles::storage::storage_key_of_log, VmInstance}, }; @@ -71,16 +71,20 @@ impl VmInstance { .state .storage .storage_log_queries_after_timestamp(from_timestamp); - let (_, deduplicated_logs) = - sort_storage_access_queries(storage_logs.iter().map(|log| &log.log_query)); + let (_, deduplicated_logs) = sort_storage_access_queries( + storage_logs.iter().map(|log| glue_log_query(log.log_query)), + ); deduplicated_logs .into_iter() .filter_map(|log| { if log.rw_flag { - let key = storage_key_of_log(&log); + let key = storage_key_of_log(&glue_log_query(log)); let pre_paid = pre_paid_before_tx(&key); - let to_pay_by_user = self.state.storage.base_price_for_write(&log); + let to_pay_by_user = self + .state + .storage + .base_price_for_write(&glue_log_query(log)); if to_pay_by_user > pre_paid { Some(to_pay_by_user - pre_paid) diff --git a/core/lib/multivm/src/versions/vm_1_3_2/vm_with_bootloader.rs b/core/lib/multivm/src/versions/vm_1_3_2/vm_with_bootloader.rs index ca9ba097d472..6515228903f6 100644 --- a/core/lib/multivm/src/versions/vm_1_3_2/vm_with_bootloader.rs +++ b/core/lib/multivm/src/versions/vm_1_3_2/vm_with_bootloader.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use circuit_sequencer_api_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; +use circuit_sequencer_api::INITIAL_MONOTONIC_CYCLE_COUNTER; use itertools::Itertools; use zk_evm_1_3_3::{ aux_structures::{MemoryPage, Timestamp}, diff --git a/core/lib/multivm/src/versions/vm_1_4_1/tracers/circuits_capacity.rs b/core/lib/multivm/src/versions/vm_1_4_1/tracers/circuits_capacity.rs index a32328bbc18c..5ef359248b85 100644 --- a/core/lib/multivm/src/versions/vm_1_4_1/tracers/circuits_capacity.rs +++ b/core/lib/multivm/src/versions/vm_1_4_1/tracers/circuits_capacity.rs @@ -1,4 +1,4 @@ -use circuit_sequencer_api_1_4_1::{geometry_config::get_geometry_config, toolset::GeometryConfig}; +use circuit_sequencer_api::geometry_config::{GeometryConfig, ProtocolGeometry}; use crate::{interface::CircuitStatistic, utils::CircuitCycleStatistic}; @@ -40,7 +40,7 @@ pub(crate) const UMA_READ_RAM_CYCLES: u32 = 3; pub(crate) const PRECOMPILE_RAM_CYCLES: u32 = 1; pub(crate) const PRECOMPILE_LOG_DEMUXER_CYCLES: u32 = 1; -const GEOMETRY_CONFIG: GeometryConfig = get_geometry_config(); +const GEOMETRY_CONFIG: GeometryConfig = ProtocolGeometry::V1_4_1.config(); pub(crate) fn circuit_statistic_from_cycles(cycles: CircuitCycleStatistic) -> CircuitStatistic { CircuitStatistic { diff --git a/core/lib/multivm/src/versions/vm_1_4_1/tracers/pubdata_tracer.rs b/core/lib/multivm/src/versions/vm_1_4_1/tracers/pubdata_tracer.rs index a51c5ce46197..344cacbd903e 100644 --- a/core/lib/multivm/src/versions/vm_1_4_1/tracers/pubdata_tracer.rs +++ b/core/lib/multivm/src/versions/vm_1_4_1/tracers/pubdata_tracer.rs @@ -1,6 +1,6 @@ use std::marker::PhantomData; -use circuit_sequencer_api_1_4_1::sort_storage_access::sort_storage_access_queries; +use circuit_sequencer_api::sort_storage_access::sort_storage_access_queries; use zk_evm_1_4_1::{ aux_structures::Timestamp, tracing::{BeforeExecutionData, VmLocalStateData}, @@ -24,6 +24,7 @@ use crate::{ extract_bytecode_publication_requests_from_l1_messenger, extract_l2tol1logs_from_l1_messenger, }, + glue_log_query, }, vm_1_4_1::{ bootloader_state::{utils::apply_pubdata_to_memory, BootloaderState}, @@ -130,7 +131,7 @@ impl PubdataTracer { storage .storage_log_queries_after_timestamp(Timestamp(0)) .iter() - .map(|log| &log.log_query), + .map(|log| glue_log_query(log.log_query)), ) .1 .into_iter() diff --git a/core/lib/multivm/src/versions/vm_1_4_1/types/internals/vm_state.rs b/core/lib/multivm/src/versions/vm_1_4_1/types/internals/vm_state.rs index 9c3ecd9741a3..cc1ec75d51c2 100644 --- a/core/lib/multivm/src/versions/vm_1_4_1/types/internals/vm_state.rs +++ b/core/lib/multivm/src/versions/vm_1_4_1/types/internals/vm_state.rs @@ -1,4 +1,4 @@ -use circuit_sequencer_api_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; +use circuit_sequencer_api::INITIAL_MONOTONIC_CYCLE_COUNTER; use zk_evm_1_4_1::{ aux_structures::{MemoryPage, Timestamp}, block_properties::BlockProperties, diff --git a/core/lib/multivm/src/versions/vm_1_4_1/vm.rs b/core/lib/multivm/src/versions/vm_1_4_1/vm.rs index af483feedd7e..7f17f65cac07 100644 --- a/core/lib/multivm/src/versions/vm_1_4_1/vm.rs +++ b/core/lib/multivm/src/versions/vm_1_4_1/vm.rs @@ -1,6 +1,6 @@ use std::rc::Rc; -use circuit_sequencer_api_1_4_1::sort_storage_access::sort_storage_access_queries; +use circuit_sequencer_api::sort_storage_access::sort_storage_access_queries; use zksync_types::{ l2_to_l1_log::{SystemL2ToL1Log, UserL2ToL1Log}, Transaction, @@ -15,7 +15,7 @@ use crate::{ FinishedL1Batch, L1BatchEnv, L2BlockEnv, PushTransactionResult, SystemEnv, VmExecutionMode, VmExecutionResultAndLogs, VmFactory, VmInterface, VmInterfaceHistoryEnabled, }, - utils::events::extract_l2tol1logs_from_l1_messenger, + utils::{events::extract_l2tol1logs_from_l1_messenger, glue_log_query}, vm_1_4_1::{ bootloader_state::BootloaderState, old_vm::events::merge_events, @@ -60,8 +60,12 @@ impl Vm { let storage_log_queries = self.state.storage.get_final_log_queries(); - let deduped_storage_log_queries = - sort_storage_access_queries(storage_log_queries.iter().map(|log| &log.log_query)).1; + let deduped_storage_log_queries = sort_storage_access_queries( + storage_log_queries + .iter() + .map(|log| glue_log_query(log.log_query)), + ) + .1; CurrentExecutionState { events, diff --git a/core/lib/multivm/src/versions/vm_1_4_2/constants.rs b/core/lib/multivm/src/versions/vm_1_4_2/constants.rs index 79f20660c149..35266358a742 100644 --- a/core/lib/multivm/src/versions/vm_1_4_2/constants.rs +++ b/core/lib/multivm/src/versions/vm_1_4_2/constants.rs @@ -1,4 +1,4 @@ -use circuit_sequencer_api_1_4_2::{BLOB_CHUNK_SIZE, ELEMENTS_PER_4844_BLOCK}; +use circuit_sequencer_api::{BLOB_CHUNK_SIZE, ELEMENTS_PER_4844_BLOCK}; use zk_evm_1_4_1::aux_structures::MemoryPage; pub use zk_evm_1_4_1::zkevm_opcode_defs::system_params::{ ERGS_PER_CIRCUIT, INITIAL_STORAGE_WRITE_PUBDATA_BYTES, diff --git a/core/lib/multivm/src/versions/vm_1_4_2/tracers/circuits_capacity.rs b/core/lib/multivm/src/versions/vm_1_4_2/tracers/circuits_capacity.rs index 974e07577213..e56d57246982 100644 --- a/core/lib/multivm/src/versions/vm_1_4_2/tracers/circuits_capacity.rs +++ b/core/lib/multivm/src/versions/vm_1_4_2/tracers/circuits_capacity.rs @@ -1,4 +1,4 @@ -use circuit_sequencer_api_1_4_2::{geometry_config::get_geometry_config, toolset::GeometryConfig}; +use circuit_sequencer_api::geometry_config::{GeometryConfig, ProtocolGeometry}; use crate::{interface::CircuitStatistic, utils::CircuitCycleStatistic}; @@ -41,7 +41,7 @@ pub(crate) const UMA_READ_RAM_CYCLES: u32 = 3; pub(crate) const PRECOMPILE_RAM_CYCLES: u32 = 1; pub(crate) const PRECOMPILE_LOG_DEMUXER_CYCLES: u32 = 1; -const GEOMETRY_CONFIG: GeometryConfig = get_geometry_config(); +const GEOMETRY_CONFIG: GeometryConfig = ProtocolGeometry::V1_4_2.config(); pub(crate) fn circuit_statistic_from_cycles(cycles: CircuitCycleStatistic) -> CircuitStatistic { CircuitStatistic { diff --git a/core/lib/multivm/src/versions/vm_1_4_2/tracers/pubdata_tracer.rs b/core/lib/multivm/src/versions/vm_1_4_2/tracers/pubdata_tracer.rs index 58318f5d845e..8f9bbb94b9d4 100644 --- a/core/lib/multivm/src/versions/vm_1_4_2/tracers/pubdata_tracer.rs +++ b/core/lib/multivm/src/versions/vm_1_4_2/tracers/pubdata_tracer.rs @@ -1,6 +1,6 @@ use std::marker::PhantomData; -use circuit_sequencer_api_1_4_2::sort_storage_access::sort_storage_access_queries; +use circuit_sequencer_api::sort_storage_access::sort_storage_access_queries; use zk_evm_1_4_1::{ aux_structures::Timestamp, tracing::{BeforeExecutionData, VmLocalStateData}, @@ -24,6 +24,7 @@ use crate::{ extract_bytecode_publication_requests_from_l1_messenger, extract_l2tol1logs_from_l1_messenger, }, + glue_log_query, }, vm_1_4_2::{ bootloader_state::{utils::apply_pubdata_to_memory, BootloaderState}, @@ -150,7 +151,7 @@ impl PubdataTracer { storage .storage_log_queries_after_timestamp(Timestamp(0)) .iter() - .map(|log| &log.log_query), + .map(|log| glue_log_query(log.log_query)), ) .1 .into_iter() diff --git a/core/lib/multivm/src/versions/vm_1_4_2/types/internals/vm_state.rs b/core/lib/multivm/src/versions/vm_1_4_2/types/internals/vm_state.rs index 52a0dc61d740..00833e4e5e89 100644 --- a/core/lib/multivm/src/versions/vm_1_4_2/types/internals/vm_state.rs +++ b/core/lib/multivm/src/versions/vm_1_4_2/types/internals/vm_state.rs @@ -1,4 +1,4 @@ -use circuit_sequencer_api_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; +use circuit_sequencer_api::INITIAL_MONOTONIC_CYCLE_COUNTER; use zk_evm_1_4_1::{ aux_structures::{MemoryPage, Timestamp}, block_properties::BlockProperties, diff --git a/core/lib/multivm/src/versions/vm_1_4_2/vm.rs b/core/lib/multivm/src/versions/vm_1_4_2/vm.rs index e7c8e7acdd95..ce649c221f39 100644 --- a/core/lib/multivm/src/versions/vm_1_4_2/vm.rs +++ b/core/lib/multivm/src/versions/vm_1_4_2/vm.rs @@ -1,6 +1,6 @@ use std::{mem, rc::Rc}; -use circuit_sequencer_api_1_4_2::sort_storage_access::sort_storage_access_queries; +use circuit_sequencer_api::sort_storage_access::sort_storage_access_queries; use zksync_types::{ l2_to_l1_log::{SystemL2ToL1Log, UserL2ToL1Log}, Transaction, @@ -15,7 +15,7 @@ use crate::{ FinishedL1Batch, L1BatchEnv, L2BlockEnv, PushTransactionResult, SystemEnv, VmExecutionMode, VmExecutionResultAndLogs, VmFactory, VmInterface, VmInterfaceHistoryEnabled, }, - utils::events::extract_l2tol1logs_from_l1_messenger, + utils::{events::extract_l2tol1logs_from_l1_messenger, glue_log_query}, vm_1_4_2::{ bootloader_state::BootloaderState, old_vm::events::merge_events, @@ -60,8 +60,12 @@ impl Vm { let storage_log_queries = self.state.storage.get_final_log_queries(); - let deduped_storage_log_queries = - sort_storage_access_queries(storage_log_queries.iter().map(|log| &log.log_query)).1; + let deduped_storage_log_queries = sort_storage_access_queries( + storage_log_queries + .iter() + .map(|log| glue_log_query(log.log_query)), + ) + .1; CurrentExecutionState { events, diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_capacity.rs b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_capacity.rs index a9e5e17e7973..bcc0ec48be0a 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_capacity.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_capacity.rs @@ -1,4 +1,4 @@ -use circuit_sequencer_api_1_4_0::{geometry_config::get_geometry_config, toolset::GeometryConfig}; +use circuit_sequencer_api::geometry_config::{GeometryConfig, ProtocolGeometry}; use crate::{interface::CircuitStatistic, utils::CircuitCycleStatistic}; @@ -40,7 +40,7 @@ pub(crate) const UMA_READ_RAM_CYCLES: u32 = 3; pub(crate) const PRECOMPILE_RAM_CYCLES: u32 = 1; pub(crate) const PRECOMPILE_LOG_DEMUXER_CYCLES: u32 = 1; -const GEOMETRY_CONFIG: GeometryConfig = get_geometry_config(); +const GEOMETRY_CONFIG: GeometryConfig = ProtocolGeometry::V1_4_0.config(); pub(crate) fn circuit_statistic_from_cycles(cycles: CircuitCycleStatistic) -> CircuitStatistic { CircuitStatistic { diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/pubdata_tracer.rs b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/pubdata_tracer.rs index 6396d143b401..c442f5705d2e 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/pubdata_tracer.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/pubdata_tracer.rs @@ -1,6 +1,6 @@ use std::marker::PhantomData; -use circuit_sequencer_api_1_4_0::sort_storage_access::sort_storage_access_queries; +use circuit_sequencer_api::sort_storage_access::sort_storage_access_queries; use zk_evm_1_4_0::{ aux_structures::Timestamp, tracing::{BeforeExecutionData, VmLocalStateData}, @@ -24,6 +24,7 @@ use crate::{ extract_bytecode_publication_requests_from_l1_messenger, extract_l2tol1logs_from_l1_messenger, }, + glue_log_query, }, vm_boojum_integration::{ bootloader_state::{utils::apply_pubdata_to_memory, BootloaderState}, @@ -121,7 +122,7 @@ impl PubdataTracer { storage .storage_log_queries_after_timestamp(Timestamp(0)) .iter() - .map(|log| &log.log_query), + .map(|log| glue_log_query(log.log_query)), ) .1 .into_iter() diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/types/internals/vm_state.rs b/core/lib/multivm/src/versions/vm_boojum_integration/types/internals/vm_state.rs index dc41926c4485..f225a91506ee 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/types/internals/vm_state.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/types/internals/vm_state.rs @@ -1,4 +1,4 @@ -use circuit_sequencer_api_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; +use circuit_sequencer_api::INITIAL_MONOTONIC_CYCLE_COUNTER; use zk_evm_1_4_0::{ aux_structures::{MemoryPage, Timestamp}, block_properties::BlockProperties, diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/vm.rs b/core/lib/multivm/src/versions/vm_boojum_integration/vm.rs index 43c9900486db..42129ab5a9e6 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/vm.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/vm.rs @@ -1,6 +1,6 @@ use std::rc::Rc; -use circuit_sequencer_api_1_4_0::sort_storage_access::sort_storage_access_queries; +use circuit_sequencer_api::sort_storage_access::sort_storage_access_queries; use zksync_types::{ l2_to_l1_log::{SystemL2ToL1Log, UserL2ToL1Log}, Transaction, @@ -15,7 +15,7 @@ use crate::{ FinishedL1Batch, L1BatchEnv, L2BlockEnv, PushTransactionResult, SystemEnv, VmExecutionMode, VmExecutionResultAndLogs, VmFactory, VmInterface, VmInterfaceHistoryEnabled, }, - utils::events::extract_l2tol1logs_from_l1_messenger, + utils::{events::extract_l2tol1logs_from_l1_messenger, glue_log_query}, vm_boojum_integration::{ bootloader_state::BootloaderState, old_vm::events::merge_events, @@ -60,8 +60,12 @@ impl Vm { let storage_log_queries = self.state.storage.get_final_log_queries(); - let deduped_storage_log_queries = - sort_storage_access_queries(storage_log_queries.iter().map(|log| &log.log_query)).1; + let deduped_storage_log_queries = sort_storage_access_queries( + storage_log_queries + .iter() + .map(|log| glue_log_query(log.log_query)), + ) + .1; CurrentExecutionState { events, diff --git a/core/lib/multivm/src/versions/vm_fast/bytecode.rs b/core/lib/multivm/src/versions/vm_fast/bytecode.rs index 4dc52951c16c..aec5ed9ae301 100644 --- a/core/lib/multivm/src/versions/vm_fast/bytecode.rs +++ b/core/lib/multivm/src/versions/vm_fast/bytecode.rs @@ -7,7 +7,7 @@ use crate::{ utils::bytecode, }; -impl Vm { +impl Vm { /// Checks the last transaction has successfully published compressed bytecodes and returns `true` if there is at least one is still unknown. pub(crate) fn has_unpublished_bytecodes(&mut self) -> bool { self.bootloader_state diff --git a/core/lib/multivm/src/versions/vm_fast/hook.rs b/core/lib/multivm/src/versions/vm_fast/hook.rs index 8d385f94f3e1..b138c6d496d9 100644 --- a/core/lib/multivm/src/versions/vm_fast/hook.rs +++ b/core/lib/multivm/src/versions/vm_fast/hook.rs @@ -1,8 +1,8 @@ -#[derive(Debug)] +#[derive(Debug, Copy, Clone)] pub(crate) enum Hook { AccountValidationEntered, PaymasterValidationEntered, - AccountValidationExited, + ValidationExited, ValidationStepEnded, TxHasEnded, DebugLog, @@ -22,7 +22,7 @@ impl Hook { match hook { 0 => Hook::AccountValidationEntered, 1 => Hook::PaymasterValidationEntered, - 2 => Hook::AccountValidationExited, + 2 => Hook::ValidationExited, 3 => Hook::ValidationStepEnded, 4 => Hook::TxHasEnded, 5 => Hook::DebugLog, diff --git a/core/lib/multivm/src/versions/vm_fast/mod.rs b/core/lib/multivm/src/versions/vm_fast/mod.rs index 840653b63b08..dca575138553 100644 --- a/core/lib/multivm/src/versions/vm_fast/mod.rs +++ b/core/lib/multivm/src/versions/vm_fast/mod.rs @@ -1,19 +1,21 @@ pub use zksync_vm2::interface; pub(crate) use self::version::FastVmVersion; -pub use self::vm::Vm; +pub use self::{ + tracers::{FullValidationTracer, ValidationTracer}, + vm::Vm, +}; mod bootloader_state; mod bytecode; -mod circuits_tracer; mod events; -mod evm_deploy_tracer; mod glue; mod hook; mod initial_bootloader_memory; mod refund; #[cfg(test)] mod tests; +mod tracers; mod transaction_data; mod utils; mod version; diff --git a/core/lib/multivm/src/versions/vm_fast/tests/account_validation_rules.rs b/core/lib/multivm/src/versions/vm_fast/tests/account_validation_rules.rs new file mode 100644 index 000000000000..fa4b634a22f6 --- /dev/null +++ b/core/lib/multivm/src/versions/vm_fast/tests/account_validation_rules.rs @@ -0,0 +1,7 @@ +use super::TestedFastVm; +use crate::versions::testonly::account_validation_rules::test_account_validation_rules; + +#[test] +fn test_account_validation_rules_fast() { + test_account_validation_rules::>(); +} diff --git a/core/lib/multivm/src/versions/vm_fast/tests/mod.rs b/core/lib/multivm/src/versions/vm_fast/tests/mod.rs index 2093d0ec496f..e148444922ba 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/mod.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/mod.rs @@ -1,22 +1,25 @@ use std::{any::Any, collections::HashSet, fmt, rc::Rc}; use zksync_types::{ - h256_to_u256, writes::StateDiffRecord, StorageKey, Transaction, H160, H256, U256, + h256_to_u256, l2::L2Tx, writes::StateDiffRecord, StorageKey, Transaction, H160, H256, U256, }; -use zksync_vm2::interface::{Event, HeapId, StateInterface}; +use zksync_vm2::interface::{Event, HeapId, StateInterface, Tracer}; use zksync_vm_interface::{ pubdata::{PubdataBuilder, PubdataInput}, storage::ReadStorage, - CurrentExecutionState, L2BlockEnv, VmExecutionMode, VmExecutionResultAndLogs, VmInterface, + tracer::ViolatedValidationRule, + CurrentExecutionState, InspectExecutionMode, L2BlockEnv, VmExecutionMode, + VmExecutionResultAndLogs, VmInterface, }; -use super::{circuits_tracer::CircuitsTracer, Vm}; +use super::{FullValidationTracer, ValidationTracer, Vm}; use crate::{ interface::storage::{ImmutableStorageView, InMemoryStorage}, - versions::testonly::TestedVm, - vm_fast::evm_deploy_tracer::{DynamicBytecodes, EvmDeployTracer}, + versions::testonly::{validation_params, TestedVm, TestedVmForValidation}, + vm_fast::tracers::WithBuiltinTracers, }; +mod account_validation_rules; mod block_tip; mod bootloader; mod bytecode_publishing; @@ -80,7 +83,13 @@ impl PartialEq for VmStateDump { } } -impl TestedVm for Vm> { +pub(crate) type TestedFastVm = Vm, Tr, Val>; + +impl TestedVm for TestedFastVm +where + Tr: 'static + Tracer + Default + fmt::Debug, + Val: 'static + ValidationTracer + fmt::Debug, +{ type StateDump = VmStateDump; fn dump_state(&self) -> Self::StateDump { @@ -126,13 +135,9 @@ impl TestedVm for Vm> { } fn manually_decommit(&mut self, code_hash: H256) -> bool { - let mut tracer = ( - ((), CircuitsTracer::default()), - EvmDeployTracer::new(DynamicBytecodes::default()), - ); let (_, is_fresh) = self.inner.world_diff_mut().decommit_opcode( &mut self.world, - &mut tracer, + &mut WithBuiltinTracers::mock(), h256_to_u256(code_hash), ); is_fresh @@ -174,3 +179,13 @@ impl TestedVm for Vm> { self.bootloader_state.get_pubdata_information().clone() } } + +impl TestedVmForValidation for Vm, (), FullValidationTracer> { + fn run_validation(&mut self, tx: L2Tx, timestamp: u64) -> Option { + let validation_params = validation_params(&tx, &self.system_env); + self.push_transaction(tx.into()); + let mut tracer = ((), FullValidationTracer::new(validation_params, timestamp)); + self.inspect(&mut tracer, InspectExecutionMode::OneTx); + tracer.1.validation_error() + } +} diff --git a/core/lib/multivm/src/versions/vm_fast/circuits_tracer.rs b/core/lib/multivm/src/versions/vm_fast/tracers/circuits.rs similarity index 97% rename from core/lib/multivm/src/versions/vm_fast/circuits_tracer.rs rename to core/lib/multivm/src/versions/vm_fast/tracers/circuits.rs index 9c1c0b7dfb7f..5acf6c490abf 100644 --- a/core/lib/multivm/src/versions/vm_fast/circuits_tracer.rs +++ b/core/lib/multivm/src/versions/vm_fast/tracers/circuits.rs @@ -1,4 +1,4 @@ -use circuit_sequencer_api_1_5_0::{geometry_config::get_geometry_config, toolset::GeometryConfig}; +use circuit_sequencer_api::geometry_config::{GeometryConfig, ProtocolGeometry}; use zksync_vm2::interface::{ CycleStats, GlobalStateInterface, Opcode, OpcodeType, ShouldStop, Tracer, }; @@ -164,4 +164,4 @@ impl CircuitsTracer { } } -const GEOMETRY_CONFIG: GeometryConfig = get_geometry_config(); +const GEOMETRY_CONFIG: GeometryConfig = ProtocolGeometry::V1_5_0.config(); diff --git a/core/lib/multivm/src/versions/vm_fast/evm_deploy_tracer.rs b/core/lib/multivm/src/versions/vm_fast/tracers/evm_deploy.rs similarity index 95% rename from core/lib/multivm/src/versions/vm_fast/evm_deploy_tracer.rs rename to core/lib/multivm/src/versions/vm_fast/tracers/evm_deploy.rs index ee139d941639..1202b5b94dd2 100644 --- a/core/lib/multivm/src/versions/vm_fast/evm_deploy_tracer.rs +++ b/core/lib/multivm/src/versions/vm_fast/tracers/evm_deploy.rs @@ -8,14 +8,14 @@ use zksync_vm2::interface::{ CallframeInterface, CallingMode, GlobalStateInterface, Opcode, OpcodeType, ShouldStop, Tracer, }; -use super::utils::read_fat_pointer; +use crate::vm_fast::utils::read_fat_pointer; /// Container for dynamic bytecodes added by [`EvmDeployTracer`]. #[derive(Debug, Clone, Default)] -pub(super) struct DynamicBytecodes(Rc>>>); +pub(crate) struct DynamicBytecodes(Rc>>>); impl DynamicBytecodes { - pub(super) fn map(&self, hash: U256, f: impl FnOnce(&[u8]) -> R) -> Option { + pub(crate) fn map(&self, hash: U256, f: impl FnOnce(&[u8]) -> R) -> Option { self.0.borrow().get(&hash).map(|code| f(code)) } diff --git a/core/lib/multivm/src/versions/vm_fast/tracers/mod.rs b/core/lib/multivm/src/versions/vm_fast/tracers/mod.rs new file mode 100644 index 000000000000..3d9602536743 --- /dev/null +++ b/core/lib/multivm/src/versions/vm_fast/tracers/mod.rs @@ -0,0 +1,86 @@ +//! Tracers for the fast VM. + +use zksync_vm2::interface::{CycleStats, GlobalStateInterface, OpcodeType, ShouldStop, Tracer}; + +pub(super) use self::evm_deploy::DynamicBytecodes; +pub use self::validation::{FullValidationTracer, ValidationTracer}; +use self::{circuits::CircuitsTracer, evm_deploy::EvmDeployTracer}; +use crate::interface::CircuitStatistic; + +mod circuits; +mod evm_deploy; +mod validation; + +#[derive(Debug)] +pub(super) struct WithBuiltinTracers { + pub external: Ext, + pub validation: Val, + circuits: CircuitsTracer, + evm_deploy_tracer: EvmDeployTracer, +} + +impl WithBuiltinTracers { + pub(super) fn new(external: Tr, validation: Val, dynamic_bytecodes: DynamicBytecodes) -> Self { + Self { + external, + validation, + circuits: CircuitsTracer::default(), + evm_deploy_tracer: EvmDeployTracer::new(dynamic_bytecodes), + } + } + + pub(super) fn circuit_statistic(&self) -> CircuitStatistic { + self.circuits.circuit_statistic() + } +} + +#[cfg(test)] +impl WithBuiltinTracers { + pub(super) fn mock() -> Self { + Self::new(Tr::default(), Val::default(), DynamicBytecodes::default()) + } +} + +impl Tracer for WithBuiltinTracers { + #[inline(always)] + fn before_instruction(&mut self, state: &mut S) { + self.validation.before_instruction::(state); + self.external.before_instruction::(state); + self.circuits.before_instruction::(state); + self.evm_deploy_tracer.before_instruction::(state); + } + + #[inline(always)] + fn after_instruction( + &mut self, + state: &mut S, + ) -> ShouldStop { + if matches!( + self.validation.after_instruction::(state), + ShouldStop::Stop + ) { + return ShouldStop::Stop; + } + if matches!( + self.external.after_instruction::(state), + ShouldStop::Stop + ) { + return ShouldStop::Stop; + } + if matches!( + self.circuits.after_instruction::(state), + ShouldStop::Stop + ) { + return ShouldStop::Stop; + } + self.evm_deploy_tracer.after_instruction::(state) + } + + #[inline(always)] + fn on_extra_prover_cycles(&mut self, stats: CycleStats) { + self.validation.on_extra_prover_cycles(stats); + self.external.on_extra_prover_cycles(stats); + self.circuits.on_extra_prover_cycles(stats); + self.evm_deploy_tracer.on_extra_prover_cycles(stats); + } +} diff --git a/core/lib/multivm/src/versions/vm_fast/tracers/validation.rs b/core/lib/multivm/src/versions/vm_fast/tracers/validation.rs new file mode 100644 index 000000000000..52b0a4747b7d --- /dev/null +++ b/core/lib/multivm/src/versions/vm_fast/tracers/validation.rs @@ -0,0 +1,296 @@ +use std::collections::HashSet; + +use zk_evm_1_3_1::address_to_u256; +use zksync_types::{ + u256_to_address, Address, ACCOUNT_CODE_STORAGE_ADDRESS, BOOTLOADER_ADDRESS, + CONTRACT_DEPLOYER_ADDRESS, KECCAK256_PRECOMPILE_ADDRESS, L2_BASE_TOKEN_ADDRESS, + MSG_VALUE_SIMULATOR_ADDRESS, SYSTEM_CONTEXT_ADDRESS, U256, +}; +use zksync_vm2::interface::{ + CallframeInterface, GlobalStateInterface, Opcode::*, OpcodeType, ReturnType::*, ShouldStop, + Tracer, +}; +use zksync_vm_interface::tracer::{ + TimestampAsserterParams, ValidationParams, ValidationTraces, ViolatedValidationRule, +}; + +use crate::{tracers::TIMESTAMP_ASSERTER_FUNCTION_SELECTOR, vm_fast::utils::read_fat_pointer}; + +/// [`Tracer`] used for account validation per [EIP-4337] and [EIP-7562]. +/// +/// [EIP-4337]: https://eips.ethereum.org/EIPS/eip-4337 +/// [EIP-7562]: https://eips.ethereum.org/EIPS/eip-7562 +pub trait ValidationTracer: Tracer + Default { + /// Should the execution stop after validation is complete? + const STOP_AFTER_VALIDATION: bool; + /// Hook called when account validation is entered. + fn account_validation_entered(&mut self); + /// Hook called when account validation is exited. + fn validation_exited(&mut self); +} + +impl ValidationTracer for () { + const STOP_AFTER_VALIDATION: bool = false; + fn account_validation_entered(&mut self) {} + fn validation_exited(&mut self) {} +} + +/// Account abstraction exposes a chain to denial of service attacks because someone who fails to +/// authenticate does not pay for the failed transaction. Otherwise, people could empty other's +/// wallets for free! +/// +/// If some address repeatedly posts transactions that validate during preliminary checks but fail +/// to validate during the actual execution, that address is considered a spammer. However, when +/// the spam comes from multiple addresses, that doesn't work. +/// +/// We want to ensure that a spammer has to pay for every account that fails validation. This is +/// achieved by limiting what the code of a custom account is allowed to do. If we allowed access +/// to things like time, a validation that fails in the sequencer could be crafted for free, so we +/// don't. +/// +/// However, we want to give access to storage. A spammer has to pay for changing storage but +/// could change just one storage slot to invalidate transactions from many accounts. To prevent +/// that, we make sure that the storage slots accessed by different accounts are disjoint by only +/// allowing access to storage in the account itself and slots derived from the account's address. +/// +/// Our rules are an extension of the rules are outlined in [EIP-7562]. +/// +/// This tracer enforces the rules by checking what the code does at runtime, even though the +/// properties checked are supposed to always hold for a well-written custom account. Proving +/// that a contract adheres to the rules ahead of time would be challenging or even impossible, +/// considering that contracts that the code depends on may get upgraded. +/// +/// [EIP-7562]: https://eips.ethereum.org/EIPS/eip-7562 +#[derive(Debug, Default)] +pub struct FullValidationTracer { + in_validation: bool, + add_return_value_to_allowed_slots: bool, + + slots_obtained_via_keccak: HashSet, + trusted_addresses: HashSet
, + + user_address: Address, + trusted_storage: HashSet<(Address, U256)>, + /// These location's values are added to [Self::trusted_addresses] to support upgradeable proxies. + storage_containing_trusted_addresses: HashSet<(Address, U256)>, + timestamp_asserter_params: Option, + l1_batch_timestamp: u64, + + validation_error: Option, + traces: ValidationTraces, +} + +impl ValidationTracer for FullValidationTracer { + const STOP_AFTER_VALIDATION: bool = true; + + fn account_validation_entered(&mut self) { + self.in_validation = true; + } + + fn validation_exited(&mut self) { + self.in_validation = false; + } +} + +impl Tracer for FullValidationTracer { + fn before_instruction(&mut self, state: &mut S) { + if !self.in_validation { + return; + } + + match OP::VALUE { + // Out of gas once means out of gas for the whole validation, as the EIP forbids handling out of gas errors + Ret(Panic) if state.current_frame().gas() == 0 => { + self.set_error(ViolatedValidationRule::TookTooManyComputationalGas(0)) + } + + ContextMeta => self.set_error(ViolatedValidationRule::TouchedDisallowedContext), + + StorageRead => { + let address = state.current_frame().address(); + let caller = state.current_frame().caller(); + + // Can unwrap because the instruction pointer does not point to a panic instruction + let pc = state.current_frame().program_counter().unwrap(); + let word = pc / 4; + let part = pc % 4; + let instruction = + state.current_frame().read_contract_code(word).0[3 - part as usize]; + let slot = state.read_register((instruction >> 16) as u8 & 0b1111).0; + + if self + .storage_containing_trusted_addresses + .contains(&(address, slot)) + { + self.trusted_addresses + .insert(u256_to_address(&state.get_storage(address, slot))); + } else if !self.is_valid_storage_read( + address, + caller, + slot, + state.get_storage(address, slot), + ) { + self.set_error(ViolatedValidationRule::TouchedDisallowedStorageSlots( + address, slot, + )) + } + } + + _ => {} + } + } + + fn after_instruction( + &mut self, + state: &mut S, + ) -> ShouldStop { + if !self.in_validation { + return ShouldStop::Continue; + } + + if self.validation_error.is_some() { + return ShouldStop::Stop; + } + + match OP::VALUE { + FarCall(_) => { + // Intercept calls to keccak, whitelist storage slots corresponding to the hash + let code_address = state.current_frame().code_address(); + if code_address == KECCAK256_PRECOMPILE_ADDRESS { + let calldata = read_fat_pointer(state, state.read_register(1).0); + if calldata.len() != 64 { + return ShouldStop::Continue; + } + + // Solidity mappings store values at the keccak256 hash of `key ++ slot_of_mapping` + let (key, mapping) = calldata.split_at(32); + + let mapping_is_allowed = + self.slots_obtained_via_keccak.contains(&mapping.into()); + + if U256::from(key) == address_to_u256(&self.user_address) || mapping_is_allowed + { + self.add_return_value_to_allowed_slots = true; + } + } else if code_address != self.user_address + && state + .get_storage(ACCOUNT_CODE_STORAGE_ADDRESS, address_to_u256(&code_address)) + .is_zero() + { + self.set_error(ViolatedValidationRule::CalledContractWithNoCode( + code_address, + )); + return ShouldStop::Stop; + } + + if let Some(ref params) = self.timestamp_asserter_params { + if code_address == params.address { + let calldata = read_fat_pointer(state, state.read_register(1).0); + if calldata.len() == 68 + && calldata[..4] == TIMESTAMP_ASSERTER_FUNCTION_SELECTOR + { + // start and end need to be capped to u64::MAX to avoid overflow + let start = U256::from_big_endian( + &calldata[calldata.len() - 64..calldata.len() - 32], + ) + .try_into() + .unwrap_or(u64::MAX); + let end = U256::from_big_endian(&calldata[calldata.len() - 32..]) + .try_into() + .unwrap_or(u64::MAX); + + // using self.l1_batch_env.timestamp is ok here because the tracer is always + // used in a oneshot execution mode + if end < self.l1_batch_timestamp + params.min_time_till_end.as_secs() { + self.set_error( + ViolatedValidationRule::TimestampAssertionCloseToRangeEnd, + ); + return ShouldStop::Stop; + } + + self.traces.apply_timestamp_asserter_range(start..end); + } + } + } + } + Ret(kind) => { + if self.add_return_value_to_allowed_slots && kind == Normal { + let return_value = read_fat_pointer(state, state.read_register(1).0); + self.slots_obtained_via_keccak + .insert(return_value.as_slice().into()); + } + self.add_return_value_to_allowed_slots = false; + } + _ => {} + } + + ShouldStop::Continue + } +} + +impl FullValidationTracer { + pub fn new(params: ValidationParams, l1_batch_timestamp: u64) -> Self { + let ValidationParams { + user_address, + trusted_slots, + trusted_addresses, + trusted_address_slots, + timestamp_asserter_params, + .. + } = params; + Self { + user_address, + trusted_storage: trusted_slots, + trusted_addresses, + storage_containing_trusted_addresses: trusted_address_slots, + l1_batch_timestamp, + timestamp_asserter_params, + + ..Self::default() + } + } + + fn is_valid_storage_read( + &self, + address: Address, + caller: Address, + slot: U256, + value: U256, + ) -> bool { + // allow reading own slots + address == self.user_address + // allow reading slot + || slot == address_to_u256(&self.user_address) + || self.slots_obtained_via_keccak.contains(&slot) + // some storage locations are always allowed + || self.trusted_addresses.contains(&address) + || self.trusted_storage.contains(&(address, slot)) + // certain system contracts are allowed to transfer ETH + || address == L2_BASE_TOKEN_ADDRESS + && (caller == MSG_VALUE_SIMULATOR_ADDRESS + || caller == CONTRACT_DEPLOYER_ADDRESS + || caller == BOOTLOADER_ADDRESS) + // allow getting chain_id + || address == SYSTEM_CONTEXT_ADDRESS && slot == U256::zero() + // allow reading code hashes of existing contracts + || address == ACCOUNT_CODE_STORAGE_ADDRESS && !value.is_zero() + // allow TimestampAsserter to do its job + || self.timestamp_asserter_params.as_ref() + .map(|p| p.address == caller) + .unwrap_or_default() + } + + fn set_error(&mut self, error: ViolatedValidationRule) { + if self.validation_error.is_none() { + self.validation_error = Some(error); + } + } + + pub fn validation_error(&self) -> Option { + self.validation_error.clone() + } + + pub fn traces(&self) -> ValidationTraces { + self.traces.clone() + } +} diff --git a/core/lib/multivm/src/versions/vm_fast/vm.rs b/core/lib/multivm/src/versions/vm_fast/vm.rs index c935b1c0e7f5..e2310c254e96 100644 --- a/core/lib/multivm/src/versions/vm_fast/vm.rs +++ b/core/lib/multivm/src/versions/vm_fast/vm.rs @@ -27,10 +27,9 @@ use zksync_vm2::{ use super::{ bootloader_state::{BootloaderState, BootloaderStateSnapshot}, bytecode::compress_bytecodes, - circuits_tracer::CircuitsTracer, - evm_deploy_tracer::{DynamicBytecodes, EvmDeployTracer}, hook::Hook, initial_bootloader_memory::bootloader_initial_memory, + tracers::{DynamicBytecodes, ValidationTracer, WithBuiltinTracers}, transaction_data::TransactionData, }; use crate::{ @@ -58,8 +57,6 @@ use crate::{ VmVersion, }; -type FullTracer = ((Tr, CircuitsTracer), EvmDeployTracer); - #[derive(Debug)] struct VmRunResult { execution_result: ExecutionResult, @@ -85,15 +82,18 @@ impl VmRunResult { } } +type InnerVm = + VirtualMachine, World>>; + /// Fast VM wrapper. /// -/// The wrapper is parametric by the storage and tracer types. Besides the [`Tracer`] trait, a tracer must have `'static` lifetime -/// and implement [`Default`] (the latter is necessary to complete batches). [`CircuitsTracer`] is currently always enabled; -/// you don't need to specify it explicitly. -pub struct Vm { - pub(super) world: World>, - pub(super) inner: VirtualMachine, World>>, - gas_for_account_validation: u32, +/// The wrapper is parametric by the storage and tracer types. Besides the [`Tracer`] trait, the tracer must implement [`Default`] +/// (the latter is necessary to complete batches). Validation is encapsulated in a separate type param. It should be set to `()` +/// for "standard" validation (not stopping after validation; no validation-specific checks), or [`FullValidationTracer`](super::FullValidationTracer) +/// for full validation (stopping after validation; validation-specific checks). +pub struct Vm { + pub(super) world: World>, + pub(super) inner: InnerVm, pub(super) bootloader_state: BootloaderState, pub(super) batch_env: L1BatchEnv, pub(super) system_env: SystemEnv, @@ -103,7 +103,7 @@ pub struct Vm { enforced_state_diffs: Option>, } -impl Vm { +impl Vm { pub fn custom(batch_env: L1BatchEnv, system_env: SystemEnv, storage: S) -> Self { let vm_version: FastVmVersion = VmVersion::from(system_env.version) .try_into() @@ -161,7 +161,6 @@ impl Vm { let mut this = Self { world: World::new(storage, program_cache), inner, - gas_for_account_validation: system_env.default_validation_computational_gas_limit, bootloader_state: BootloaderState::new( system_env.execution_mode, bootloader_memory.clone(), @@ -179,13 +178,218 @@ impl Vm { this } + fn get_hook_params(&self) -> [U256; 3] { + (get_vm_hook_params_start_position(self.vm_version.into()) + ..get_vm_hook_params_start_position(self.vm_version.into()) + VM_HOOK_PARAMS_COUNT) + .map(|word| self.read_word_from_bootloader_heap(word as usize)) + .collect::>() + .try_into() + .unwrap() + } + + fn get_tx_result(&self) -> U256 { + let tx_idx = self.bootloader_state.current_tx(); + let slot = get_result_success_first_slot(self.vm_version.into()) as usize + tx_idx; + self.read_word_from_bootloader_heap(slot) + } + + fn get_debug_log(&self) -> (String, String) { + let hook_params = self.get_hook_params(); + let mut msg = u256_to_h256(hook_params[0]).as_bytes().to_vec(); + // Trim 0 byte padding at the end. + while msg.last() == Some(&0) { + msg.pop(); + } + + let data = hook_params[1]; + let msg = String::from_utf8(msg).expect("Invalid debug message"); + + // For long data, it is better to use hex-encoding for greater readability + let data_str = if data > U256::from(u64::MAX) { + format!("0x{data:x}") + } else { + data.to_string() + }; + (msg, data_str) + } + + /// Should only be used when the bootloader is executing (e.g., when handling hooks). + pub(crate) fn read_word_from_bootloader_heap(&self, word: usize) -> U256 { + let start_address = word as u32 * 32; + self.inner.read_heap_u256(HeapId::FIRST, start_address) + } + + fn read_bytes_from_heap(&self, ptr: FatPointer) -> Vec { + assert_eq!(ptr.offset, 0); + (ptr.start..ptr.start + ptr.length) + .map(|addr| self.inner.read_heap_byte(ptr.memory_page, addr)) + .collect() + } + + pub(crate) fn has_previous_far_calls(&mut self) -> bool { + let callframe_count = self.inner.number_of_callframes(); + (1..callframe_count).any(|i| !self.inner.callframe(i).is_near_call()) + } + + /// Should only be used when the bootloader is executing (e.g., when handling hooks). + pub(crate) fn write_to_bootloader_heap( + &mut self, + memory: impl IntoIterator, + ) { + assert!( + !self.has_previous_far_calls(), + "Cannot write to bootloader heap when not in root call frame" + ); + + for (slot, value) in memory { + let start_address = slot as u32 * 32; + self.inner + .write_heap_u256(HeapId::FIRST, start_address, value); + } + } + + pub(crate) fn insert_bytecodes<'a>(&mut self, bytecodes: impl IntoIterator) { + for code in bytecodes { + let hash = BytecodeHash::for_bytecode(code).value_u256(); + self.world.bytecode_cache.insert(hash, code.into()); + } + } + + pub(crate) fn push_transaction_inner( + &mut self, + tx: zksync_types::Transaction, + refund: u64, + with_compression: bool, + ) { + let tx: TransactionData = tx.into(); + let overhead = tx.overhead_gas(); + + self.insert_bytecodes(tx.factory_deps.iter().map(|dep| &dep[..])); + + let compressed_bytecodes = if is_l1_tx_type(tx.tx_type) || !with_compression { + // L1 transactions do not need compression + vec![] + } else { + compress_bytecodes(&tx.factory_deps, |hash| { + self.inner + .world_diff() + .get_storage_state() + .get(&(KNOWN_CODES_STORAGE_ADDRESS, h256_to_u256(hash))) + .map(|x| !x.is_zero()) + .unwrap_or_else(|| self.world.storage.is_bytecode_known(&hash)) + }) + }; + + let trusted_ergs_limit = tx.trusted_ergs_limit(); + + let memory = self.bootloader_state.push_tx( + tx, + overhead, + refund, + compressed_bytecodes, + trusted_ergs_limit, + self.system_env.chain_id, + ); + + self.write_to_bootloader_heap(memory); + } + + #[cfg(test)] + pub(super) fn enforce_state_diffs(&mut self, diffs: Vec) { + self.enforced_state_diffs = Some(diffs); + } + + fn compute_state_diffs(&mut self) -> Vec { + #[cfg(test)] + if let Some(enforced_diffs) = self.enforced_state_diffs.take() { + return enforced_diffs; + } + + let storage = &mut self.world.storage; + let diffs = + self.inner + .world_diff() + .get_storage_changes() + .map(move |((address, key), change)| { + let storage_key = + StorageKey::new(AccountTreeId::new(address), u256_to_h256(key)); + StateDiffRecord { + address, + key, + derived_key: LogQuery::derive_final_address_for_params(&address, &key), + enumeration_index: storage + .get_enumeration_index(&storage_key) + .unwrap_or_default(), + initial_value: change.before, + final_value: change.after, + } + }); + diffs + .filter(|diff| diff.address != L1_MESSENGER_ADDRESS) + .collect() + } + + pub(crate) fn decommitted_hashes(&self) -> impl Iterator + '_ { + self.inner.world_diff().decommitted_hashes() + } + + pub(super) fn gas_remaining(&mut self) -> u32 { + self.inner.current_frame().gas() + } + + // visible for testing + pub(super) fn get_current_execution_state(&self) -> CurrentExecutionState { + let world_diff = self.inner.world_diff(); + let vm = &self.inner; + let events = merge_events(vm.events(), self.batch_env.number); + + let user_l2_to_l1_logs = extract_l2tol1logs_from_l1_messenger(&events) + .into_iter() + .map(Into::into) + .map(UserL2ToL1Log) + .collect(); + + CurrentExecutionState { + events, + deduplicated_storage_logs: world_diff + .get_storage_changes() + .map(|((address, key), change)| StorageLog { + key: StorageKey::new(AccountTreeId::new(address), u256_to_h256(key)), + value: u256_to_h256(change.after), + kind: StorageLogKind::RepeatedWrite, // Initialness doesn't matter here + }) + .collect(), + used_contract_hashes: self.decommitted_hashes().collect(), + system_logs: vm.l2_to_l1_logs().map(GlueInto::glue_into).collect(), + user_l2_to_l1_logs, + storage_refunds: world_diff.storage_refunds().to_vec(), + pubdata_costs: world_diff.pubdata_costs().to_vec(), + } + } +} + +struct AccountValidationGasSplit { + gas_given: u32, + gas_hidden: u32, +} + +impl Vm +where + S: ReadStorage, + Tr: Tracer + Default, + Val: ValidationTracer, +{ fn run( &mut self, execution_mode: VmExecutionMode, - tracer: &mut FullTracer, + tracer: &mut WithBuiltinTracers, track_refunds: bool, pubdata_builder: Option<&dyn PubdataBuilder>, ) -> VmRunResult { + let mut gas_left_for_account_validation = + self.system_env.default_validation_computational_gas_limit; + let mut account_validation_gas_split = None; + let mut refunds = Refunds { gas_refunded: 0, operator_suggested_refund: 0, @@ -227,10 +431,47 @@ impl Vm { } }; - match Hook::from_u32(hook) { - Hook::AccountValidationEntered | Hook::AccountValidationExited => { - // TODO (PLA-908): implement account validation + let hook = Hook::from_u32(hook); + match hook { + Hook::AccountValidationEntered => { + assert!( + account_validation_gas_split.is_none(), + "Account validation can't be nested" + ); + tracer.validation.account_validation_entered(); + + let gas = self.gas_remaining(); + let gas_given = gas.min(gas_left_for_account_validation); + account_validation_gas_split = Some(AccountValidationGasSplit { + gas_given, + gas_hidden: gas - gas_given, + }); + // As long as gasleft is allowed during account validation, + // the VM must not be used in the sequencer because a malicious + // account cause proving failure by checking if gasleft > 100k + self.inner.current_frame().set_gas(gas_given); + } + + Hook::ValidationExited => { + tracer.validation.validation_exited(); + + if let Some(AccountValidationGasSplit { + gas_given, + gas_hidden, + }) = account_validation_gas_split.take() + { + let gas_left = self.inner.current_frame().gas(); + gas_left_for_account_validation -= gas_given - gas_left; + self.inner.current_frame().set_gas(gas_left + gas_hidden); + } } + + Hook::ValidationStepEnded => { + if Val::STOP_AFTER_VALIDATION { + break (ExecutionResult::Success { output: vec![] }, true); + } + } + Hook::TxHasEnded => { if let VmExecutionMode::OneTx = execution_mode { // The bootloader may invoke `TxHasEnded` hook without posting a tx result previously. One case when this can happen @@ -355,6 +596,10 @@ impl Vm { state_diffs: self.compute_state_diffs(), }; + // Save the pubdata for the future initial bootloader memory building + self.bootloader_state + .set_pubdata_input(pubdata_input.clone()); + // Apply the pubdata to the current memory let mut memory_to_apply = vec![]; @@ -365,12 +610,9 @@ impl Vm { self.system_env.version, ); self.write_to_bootloader_heap(memory_to_apply); - - // Save the pubdata for the future initial bootloader memory building - self.bootloader_state.set_pubdata_input(pubdata_input); } - Hook::PaymasterValidationEntered | Hook::ValidationStepEnded => { /* unused */ } + Hook::PaymasterValidationEntered => { /* unused */ } Hook::DebugLog => { let (log, log_arg) = self.get_debug_log(); let last_tx = self.bootloader_state.last_l2_block().txs.last(); @@ -391,198 +633,9 @@ impl Vm { } } - fn get_hook_params(&self) -> [U256; 3] { - (get_vm_hook_params_start_position(self.vm_version.into()) - ..get_vm_hook_params_start_position(self.vm_version.into()) + VM_HOOK_PARAMS_COUNT) - .map(|word| self.read_word_from_bootloader_heap(word as usize)) - .collect::>() - .try_into() - .unwrap() - } - - fn get_tx_result(&self) -> U256 { - let tx_idx = self.bootloader_state.current_tx(); - let slot = get_result_success_first_slot(self.vm_version.into()) as usize + tx_idx; - self.read_word_from_bootloader_heap(slot) - } - - fn get_debug_log(&self) -> (String, String) { - let hook_params = self.get_hook_params(); - let mut msg = u256_to_h256(hook_params[0]).as_bytes().to_vec(); - // Trim 0 byte padding at the end. - while msg.last() == Some(&0) { - msg.pop(); - } - - let data = hook_params[1]; - let msg = String::from_utf8(msg).expect("Invalid debug message"); - - // For long data, it is better to use hex-encoding for greater readability - let data_str = if data > U256::from(u64::MAX) { - format!("0x{data:x}") - } else { - data.to_string() - }; - (msg, data_str) - } - - /// Should only be used when the bootloader is executing (e.g., when handling hooks). - pub(crate) fn read_word_from_bootloader_heap(&self, word: usize) -> U256 { - let start_address = word as u32 * 32; - self.inner.read_heap_u256(HeapId::FIRST, start_address) - } - - fn read_bytes_from_heap(&self, ptr: FatPointer) -> Vec { - assert_eq!(ptr.offset, 0); - (ptr.start..ptr.start + ptr.length) - .map(|addr| self.inner.read_heap_byte(ptr.memory_page, addr)) - .collect() - } - - pub(crate) fn has_previous_far_calls(&mut self) -> bool { - let callframe_count = self.inner.number_of_callframes(); - (1..callframe_count).any(|i| !self.inner.callframe(i).is_near_call()) - } - - /// Should only be used when the bootloader is executing (e.g., when handling hooks). - pub(crate) fn write_to_bootloader_heap( - &mut self, - memory: impl IntoIterator, - ) { - assert!( - !self.has_previous_far_calls(), - "Cannot write to bootloader heap when not in root call frame" - ); - - for (slot, value) in memory { - let start_address = slot as u32 * 32; - self.inner - .write_heap_u256(HeapId::FIRST, start_address, value); - } - } - - pub(crate) fn insert_bytecodes<'a>(&mut self, bytecodes: impl IntoIterator) { - for code in bytecodes { - let hash = BytecodeHash::for_bytecode(code).value_u256(); - self.world.bytecode_cache.insert(hash, code.into()); - } - } - - pub(crate) fn push_transaction_inner( - &mut self, - tx: zksync_types::Transaction, - refund: u64, - with_compression: bool, - ) { - let tx: TransactionData = tx.into(); - let overhead = tx.overhead_gas(); - - self.insert_bytecodes(tx.factory_deps.iter().map(|dep| &dep[..])); - - let compressed_bytecodes = if is_l1_tx_type(tx.tx_type) || !with_compression { - // L1 transactions do not need compression - vec![] - } else { - compress_bytecodes(&tx.factory_deps, |hash| { - self.inner - .world_diff() - .get_storage_state() - .get(&(KNOWN_CODES_STORAGE_ADDRESS, h256_to_u256(hash))) - .map(|x| !x.is_zero()) - .unwrap_or_else(|| self.world.storage.is_bytecode_known(&hash)) - }) - }; - - let trusted_ergs_limit = tx.trusted_ergs_limit(); - - let memory = self.bootloader_state.push_tx( - tx, - overhead, - refund, - compressed_bytecodes, - trusted_ergs_limit, - self.system_env.chain_id, - ); - - self.write_to_bootloader_heap(memory); - } - - #[cfg(test)] - pub(super) fn enforce_state_diffs(&mut self, diffs: Vec) { - self.enforced_state_diffs = Some(diffs); - } - - fn compute_state_diffs(&mut self) -> Vec { - #[cfg(test)] - if let Some(enforced_diffs) = self.enforced_state_diffs.take() { - return enforced_diffs; - } - - let storage = &mut self.world.storage; - let diffs = - self.inner - .world_diff() - .get_storage_changes() - .map(move |((address, key), change)| { - let storage_key = - StorageKey::new(AccountTreeId::new(address), u256_to_h256(key)); - StateDiffRecord { - address, - key, - derived_key: LogQuery::derive_final_address_for_params(&address, &key), - enumeration_index: storage - .get_enumeration_index(&storage_key) - .unwrap_or_default(), - initial_value: change.before, - final_value: change.after, - } - }); - diffs - .filter(|diff| diff.address != L1_MESSENGER_ADDRESS) - .collect() - } - - pub(crate) fn decommitted_hashes(&self) -> impl Iterator + '_ { - self.inner.world_diff().decommitted_hashes() - } - - pub(super) fn gas_remaining(&mut self) -> u32 { - self.inner.current_frame().gas() - } - - // visible for testing - pub(super) fn get_current_execution_state(&self) -> CurrentExecutionState { - let world_diff = self.inner.world_diff(); - let vm = &self.inner; - let events = merge_events(vm.events(), self.batch_env.number); - - let user_l2_to_l1_logs = extract_l2tol1logs_from_l1_messenger(&events) - .into_iter() - .map(Into::into) - .map(UserL2ToL1Log) - .collect(); - - CurrentExecutionState { - events, - deduplicated_storage_logs: world_diff - .get_storage_changes() - .map(|((address, key), change)| StorageLog { - key: StorageKey::new(AccountTreeId::new(address), u256_to_h256(key)), - value: u256_to_h256(change.after), - kind: StorageLogKind::RepeatedWrite, // Initialness doesn't matter here - }) - .collect(), - used_contract_hashes: self.decommitted_hashes().collect(), - system_logs: vm.l2_to_l1_logs().map(GlueInto::glue_into).collect(), - user_l2_to_l1_logs, - storage_refunds: world_diff.storage_refunds().to_vec(), - pubdata_costs: world_diff.pubdata_costs().to_vec(), - } - } - pub(crate) fn inspect_inner( &mut self, - tracer: &mut Tr, + tracer: &mut (Tr, Val), execution_mode: VmExecutionMode, pubdata_builder: Option<&dyn PubdataBuilder>, ) -> VmExecutionResultAndLogs { @@ -595,19 +648,18 @@ impl Vm { let start = self.inner.world_diff().snapshot(); let gas_before = self.gas_remaining(); + let (external, validation) = mem::take(tracer); + let mut full_tracer = + WithBuiltinTracers::new(external, validation, self.world.dynamic_bytecodes.clone()); - let mut full_tracer = ( - (mem::take(tracer), CircuitsTracer::default()), - EvmDeployTracer::new(self.world.dynamic_bytecodes.clone()), - ); let result = self.run( execution_mode, &mut full_tracer, track_refunds, pubdata_builder, ); - let ((external_tracer, circuits_tracer), _) = full_tracer; - *tracer = external_tracer; // place the tracer back + let circuit_statistic = full_tracer.circuit_statistic(); + *tracer = (full_tracer.external, full_tracer.validation); let ignore_world_diff = matches!(execution_mode, VmExecutionMode::OneTx) && result.should_ignore_vm_logs(); @@ -680,7 +732,7 @@ impl Vm { gas_remaining, computational_gas_used: gas_used, // since 1.5.0, this always has the same value as `gas_used` pubdata_published: result.pubdata_published, - circuit_statistic: circuits_tracer.circuit_statistic(), + circuit_statistic, contracts_used: 0, cycles_used: 0, total_log_queries: 0, @@ -691,10 +743,11 @@ impl Vm { } } -impl VmFactory> for Vm, Tr> +impl VmFactory> for Vm, Tr, Val> where S: ReadStorage, - Tr: Tracer + Default + 'static, + Tr: Tracer + Default, + Val: ValidationTracer, { fn new( batch_env: L1BatchEnv, @@ -706,8 +759,13 @@ where } } -impl VmInterface for Vm { - type TracerDispatcher = Tr; +impl VmInterface for Vm +where + S: ReadStorage, + Tr: Tracer + Default, + Val: ValidationTracer, +{ + type TracerDispatcher = (Tr, Val); fn push_transaction(&mut self, tx: Transaction) -> PushTransactionResult<'_> { self.push_transaction_inner(tx, 0, true); @@ -730,7 +788,7 @@ impl VmInterface for Vm { fn inspect_transaction_with_bytecode_compression( &mut self, tracer: &mut Self::TracerDispatcher, - tx: zksync_types::Transaction, + tx: Transaction, with_compression: bool, ) -> (BytecodeCompressionResult<'_>, VmExecutionResultAndLogs) { self.push_transaction_inner(tx, 0, with_compression); @@ -753,7 +811,7 @@ impl VmInterface for Vm { fn finish_batch(&mut self, pubdata_builder: Rc) -> FinishedL1Batch { let result = self.inspect_inner( - &mut Tr::default(), + &mut Default::default(), VmExecutionMode::Batch, Some(pubdata_builder.as_ref()), ); @@ -782,10 +840,14 @@ impl VmInterface for Vm { #[derive(Debug)] struct VmSnapshot { bootloader_snapshot: BootloaderStateSnapshot, - gas_for_account_validation: u32, } -impl VmInterfaceHistoryEnabled for Vm { +impl VmInterfaceHistoryEnabled for Vm +where + S: ReadStorage, + Tr: Tracer + Default, + Val: ValidationTracer, +{ fn make_snapshot(&mut self) { assert!( self.snapshot.is_none(), @@ -795,19 +857,16 @@ impl VmInterfaceHistoryEnabled f self.inner.make_snapshot(); self.snapshot = Some(VmSnapshot { bootloader_snapshot: self.bootloader_state.get_snapshot(), - gas_for_account_validation: self.gas_for_account_validation, }); } fn rollback_to_the_latest_snapshot(&mut self) { let VmSnapshot { bootloader_snapshot, - gas_for_account_validation, } = self.snapshot.take().expect("no snapshots to rollback to"); self.inner.rollback(); self.bootloader_state.apply_snapshot(bootloader_snapshot); - self.gas_for_account_validation = gas_for_account_validation; } fn pop_snapshot_no_rollback(&mut self) { @@ -816,19 +875,18 @@ impl VmInterfaceHistoryEnabled f } } -impl VmTrackingContracts for Vm { +impl VmTrackingContracts for Vm +where + Self: VmInterface, +{ fn used_contract_hashes(&self) -> Vec { self.decommitted_hashes().map(u256_to_h256).collect() } } -impl fmt::Debug for Vm { +impl fmt::Debug for Vm { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Vm") - .field( - "gas_for_account_validation", - &self.gas_for_account_validation, - ) .field("bootloader_state", &self.bootloader_state) .field("storage", &self.world.storage) .field("program_cache", &self.world.program_cache) diff --git a/core/lib/multivm/src/versions/vm_latest/constants.rs b/core/lib/multivm/src/versions/vm_latest/constants.rs index c95771f9e849..1578965d7a66 100644 --- a/core/lib/multivm/src/versions/vm_latest/constants.rs +++ b/core/lib/multivm/src/versions/vm_latest/constants.rs @@ -1,4 +1,4 @@ -use circuit_sequencer_api_1_5_0::{BLOB_CHUNK_SIZE, ELEMENTS_PER_4844_BLOCK}; +use circuit_sequencer_api::{BLOB_CHUNK_SIZE, ELEMENTS_PER_4844_BLOCK}; use zk_evm_1_5_0::aux_structures::MemoryPage; pub use zk_evm_1_5_0::zkevm_opcode_defs::system_params::{ ERGS_PER_CIRCUIT, INITIAL_STORAGE_WRITE_PUBDATA_BYTES, diff --git a/core/lib/multivm/src/versions/vm_latest/tests/account_validation_rules.rs b/core/lib/multivm/src/versions/vm_latest/tests/account_validation_rules.rs new file mode 100644 index 000000000000..8ee6c06c1c69 --- /dev/null +++ b/core/lib/multivm/src/versions/vm_latest/tests/account_validation_rules.rs @@ -0,0 +1,8 @@ +use crate::{ + versions::testonly::account_validation_rules::test_account_validation_rules, vm_latest::Vm, +}; + +#[test] +fn test_account_validation_rules_legacy() { + test_account_validation_rules::>(); +} diff --git a/core/lib/multivm/src/versions/vm_latest/tests/mod.rs b/core/lib/multivm/src/versions/vm_latest/tests/mod.rs index aac3b1655b3a..0a89ddb0bf50 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/mod.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/mod.rs @@ -1,6 +1,7 @@ use std::{ collections::{HashMap, HashSet}, rc::Rc, + sync::Arc, }; use zk_evm_1_5_0::{ @@ -9,19 +10,24 @@ use zk_evm_1_5_0::{ zkevm_opcode_defs::{ContractCodeSha256Format, VersionedHashLen32}, }; use zksync_types::{ - bytecode::BytecodeHash, writes::StateDiffRecord, StorageKey, StorageValue, Transaction, H256, - U256, + bytecode::BytecodeHash, l2::L2Tx, vm::VmVersion, writes::StateDiffRecord, StorageKey, + StorageValue, Transaction, H256, U256, }; +use zksync_vm_interface::VmInterface; -use super::{HistoryEnabled, Vm}; +use super::{HistoryEnabled, ToTracerPointer, Vm}; use crate::{ interface::{ pubdata::{PubdataBuilder, PubdataInput}, storage::{InMemoryStorage, ReadStorage, StorageView, WriteStorage}, + tracer::ViolatedValidationRule, CurrentExecutionState, L2BlockEnv, VmExecutionMode, VmExecutionResultAndLogs, }, + tracers::ValidationTracer, utils::bytecode::bytes_to_be_words, - versions::testonly::{filter_out_base_system_contracts, TestedVm}, + versions::testonly::{ + filter_out_base_system_contracts, validation_params, TestedVm, TestedVmForValidation, + }, vm_latest::{ constants::BOOTLOADER_HEAP_PAGE, old_vm::{event_sink::InMemoryEventSink, history_recorder::HistoryRecorder}, @@ -36,6 +42,7 @@ mod bootloader; mod default_aa; // TODO - fix this test // `mod invalid_bytecode;` +mod account_validation_rules; mod block_tip; mod bytecode_publishing; mod call_tracer; @@ -195,6 +202,27 @@ impl TestedVm for TestedLatestVm { } } +impl TestedVmForValidation for TestedLatestVm { + fn run_validation(&mut self, tx: L2Tx, timestamp: u64) -> Option { + let validation_params = validation_params(&tx, &self.system_env); + self.push_transaction(tx.into()); + + let tracer = ValidationTracer::::new( + validation_params, + VmVersion::Vm1_5_0IncreasedBootloaderMemory, + timestamp, + ); + let mut failures = tracer.get_result(); + + self.inspect_inner( + &mut tracer.into_tracer_pointer().into(), + VmExecutionMode::OneTx, + None, + ); + Arc::make_mut(&mut failures).take() + } +} + #[derive(Clone, Debug)] pub(crate) struct ModifiedKeysMap(HashMap); diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs index 0977a323d191..58cbf45407d5 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs @@ -1,4 +1,4 @@ -use circuit_sequencer_api_1_5_0::{geometry_config::get_geometry_config, toolset::GeometryConfig}; +use circuit_sequencer_api::geometry_config::{GeometryConfig, ProtocolGeometry}; use crate::{interface::CircuitStatistic, utils::CircuitCycleStatistic}; @@ -52,7 +52,7 @@ pub(crate) const PRECOMPILE_LOG_DEMUXER_CYCLES: u32 = 1; pub(crate) const LOG_DECOMMIT_RAM_CYCLES: u32 = 1; pub(crate) const LOG_DECOMMIT_DECOMMITTER_SORTER_CYCLES: u32 = 1; -const GEOMETRY_CONFIG: GeometryConfig = get_geometry_config(); +const GEOMETRY_CONFIG: GeometryConfig = ProtocolGeometry::V1_5_0.config(); pub(crate) fn circuit_statistic_from_cycles(cycles: CircuitCycleStatistic) -> CircuitStatistic { CircuitStatistic { diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/pubdata_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tracers/pubdata_tracer.rs index 3698914630dd..7c55dd38561d 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/pubdata_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/pubdata_tracer.rs @@ -1,6 +1,6 @@ use std::{marker::PhantomData, rc::Rc}; -use circuit_sequencer_api_1_5_0::sort_storage_access::sort_storage_access_queries; +use circuit_sequencer_api::sort_storage_access::sort_storage_access_queries; use zk_evm_1_5_0::{ aux_structures::Timestamp, tracing::{BeforeExecutionData, VmLocalStateData}, @@ -162,7 +162,7 @@ impl PubdataTracer { storage .storage_log_queries_after_timestamp(Timestamp(0)) .iter() - .map(|log| &log.log_query), + .map(|log| log.log_query), ) .1 .into_iter() diff --git a/core/lib/multivm/src/versions/vm_latest/types/internals/vm_state.rs b/core/lib/multivm/src/versions/vm_latest/types/internals/vm_state.rs index 03f306f36c52..63f06f4fd846 100644 --- a/core/lib/multivm/src/versions/vm_latest/types/internals/vm_state.rs +++ b/core/lib/multivm/src/versions/vm_latest/types/internals/vm_state.rs @@ -1,4 +1,4 @@ -use circuit_sequencer_api_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; +use circuit_sequencer_api::INITIAL_MONOTONIC_CYCLE_COUNTER; use zk_evm_1_5_0::{ aux_structures::{MemoryPage, PubdataCost, Timestamp}, block_properties::BlockProperties, diff --git a/core/lib/multivm/src/versions/vm_latest/vm.rs b/core/lib/multivm/src/versions/vm_latest/vm.rs index ada20af9fa3c..1db369d4ae20 100644 --- a/core/lib/multivm/src/versions/vm_latest/vm.rs +++ b/core/lib/multivm/src/versions/vm_latest/vm.rs @@ -1,6 +1,6 @@ use std::{collections::HashMap, rc::Rc}; -use circuit_sequencer_api_1_5_0::sort_storage_access::sort_storage_access_queries; +use circuit_sequencer_api::sort_storage_access::sort_storage_access_queries; use zksync_types::{ h256_to_u256, l2_to_l1_log::{SystemL2ToL1Log, UserL2ToL1Log}, @@ -124,7 +124,7 @@ impl Vm { let storage_log_queries = self.state.storage.get_final_log_queries(); let deduped_storage_log_queries = - sort_storage_access_queries(storage_log_queries.iter().map(|log| &log.log_query)).1; + sort_storage_access_queries(storage_log_queries.iter().map(|log| log.log_query)).1; CurrentExecutionState { events, diff --git a/core/lib/multivm/src/versions/vm_m5/pubdata_utils.rs b/core/lib/multivm/src/versions/vm_m5/pubdata_utils.rs index 8eca2ef5cd86..0cf208e2a40e 100644 --- a/core/lib/multivm/src/versions/vm_m5/pubdata_utils.rs +++ b/core/lib/multivm/src/versions/vm_m5/pubdata_utils.rs @@ -1,14 +1,13 @@ use std::collections::HashMap; -use circuit_sequencer_api_1_3_3::sort_storage_access::sort_storage_access_queries; -use itertools::Itertools; +use circuit_sequencer_api::sort_storage_access::sort_storage_access_queries; use zk_evm_1_3_1::aux_structures::{LogQuery, Timestamp}; use zksync_types::{StorageKey, PUBLISH_BYTECODE_OVERHEAD, SYSTEM_CONTEXT_ADDRESS}; use crate::{ glue::GlueInto, interface::VmEvent, - utils::bytecode::bytecode_len_in_bytes, + utils::{bytecode::bytecode_len_in_bytes, glue_log_query}, vm_m5::{ oracles::storage::storage_key_of_log, storage::Storage, utils::collect_storage_log_queries_after_timestamp, vm_instance::VmInstance, @@ -86,16 +85,11 @@ impl VmInstance { // To allow calling the `vm-1.3.3`s. method, the `v1.3.1`'s `LogQuery` has to be converted // to the `vm-1.3.3`'s `LogQuery`. Then, we need to convert it back. let deduplicated_logs: Vec = sort_storage_access_queries( - &storage_logs - .iter() - .map(|log| { - GlueInto::::glue_into(log.log_query) - }) - .collect_vec(), + storage_logs.iter().map(|log| glue_log_query(log.log_query)), ) .1 .into_iter() - .map(GlueInto::::glue_into) + .map(glue_log_query) .collect(); deduplicated_logs diff --git a/core/lib/multivm/src/versions/vm_m5/vm_with_bootloader.rs b/core/lib/multivm/src/versions/vm_m5/vm_with_bootloader.rs index 0a7df48df80f..c137dcac0bd1 100644 --- a/core/lib/multivm/src/versions/vm_m5/vm_with_bootloader.rs +++ b/core/lib/multivm/src/versions/vm_m5/vm_with_bootloader.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use circuit_sequencer_api_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; +use circuit_sequencer_api::INITIAL_MONOTONIC_CYCLE_COUNTER; use zk_evm_1_3_1::{ abstractions::{MAX_HEAP_PAGE_SIZE_IN_WORDS, MAX_MEMORY_BYTES}, aux_structures::{MemoryPage, Timestamp}, diff --git a/core/lib/multivm/src/versions/vm_m6/pubdata_utils.rs b/core/lib/multivm/src/versions/vm_m6/pubdata_utils.rs index 97bf290a2162..fb3e82a28243 100644 --- a/core/lib/multivm/src/versions/vm_m6/pubdata_utils.rs +++ b/core/lib/multivm/src/versions/vm_m6/pubdata_utils.rs @@ -1,14 +1,13 @@ use std::collections::HashMap; -use circuit_sequencer_api_1_3_3::sort_storage_access::sort_storage_access_queries; -use itertools::Itertools; +use circuit_sequencer_api::sort_storage_access::sort_storage_access_queries; use zk_evm_1_3_1::aux_structures::{LogQuery, Timestamp}; use zksync_types::{StorageKey, PUBLISH_BYTECODE_OVERHEAD, SYSTEM_CONTEXT_ADDRESS}; use crate::{ glue::GlueInto, interface::VmEvent, - utils::bytecode::bytecode_len_in_bytes, + utils::{bytecode::bytecode_len_in_bytes, glue_log_query}, vm_m6::{ history_recorder::HistoryMode, oracles::storage::storage_key_of_log, storage::Storage, utils::collect_storage_log_queries_after_timestamp, VmInstance, @@ -80,16 +79,11 @@ impl VmInstance { // To allow calling the `vm-1.3.3`s. method, the `v1.3.1`'s `LogQuery` has to be converted // to the `vm-1.3.3`'s `LogQuery`. Then, we need to convert it back. let deduplicated_logs: Vec = sort_storage_access_queries( - &storage_logs - .iter() - .map(|log| { - GlueInto::::glue_into(log.log_query) - }) - .collect_vec(), + storage_logs.iter().map(|log| glue_log_query(log.log_query)), ) .1 .into_iter() - .map(GlueInto::::glue_into) + .map(glue_log_query) .collect(); deduplicated_logs diff --git a/core/lib/multivm/src/versions/vm_m6/vm_with_bootloader.rs b/core/lib/multivm/src/versions/vm_m6/vm_with_bootloader.rs index ff83abc45fcf..4b2eb8212e61 100644 --- a/core/lib/multivm/src/versions/vm_m6/vm_with_bootloader.rs +++ b/core/lib/multivm/src/versions/vm_m6/vm_with_bootloader.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use circuit_sequencer_api_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; +use circuit_sequencer_api::INITIAL_MONOTONIC_CYCLE_COUNTER; use zk_evm_1_3_1::{ abstractions::{MAX_HEAP_PAGE_SIZE_IN_WORDS, MAX_MEMORY_BYTES}, aux_structures::{MemoryPage, Timestamp}, diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/types/internals/vm_state.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/types/internals/vm_state.rs index 6776bc37c9d5..1c31c63d6893 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/types/internals/vm_state.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/types/internals/vm_state.rs @@ -1,4 +1,4 @@ -use circuit_sequencer_api_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; +use circuit_sequencer_api::INITIAL_MONOTONIC_CYCLE_COUNTER; use zk_evm_1_3_3::{ aux_structures::{MemoryPage, Timestamp}, block_properties::BlockProperties, diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/vm.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/vm.rs index 81b0c52cce5e..bfe35b1189f8 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/vm.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/vm.rs @@ -1,6 +1,6 @@ use std::rc::Rc; -use circuit_sequencer_api_1_3_3::sort_storage_access::sort_storage_access_queries; +use circuit_sequencer_api::sort_storage_access::sort_storage_access_queries; use zksync_types::{l2_to_l1_log::UserL2ToL1Log, Transaction}; use zksync_vm_interface::{pubdata::PubdataBuilder, InspectExecutionMode}; @@ -12,6 +12,7 @@ use crate::{ FinishedL1Batch, L1BatchEnv, L2BlockEnv, PushTransactionResult, SystemEnv, VmExecutionMode, VmExecutionResultAndLogs, VmFactory, VmInterface, VmInterfaceHistoryEnabled, }, + utils::glue_log_query, vm_latest::HistoryEnabled, vm_refunds_enhancement::{ bootloader_state::BootloaderState, @@ -56,8 +57,12 @@ impl Vm { let storage_log_queries = self.state.storage.get_final_log_queries(); - let deduped_storage_log_queries = - sort_storage_access_queries(storage_log_queries.iter().map(|log| &log.log_query)).1; + let deduped_storage_log_queries = sort_storage_access_queries( + storage_log_queries + .iter() + .map(|log| glue_log_query(log.log_query)), + ) + .1; CurrentExecutionState { events, diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/tracers/refunds.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/tracers/refunds.rs index 59aa837cd8fb..28d80b3d1116 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/tracers/refunds.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/tracers/refunds.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use circuit_sequencer_api_1_3_3::sort_storage_access::sort_storage_access_queries; +use circuit_sequencer_api::sort_storage_access::sort_storage_access_queries; use vise::{Buckets, EncodeLabelSet, EncodeLabelValue, Family, Histogram, Metrics}; use zk_evm_1_3_3::{ aux_structures::Timestamp, @@ -18,7 +18,7 @@ use crate::{ L1BatchEnv, Refunds, VmEvent, VmExecutionResultAndLogs, }, tracers::dynamic::vm_1_3_3::DynTracer, - utils::bytecode::bytecode_len_in_bytes, + utils::{bytecode::bytecode_len_in_bytes, glue_log_query}, vm_virtual_blocks::{ bootloader_state::BootloaderState, constants::{BOOTLOADER_HEAP_PAGE, OPERATOR_REFUNDS_OFFSET, TX_GAS_LIMIT_OFFSET}, @@ -372,15 +372,15 @@ fn pubdata_published_for_writes( .storage .storage_log_queries_after_timestamp(from_timestamp); let (_, deduplicated_logs) = - sort_storage_access_queries(storage_logs.iter().map(|log| &log.log_query)); + sort_storage_access_queries(storage_logs.iter().map(|log| glue_log_query(log.log_query))); deduplicated_logs .into_iter() .filter_map(|log| { if log.rw_flag { - let key = storage_key_of_log(&log); + let key = storage_key_of_log(&glue_log_query(log)); let pre_paid = pre_paid_before_tx(&key); - let to_pay_by_user = state.storage.base_price_for_write(&log); + let to_pay_by_user = state.storage.base_price_for_write(&glue_log_query(log)); if to_pay_by_user > pre_paid { Some(to_pay_by_user - pre_paid) diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/types/internals/vm_state.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/types/internals/vm_state.rs index d1509bd016d8..c7ab344849f2 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/types/internals/vm_state.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/types/internals/vm_state.rs @@ -1,4 +1,4 @@ -use circuit_sequencer_api_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; +use circuit_sequencer_api::INITIAL_MONOTONIC_CYCLE_COUNTER; use zk_evm_1_3_3::{ aux_structures::{MemoryPage, Timestamp}, block_properties::BlockProperties, diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/vm.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/vm.rs index a2d18e10de44..cc255f550c55 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/vm.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/vm.rs @@ -1,6 +1,6 @@ use std::rc::Rc; -use circuit_sequencer_api_1_3_3::sort_storage_access::sort_storage_access_queries; +use circuit_sequencer_api::sort_storage_access::sort_storage_access_queries; use zksync_types::{l2_to_l1_log::UserL2ToL1Log, Transaction}; use zksync_vm_interface::{pubdata::PubdataBuilder, InspectExecutionMode}; @@ -12,6 +12,7 @@ use crate::{ FinishedL1Batch, L1BatchEnv, L2BlockEnv, PushTransactionResult, SystemEnv, VmExecutionMode, VmExecutionResultAndLogs, VmFactory, VmInterface, VmInterfaceHistoryEnabled, }, + utils::glue_log_query, vm_latest::HistoryEnabled, vm_virtual_blocks::{ bootloader_state::BootloaderState, @@ -56,8 +57,12 @@ impl Vm { let storage_log_queries = self.state.storage.get_final_log_queries(); - let deduped_storage_log_queries = - sort_storage_access_queries(storage_log_queries.iter().map(|log| &log.log_query)).1; + let deduped_storage_log_queries = sort_storage_access_queries( + storage_log_queries + .iter() + .map(|log| glue_log_query(log.log_query)), + ) + .1; CurrentExecutionState { events, diff --git a/core/lib/multivm/src/vm_instance.rs b/core/lib/multivm/src/vm_instance.rs index 9de99a7eb116..97af38ea0347 100644 --- a/core/lib/multivm/src/vm_instance.rs +++ b/core/lib/multivm/src/vm_instance.rs @@ -1,7 +1,6 @@ use std::{mem, rc::Rc}; use zksync_types::{vm::VmVersion, ProtocolVersionId, Transaction}; -use zksync_vm2::interface::Tracer; use zksync_vm_interface::{pubdata::PubdataBuilder, InspectExecutionMode}; use crate::{ @@ -14,8 +13,8 @@ use crate::{ VmMemoryMetrics, }, tracers::TracerDispatcher, - vm_fast::FastVmVersion, - vm_latest::HistoryEnabled, + vm_fast::{self, interface::Tracer, FastVmVersion}, + vm_latest::{self, HistoryEnabled}, }; /// Enumeration encompassing all supported legacy VM versions. @@ -35,7 +34,7 @@ pub enum LegacyVmInstance { VmBoojumIntegration(crate::vm_boojum_integration::Vm, H>), Vm1_4_1(crate::vm_1_4_1::Vm, H>), Vm1_4_2(crate::vm_1_4_2::Vm, H>), - Vm1_5_0(crate::vm_latest::Vm, H>), + Vm1_5_0(vm_latest::Vm, H>), } macro_rules! dispatch_legacy_vm { @@ -191,29 +190,29 @@ impl LegacyVmInstance { Self::Vm1_4_2(vm) } VmVersion::Vm1_5_0SmallBootloaderMemory => { - let vm = crate::vm_latest::Vm::new_with_subversion( + let vm = vm_latest::Vm::new_with_subversion( l1_batch_env, system_env, storage_view, - crate::vm_latest::MultiVmSubversion::SmallBootloaderMemory, + vm_latest::MultiVmSubversion::SmallBootloaderMemory, ); Self::Vm1_5_0(vm) } VmVersion::Vm1_5_0IncreasedBootloaderMemory => { - let vm = crate::vm_latest::Vm::new_with_subversion( + let vm = vm_latest::Vm::new_with_subversion( l1_batch_env, system_env, storage_view, - crate::vm_latest::MultiVmSubversion::IncreasedBootloaderMemory, + vm_latest::MultiVmSubversion::IncreasedBootloaderMemory, ); Self::Vm1_5_0(vm) } VmVersion::VmGateway => { - let vm = crate::vm_latest::Vm::new_with_subversion( + let vm = vm_latest::Vm::new_with_subversion( l1_batch_env, system_env, storage_view, - crate::vm_latest::MultiVmSubversion::Gateway, + vm_latest::MultiVmSubversion::Gateway, ); Self::Vm1_5_0(vm) } @@ -227,19 +226,19 @@ impl LegacyVmInstance { } /// Fast VM shadowed by the latest legacy VM. -pub type ShadowedFastVm = ShadowVm< +pub type ShadowedFastVm = ShadowVm< S, - crate::vm_latest::Vm, HistoryEnabled>, - crate::vm_fast::Vm, Tr>, + vm_latest::Vm, HistoryEnabled>, + vm_fast::Vm, Tr, Val>, >; /// Fast VM variants. #[derive(Debug)] -pub enum FastVmInstance { +pub enum FastVmInstance { /// Fast VM running in isolation. - Fast(crate::vm_fast::Vm, Tr>), + Fast(vm_fast::Vm, Tr, Val>), /// Fast VM shadowed by the latest legacy VM. - Shadowed(ShadowedFastVm), + Shadowed(ShadowedFastVm), } macro_rules! dispatch_fast_vm { @@ -251,10 +250,15 @@ macro_rules! dispatch_fast_vm { }; } -impl VmInterface for FastVmInstance { +impl VmInterface for FastVmInstance +where + S: ReadStorage, + Tr: Tracer + Default, + Val: vm_fast::ValidationTracer, +{ type TracerDispatcher = ( - crate::vm_latest::TracerDispatcher, HistoryEnabled>, - Tr, + vm_latest::TracerDispatcher, HistoryEnabled>, + (Tr, Val), ); fn push_transaction(&mut self, tx: Transaction) -> PushTransactionResult<'_> { @@ -299,8 +303,11 @@ impl VmInterface for FastVmInsta } } -impl VmInterfaceHistoryEnabled - for FastVmInstance +impl VmInterfaceHistoryEnabled for FastVmInstance +where + S: ReadStorage, + Tr: Tracer + Default, + Val: vm_fast::ValidationTracer, { fn make_snapshot(&mut self) { dispatch_fast_vm!(self.make_snapshot()); @@ -315,18 +322,19 @@ impl VmInterfaceHistoryEnabled } } -impl FastVmInstance { +impl FastVmInstance +where + S: ReadStorage, + Tr: Tracer + Default, + Val: vm_fast::ValidationTracer, +{ /// Creates an isolated fast VM. pub fn fast( l1_batch_env: L1BatchEnv, system_env: SystemEnv, storage_view: StoragePtr>, ) -> Self { - Self::Fast(crate::vm_fast::Vm::new( - l1_batch_env, - system_env, - storage_view, - )) + Self::Fast(vm_fast::Vm::new(l1_batch_env, system_env, storage_view)) } /// Creates a shadowed fast VM. diff --git a/core/lib/protobuf_config/Cargo.toml b/core/lib/protobuf_config/Cargo.toml index 92d9bd53978c..2d910430863b 100644 --- a/core/lib/protobuf_config/Cargo.toml +++ b/core/lib/protobuf_config/Cargo.toml @@ -16,6 +16,7 @@ links = "zksync_protobuf_config_proto" serde_json.workspace = true serde_yaml.workspace = true zksync_basic_types.workspace = true +zksync_concurrency.workspace = true zksync_config.workspace = true zksync_protobuf.workspace = true zksync_types.workspace = true diff --git a/core/lib/protobuf_config/src/consensus.rs b/core/lib/protobuf_config/src/consensus.rs index 2219b6a82ea8..567224acd4a6 100644 --- a/core/lib/protobuf_config/src/consensus.rs +++ b/core/lib/protobuf_config/src/consensus.rs @@ -1,5 +1,6 @@ use anyhow::Context as _; use zksync_basic_types::L2ChainId; +use zksync_concurrency::time; use zksync_config::configs::consensus::{ AttesterPublicKey, ConsensusConfig, GenesisSpec, Host, NodePublicKey, ProtocolVersion, RpcConfig, ValidatorPublicKey, WeightedAttester, WeightedValidator, @@ -154,6 +155,11 @@ impl ProtoRepr for proto::Config { .context("server_addr")?, public_addr: Host(required(&self.public_addr).context("public_addr")?.clone()), max_payload_size, + view_timeout: self + .view_timeout + .as_ref() + .map(|x| time::Duration::read(x).context("view_timeout")) + .transpose()?, max_batch_size, gossip_dynamic_inbound_limit: required(&self.gossip_dynamic_inbound_limit) .and_then(|x| Ok((*x).try_into()?)) @@ -187,6 +193,7 @@ impl ProtoRepr for proto::Config { server_addr: Some(this.server_addr.to_string()), public_addr: Some(this.public_addr.0.clone()), max_payload_size: Some(this.max_payload_size.try_into().unwrap()), + view_timeout: this.view_timeout.as_ref().map(ProtoFmt::build), max_batch_size: Some(this.max_batch_size.try_into().unwrap()), gossip_dynamic_inbound_limit: Some( this.gossip_dynamic_inbound_limit.try_into().unwrap(), diff --git a/core/lib/protobuf_config/src/proto/core/consensus.proto b/core/lib/protobuf_config/src/proto/core/consensus.proto index 9b0d69e7270c..0b915603cc67 100644 --- a/core/lib/protobuf_config/src/proto/core/consensus.proto +++ b/core/lib/protobuf_config/src/proto/core/consensus.proto @@ -87,6 +87,9 @@ message Config { // Maximal allowed size of the sync batches. optional uint64 max_batch_size = 10; // required; bytes + // View timeout for the consensus protocol. + optional std.Duration view_timeout = 13; // optional + // Inbound connections that should be unconditionally accepted on the gossip network. repeated string gossip_static_inbound = 5; // required; NodePublicKey diff --git a/core/lib/prover_interface/Cargo.toml b/core/lib/prover_interface/Cargo.toml index 50671fb3acb4..3ed8a9ff558f 100644 --- a/core/lib/prover_interface/Cargo.toml +++ b/core/lib/prover_interface/Cargo.toml @@ -16,7 +16,7 @@ zksync_object_store.workspace = true zksync_types.workspace = true # We can use the newest api to send proofs to L1. -circuit_sequencer_api_1_5_0.workspace = true +circuit_sequencer_api.workspace = true serde.workspace = true strum = { workspace = true, features = ["derive"] } diff --git a/core/lib/prover_interface/src/outputs.rs b/core/lib/prover_interface/src/outputs.rs index 60a9eaba760b..b6422473cea3 100644 --- a/core/lib/prover_interface/src/outputs.rs +++ b/core/lib/prover_interface/src/outputs.rs @@ -1,6 +1,6 @@ use core::fmt; -use circuit_sequencer_api_1_5_0::proof::FinalProof; +use circuit_sequencer_api::proof::FinalProof; use serde::{Deserialize, Serialize}; use serde_with::{hex::Hex, serde_as}; use zksync_object_store::{serialize_using_bincode, Bucket, StoredObject}; diff --git a/core/lib/prover_interface/tests/job_serialization.rs b/core/lib/prover_interface/tests/job_serialization.rs index ead59749abe3..d170520798d1 100644 --- a/core/lib/prover_interface/tests/job_serialization.rs +++ b/core/lib/prover_interface/tests/job_serialization.rs @@ -1,6 +1,6 @@ //! Integration tests for object store serialization of job objects. -use circuit_sequencer_api_1_5_0::proof::FinalProof; +use circuit_sequencer_api::proof::FinalProof; use tokio::fs; use zksync_object_store::{Bucket, MockObjectStore}; use zksync_prover_interface::{ diff --git a/core/lib/state/src/storage_overrides.rs b/core/lib/state/src/storage_overrides.rs deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/core/lib/test_contracts/contracts/custom-account/validation-rule-breaker.sol b/core/lib/test_contracts/contracts/custom-account/validation-rule-breaker.sol new file mode 100644 index 000000000000..45961f705be7 --- /dev/null +++ b/core/lib/test_contracts/contracts/custom-account/validation-rule-breaker.sol @@ -0,0 +1,149 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +import "./Constants.sol"; +import "./TransactionHelper.sol"; + +import "./SystemContractsCaller.sol"; + +import "./interfaces/IAccount.sol"; + +contract ValidationRuleBreaker is IAccount { + using TransactionHelper for Transaction; + + uint32 public typeOfRuleBreak; + address public trustedAddress = address(0x800a); + + constructor() { + typeOfRuleBreak = 0; + } + + function setTypeOfRuleBreak(uint32 _typeOfRuleBreak) external { + typeOfRuleBreak = _typeOfRuleBreak; + } + + function validateTransaction( + bytes32 _txHash, + bytes32 _suggestedSignedTxHash, + Transaction calldata _transaction + ) external payable override returns (bytes4 magic) { + // By default we consider the transaction as successful + magic = VALIDATION_SUCCESS_MAGIC; + + if (typeOfRuleBreak == 1) { + // The balance of another account may not be read + // I'm writing assertions because otherwise the compiler would optimize away the access + require(BOOTLOADER_FORMAL_ADDRESS.balance != 0); + } else if (typeOfRuleBreak == 2) { + // May not call an EOA + address(1234567890).call(""); + } else if (typeOfRuleBreak == 3) { + // This should succeed because a trustedAddress is marked as a slot that grants access to the address it contains + require(trustedAddress == address(0x800a)); + require(BOOTLOADER_FORMAL_ADDRESS.balance != 0); + } else if (typeOfRuleBreak == 4) { + // This should still fail; EIP-4337 defines out of gas as an immediate failure + address(this).call( + abi.encodeWithSignature("_runOutOfGasButCatchThePanic()") + ); + } + + _validateTransaction(_suggestedSignedTxHash, _transaction); + } + + function _runOutOfGasButCatchThePanic() external { + address(this).call( + abi.encodeWithSignature("_runOutOfGasButCatchThePanic()") + ); + } + + function _validateTransaction( + bytes32 _suggestedSignedTxHash, + Transaction calldata _transaction + ) internal { + SystemContractsCaller.systemCallWithPropagatedRevert( + uint32(gasleft()), + address(NONCE_HOLDER_SYSTEM_CONTRACT), + 0, + abi.encodeCall( + INonceHolder.incrementMinNonceIfEquals, + (_transaction.nonce) + ) + ); + } + + function executeTransaction( + bytes32, + bytes32, + Transaction calldata _transaction + ) external payable override { + _execute(_transaction); + } + + function executeTransactionFromOutside( + Transaction calldata _transaction + ) external payable override { + _validateTransaction(bytes32(0), _transaction); + _execute(_transaction); + } + + function _execute(Transaction calldata _transaction) internal { + address to = address(uint160(_transaction.to)); + uint256 value = _transaction.reserved[1]; + bytes memory data = _transaction.data; + + if (to == address(DEPLOYER_SYSTEM_CONTRACT)) { + // We allow calling ContractDeployer with any calldata + SystemContractsCaller.systemCallWithPropagatedRevert( + uint32(gasleft()), + to, + uint128(_transaction.reserved[1]), // By convention, reserved[1] is `value` + _transaction.data + ); + } else { + bool success; + assembly { + success := call( + gas(), + to, + value, + add(data, 0x20), + mload(data), + 0, + 0 + ) + } + require(success); + } + } + + // Here, the user pays the bootloader for the transaction + function payForTransaction( + bytes32, + bytes32, + Transaction calldata _transaction + ) external payable { + bool success = _transaction.payToTheBootloader(); + require(success, "Failed to pay the fee to the operator"); + } + + // Here, the user should prepare for the transaction to be paid for by a paymaster + // Here, the account should set the allowance for the smart contracts + function prepareForPaymaster( + bytes32, + bytes32, + Transaction calldata _transaction + ) external payable { + _transaction.processPaymasterInput(); + } + + fallback() external payable { + // fallback of default AA shouldn't be called by bootloader under no circumstances + assert(msg.sender != BOOTLOADER_FORMAL_ADDRESS); + + // If the contract is called directly, behave like an EOA + } + + receive() external payable {} +} diff --git a/core/lib/test_contracts/src/contracts.rs b/core/lib/test_contracts/src/contracts.rs index 36d758c46de2..a997f70f6870 100644 --- a/core/lib/test_contracts/src/contracts.rs +++ b/core/lib/test_contracts/src/contracts.rs @@ -115,6 +115,12 @@ impl TestContract { &CONTRACT } + pub fn validation_test() -> &'static Self { + static CONTRACT: Lazy = + Lazy::new(|| TestContract::new(raw::custom_account::ValidationRuleBreaker)); + &CONTRACT + } + /// Returns a contract testing precompiles. pub fn precompiles_test() -> &'static Self { static CONTRACT: Lazy = diff --git a/core/lib/utils/Cargo.toml b/core/lib/utils/Cargo.toml index 216f3b12d426..fb08afc59b70 100644 --- a/core/lib/utils/Cargo.toml +++ b/core/lib/utils/Cargo.toml @@ -20,6 +20,7 @@ futures.workspace = true reqwest = { workspace = true, features = ["blocking"] } serde_json.workspace = true once_cell.workspace = true +sha2.workspace = true [dev-dependencies] tokio = { workspace = true, features = ["macros", "rt"] } diff --git a/core/lib/vm_executor/src/batch/factory.rs b/core/lib/vm_executor/src/batch/factory.rs index 76ef244401bd..9797e1681032 100644 --- a/core/lib/vm_executor/src/batch/factory.rs +++ b/core/lib/vm_executor/src/batch/factory.rs @@ -37,7 +37,7 @@ pub trait BatchTracer: fmt::Debug + 'static + Send + Sealed { const TRACE_CALLS: bool; /// Tracer for the fast VM. #[doc(hidden)] - type Fast: vm_fast::interface::Tracer + Default + 'static; + type Fast: vm_fast::interface::Tracer + Default; } impl Sealed for () {} @@ -228,7 +228,7 @@ impl BatchVm { with_compression, ), Self::Fast(vm) => { - let mut tracer = (legacy_tracer.into(), ::default()); + let mut tracer = (legacy_tracer.into(), Default::default()); vm.inspect_transaction_with_bytecode_compression(&mut tracer, tx, with_compression) } }; diff --git a/core/lib/vm_executor/src/oneshot/mod.rs b/core/lib/vm_executor/src/oneshot/mod.rs index 0dfdb67bff52..e52a88e3e9c5 100644 --- a/core/lib/vm_executor/src/oneshot/mod.rs +++ b/core/lib/vm_executor/src/oneshot/mod.rs @@ -17,9 +17,9 @@ use once_cell::sync::OnceCell; use zksync_multivm::{ interface::{ executor::{OneshotExecutor, TransactionValidator}, - storage::{ReadStorage, StorageView, StorageWithOverrides}, + storage::{ReadStorage, StorageView, StorageWithOverrides, WriteStorage}, tracer::{ValidationError, ValidationParams, ValidationTraces}, - utils::{DivergenceHandler, ShadowVm}, + utils::{DivergenceHandler, ShadowMut, ShadowVm}, Call, ExecutionResult, InspectExecutionMode, OneshotEnv, OneshotTracingParams, OneshotTransactionExecutionResult, StoredL2BlockEnv, TxExecutionArgs, TxExecutionMode, VmFactory, VmInterface, @@ -27,9 +27,10 @@ use zksync_multivm::{ is_supported_by_fast_vm, tracers::{CallTracer, StorageInvocations, TracerDispatcher, ValidationTracer}, utils::adjust_pubdata_price_for_tx, + vm_fast, vm_latest::{HistoryDisabled, HistoryEnabled}, zk_evm_latest::ethereum_types::U256, - FastVmInstance, HistoryMode, LegacyVmInstance, MultiVmTracer, + FastVmInstance, HistoryMode, LegacyVmInstance, MultiVmTracer, VmVersion, }; use zksync_types::{ block::pack_block_info, @@ -180,7 +181,11 @@ where let l1_batch_env = env.l1_batch.clone(); let sandbox = VmSandbox { - fast_vm_mode: FastVmMode::Old, + fast_vm_mode: if !is_supported_by_fast_vm(env.system.version) { + FastVmMode::Old // the fast VM doesn't support old protocol versions + } else { + self.fast_vm_mode + }, panic_on_divergence: self.panic_on_divergence, storage, env, @@ -189,31 +194,35 @@ where }; tokio::task::spawn_blocking(move || { - let validation_tracer = ValidationTracer::::new( - validation_params, - sandbox.env.system.version.into(), - l1_batch_env, - ); - let mut validation_result = validation_tracer.get_result(); - let validation_traces = validation_tracer.get_traces(); - let tracers = vec![validation_tracer.into_tracer_pointer()]; - - let exec_result = sandbox.execute_in_vm(|vm, transaction| { - let Vm::Legacy(vm) = vm else { - unreachable!("Fast VM is never used for validation yet"); - }; - vm.push_transaction(transaction); - vm.inspect(&mut tracers.into(), InspectExecutionMode::OneTx) - }); - let validation_result = Arc::make_mut(&mut validation_result) - .take() - .map_or(Ok(()), Err); - - match (exec_result.result, validation_result) { - (_, Err(violated_rule)) => Err(ValidationError::ViolatedRule(violated_rule)), - (ExecutionResult::Halt { reason }, _) => Err(ValidationError::FailedTx(reason)), - _ => Ok(validation_traces.lock().unwrap().clone()), - } + let version = sandbox.env.system.version.into(); + let batch_timestamp = l1_batch_env.timestamp; + + sandbox.execute_in_vm(|vm, transaction| match vm { + Vm::Legacy(vm) => { + vm.push_transaction(transaction); + validate_legacy(vm, version, validation_params, batch_timestamp) + } + + Vm::Fast(FastVmInstance::Fast(vm)) => { + vm.push_transaction(transaction); + validate_fast(vm, validation_params, batch_timestamp) + } + + Vm::Fast(FastVmInstance::Shadowed(vm)) => { + vm.push_transaction(transaction); + vm.get_custom_mut("validation result", |vm| match vm { + ShadowMut::Main(vm) => validate_legacy::<_, HistoryEnabled>( + vm, + version, + validation_params.clone(), + batch_timestamp, + ), + ShadowMut::Shadow(vm) => { + validate_fast(vm, validation_params.clone(), batch_timestamp) + } + }) + } + }) }) .await .context("VM execution panicked") @@ -221,12 +230,12 @@ where } #[derive(Debug)] -enum Vm { +enum Vm { Legacy(LegacyVmInstance), - Fast(FastVmInstance), + Fast(FastVmInstance), } -impl Vm { +impl Vm { fn inspect_transaction_with_bytecode_compression( &mut self, missed_storage_invocation_limit: usize, @@ -252,7 +261,7 @@ impl Vm { missed_storage_invocation_limit, None, ); - let mut full_tracer = (legacy_tracers.into(), ()); + let mut full_tracer = (legacy_tracers.into(), ((), ())); vm.inspect_transaction_with_bytecode_compression( &mut full_tracer, tx, @@ -282,6 +291,57 @@ impl Vm { } } +fn validate_fast( + vm: &mut vm_fast::Vm, + validation_params: ValidationParams, + batch_timestamp: u64, +) -> Result { + let validation = vm_fast::FullValidationTracer::new(validation_params, batch_timestamp); + let mut tracer = ((), validation); + let result_and_logs = vm.inspect(&mut tracer, InspectExecutionMode::OneTx); + if let Some(violation) = tracer.1.validation_error() { + return Err(ValidationError::ViolatedRule(violation)); + } + + match result_and_logs.result { + ExecutionResult::Halt { reason } => Err(ValidationError::FailedTx(reason)), + ExecutionResult::Revert { .. } => { + unreachable!("Revert can only happen at the end of a transaction") + } + ExecutionResult::Success { .. } => Ok(tracer.1.traces()), + } +} + +fn validate_legacy( + vm: &mut impl VmInterface>>, + version: VmVersion, + validation_params: ValidationParams, + batch_timestamp: u64, +) -> Result +where + S: WriteStorage, + H: 'static + HistoryMode, + ValidationTracer: MultiVmTracer, +{ + let validation_tracer = ValidationTracer::::new(validation_params, version, batch_timestamp); + let mut validation_result = validation_tracer.get_result(); + let validation_traces = validation_tracer.get_traces(); + let validation_tracer: Box> = validation_tracer.into_tracer_pointer(); + let tracers = TracerDispatcher::from(validation_tracer); + + let exec_result = vm.inspect(&mut tracers.into(), InspectExecutionMode::OneTx); + + let validation_result = Arc::make_mut(&mut validation_result) + .take() + .map_or(Ok(()), Err); + + match (exec_result.result, validation_result) { + (_, Err(violated_rule)) => Err(ValidationError::ViolatedRule(violated_rule)), + (ExecutionResult::Halt { reason }, _) => Err(ValidationError::FailedTx(reason)), + _ => Ok(validation_traces.lock().unwrap().clone()), + } +} + /// Full parameters necessary to instantiate a VM for oneshot execution. #[derive(Debug)] struct VmSandbox { @@ -342,11 +402,14 @@ impl VmSandbox { } } - /// This method is blocking. - fn execute_in_vm( + fn execute_in_vm( mut self, - action: impl FnOnce(&mut Vm>, Transaction) -> T, - ) -> T { + action: impl FnOnce(&mut Vm, Tr, Val>, Transaction) -> T, + ) -> T + where + Tr: vm_fast::interface::Tracer + Default, + Val: vm_fast::ValidationTracer, + { Self::setup_storage( &mut self.storage, &self.execution_args, diff --git a/core/lib/vm_interface/src/types/tracer.rs b/core/lib/vm_interface/src/types/tracer.rs index 1c3f65f443ef..168834f28cef 100644 --- a/core/lib/vm_interface/src/types/tracer.rs +++ b/core/lib/vm_interface/src/types/tracer.rs @@ -71,7 +71,7 @@ pub struct TimestampAsserterParams { } /// Rules that can be violated when validating a transaction. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub enum ViolatedValidationRule { /// The transaction touched disallowed storage slots during validation. TouchedDisallowedStorageSlots(Address, U256), @@ -112,7 +112,7 @@ impl fmt::Display for ViolatedValidationRule { } /// Errors returned when validating a transaction. -#[derive(Debug)] +#[derive(Debug, PartialEq)] pub enum ValidationError { /// VM execution was halted during validation. FailedTx(Halt), @@ -124,7 +124,7 @@ pub enum ValidationError { /// For instance, the `timestamp_asserter_range` represent the range within which the transaction might make /// assertions on `block.timestamp`. This information is crucial for the caller, as expired transactions should /// be excluded from the mempool. -#[derive(Debug, Clone, Default)] +#[derive(Debug, Clone, Default, PartialEq)] pub struct ValidationTraces { pub timestamp_asserter_range: Option>, } diff --git a/core/lib/vm_interface/src/utils/shadow.rs b/core/lib/vm_interface/src/utils/shadow.rs index 0883971f4de8..d6a6d16c77a0 100644 --- a/core/lib/vm_interface/src/utils/shadow.rs +++ b/core/lib/vm_interface/src/utils/shadow.rs @@ -13,6 +13,7 @@ use super::dump::{DumpingVm, VmDump}; use crate::{ pubdata::PubdataBuilder, storage::{ReadStorage, StoragePtr, StorageView}, + tracer::{ValidationError, ValidationTraces}, BytecodeCompressionResult, CurrentExecutionState, FinishedL1Batch, InspectExecutionMode, L1BatchEnv, L2BlockEnv, PushTransactionResult, SystemEnv, VmExecutionResultAndLogs, VmFactory, VmInterface, VmInterfaceHistoryEnabled, VmTrackingContracts, @@ -224,6 +225,14 @@ impl CheckDivergence for FinishedL1Batch { } } +impl CheckDivergence for Result { + fn check_divergence(&self, other: &Self) -> DivergenceErrors { + let mut errors = DivergenceErrors::new(); + errors.check_match("validation result", self, other); + errors + } +} + /// Shadowed VM that executes 2 VMs for each operation and compares their outputs. /// /// If a divergence is detected, the VM state is dumped using [a pluggable handler](Self::set_dump_handler()), @@ -238,7 +247,6 @@ impl ShadowVm where S: ReadStorage, Main: VmTrackingContracts, - Shadow: VmInterface, { /// Sets the divergence handler to be used by this VM. pub fn set_divergence_handler(&mut self, handler: DivergenceHandler) { @@ -247,6 +255,18 @@ where } } + /// Dumps the current VM state. + pub fn dump_state(&self) -> VmDump { + self.main.dump_state() + } +} + +impl ShadowVm +where + S: ReadStorage, + Main: VmTrackingContracts, + Shadow: VmInterface, +{ /// Mutable ref is not necessary, but it automatically drops potential borrows. fn report(&mut self, err: DivergenceErrors) { self.report_shared(err); @@ -260,11 +280,6 @@ where .report(err, self.main.dump_state()); } - /// Dumps the current VM state. - pub fn dump_state(&self) -> VmDump { - self.main.dump_state() - } - /// Gets the specified value from both the main and shadow VM, checking whether it matches on both. pub fn get(&self, name: &str, mut action: impl FnMut(ShadowRef<'_, Main, Shadow>) -> R) -> R where @@ -330,7 +345,6 @@ impl ShadowVm where S: ReadStorage, Main: VmFactory> + VmTrackingContracts, - Shadow: VmInterface, { /// Creates a VM with a custom shadow storage. pub fn with_custom_shadow( diff --git a/core/lib/vm_interface/src/vm.rs b/core/lib/vm_interface/src/vm.rs index 2c25d729e318..f347bb54f550 100644 --- a/core/lib/vm_interface/src/vm.rs +++ b/core/lib/vm_interface/src/vm.rs @@ -22,7 +22,6 @@ use crate::{ }; pub trait VmInterface { - /// Lifetime is used to be able to define `Option<&mut _>` as a dispatcher. type TracerDispatcher: Default; /// Pushes a transaction to bootloader memory for future execution with bytecode compression (if it's supported by the VM). diff --git a/core/node/api_server/src/web3/namespaces/unstable/utils.rs b/core/node/api_server/src/web3/namespaces/unstable/utils.rs index 2d3187fab6b8..b1071aee28c4 100644 --- a/core/node/api_server/src/web3/namespaces/unstable/utils.rs +++ b/core/node/api_server/src/web3/namespaces/unstable/utils.rs @@ -1,12 +1,11 @@ use zksync_dal::{Connection, Core, CoreDal, DalError}; -use zksync_multivm::circuit_sequencer_api_latest::boojum::ethereum_types::U256; use zksync_system_constants::{ message_root::{CHAIN_COUNT_KEY, CHAIN_INDEX_TO_ID_KEY, CHAIN_TREE_KEY}, L2_MESSAGE_ROOT_ADDRESS, }; use zksync_types::{ h256_to_u256, l2_to_l1_log::CHAIN_ID_LEAF_PADDING, u256_to_h256, web3::keccak256, - AccountTreeId, L2BlockNumber, StorageKey, H256, + AccountTreeId, L2BlockNumber, StorageKey, H256, U256, }; use zksync_web3_decl::error::Web3Error; diff --git a/core/node/commitment_generator/Cargo.toml b/core/node/commitment_generator/Cargo.toml index f0b4046bab42..8a1af52e589d 100644 --- a/core/node/commitment_generator/Cargo.toml +++ b/core/node/commitment_generator/Cargo.toml @@ -20,13 +20,9 @@ zksync_eth_client.workspace = true zksync_contracts.workspace = true zksync_multivm.workspace = true zksync_system_constants.workspace = true -circuit_sequencer_api_1_4_0.workspace = true -circuit_sequencer_api_1_4_1.workspace = true -circuit_sequencer_api_1_5_0.workspace = true +circuit_encodings.workspace = true zk_evm_1_5_0.workspace = true -zk_evm_1_4_1.workspace = true -zk_evm_1_3_3.workspace = true tokio = { workspace = true, features = ["time"] } futures.workspace = true diff --git a/core/node/commitment_generator/src/utils.rs b/core/node/commitment_generator/src/utils.rs index cc44d7a03c71..b0a0562d8ec5 100644 --- a/core/node/commitment_generator/src/utils.rs +++ b/core/node/commitment_generator/src/utils.rs @@ -4,14 +4,6 @@ use std::fmt; use anyhow::Context; use itertools::Itertools; -use zk_evm_1_3_3::{ - aux_structures::Timestamp as Timestamp_1_3_3, - zk_evm_abstractions::queries::LogQuery as LogQuery_1_3_3, -}; -use zk_evm_1_4_1::{ - aux_structures::Timestamp as Timestamp_1_4_1, - zk_evm_abstractions::queries::LogQuery as LogQuery_1_4_1, -}; use zk_evm_1_5_0::{ aux_structures::Timestamp as Timestamp_1_5_0, zk_evm_abstractions::queries::LogQuery as LogQuery_1_5_0, @@ -22,7 +14,6 @@ use zksync_multivm::{interface::VmEvent, utils::get_used_bootloader_memory_bytes use zksync_system_constants::message_root::{AGG_TREE_HEIGHT_KEY, AGG_TREE_NODES_KEY}; use zksync_types::{ address_to_u256, h256_to_u256, u256_to_h256, - vm::VmVersion, web3::keccak256, zk_evm_types::{LogQuery, Timestamp}, AccountTreeId, L1BatchNumber, ProtocolVersionId, StorageKey, EVENT_WRITER_ADDRESS, H256, @@ -54,37 +45,15 @@ impl CommitmentComputer for RealCommitmentComputer { fn events_queue_commitment( &self, events_queue: &[LogQuery], - protocol_version: ProtocolVersionId, + _protocol_version: ProtocolVersionId, ) -> anyhow::Result { - match VmVersion::from(protocol_version) { - VmVersion::VmBoojumIntegration => Ok(H256( - circuit_sequencer_api_1_4_0::commitments::events_queue_commitment_fixed( - &events_queue - .iter() - .map(|x| to_log_query_1_3_3(*x)) - .collect(), - ), - )), - VmVersion::Vm1_4_1 | VmVersion::Vm1_4_2 => Ok(H256( - circuit_sequencer_api_1_4_1::commitments::events_queue_commitment_fixed( - &events_queue - .iter() - .map(|x| to_log_query_1_4_1(*x)) - .collect(), - ), - )), - VmVersion::Vm1_5_0SmallBootloaderMemory - | VmVersion::Vm1_5_0IncreasedBootloaderMemory - | VmVersion::VmGateway => Ok(H256( - circuit_sequencer_api_1_5_0::commitments::events_queue_commitment_fixed( - &events_queue - .iter() - .map(|x| to_log_query_1_5_0(*x)) - .collect(), - ), - )), - _ => anyhow::bail!("Unsupported protocol version: {protocol_version:?}"), - } + let commitment = circuit_encodings::commitments::events_queue_commitment_fixed( + &events_queue + .iter() + .map(|x| to_log_query_1_5_0(*x)) + .collect(), + ); + Ok(H256(commitment)) } fn bootloader_initial_content_commitment( @@ -100,27 +69,10 @@ impl CommitmentComputer for RealCommitmentComputer { let full_bootloader_memory = expand_memory_contents(initial_bootloader_contents, expanded_memory_size); - - match VmVersion::from(protocol_version) { - VmVersion::VmBoojumIntegration => Ok(H256( - circuit_sequencer_api_1_4_0::commitments::initial_heap_content_commitment_fixed( - &full_bootloader_memory, - ), - )), - VmVersion::Vm1_4_1 | VmVersion::Vm1_4_2 => Ok(H256( - circuit_sequencer_api_1_4_1::commitments::initial_heap_content_commitment_fixed( - &full_bootloader_memory, - ), - )), - VmVersion::Vm1_5_0SmallBootloaderMemory - | VmVersion::Vm1_5_0IncreasedBootloaderMemory - | VmVersion::VmGateway => Ok(H256( - circuit_sequencer_api_1_5_0::commitments::initial_heap_content_commitment_fixed( - &full_bootloader_memory, - ), - )), - _ => unreachable!(), - } + let commitment = circuit_encodings::commitments::initial_heap_content_commitment_fixed( + &full_bootloader_memory, + ); + Ok(H256(commitment)) } } @@ -133,37 +85,6 @@ fn expand_memory_contents(packed: &[(usize, U256)], memory_size_bytes: usize) -> result } -fn to_log_query_1_3_3(log_query: LogQuery) -> LogQuery_1_3_3 { - LogQuery_1_3_3 { - timestamp: Timestamp_1_3_3(log_query.timestamp.0), - tx_number_in_block: log_query.tx_number_in_block, - aux_byte: log_query.aux_byte, - shard_id: log_query.shard_id, - address: log_query.address, - key: log_query.key, - read_value: log_query.read_value, - written_value: log_query.written_value, - rw_flag: log_query.rw_flag, - rollback: log_query.rollback, - is_service: log_query.is_service, - } -} - -fn to_log_query_1_4_1(log_query: LogQuery) -> LogQuery_1_4_1 { - LogQuery_1_4_1 { - timestamp: Timestamp_1_4_1(log_query.timestamp.0), - tx_number_in_block: log_query.tx_number_in_block, - aux_byte: log_query.aux_byte, - shard_id: log_query.shard_id, - address: log_query.address, - key: log_query.key, - read_value: log_query.read_value, - written_value: log_query.written_value, - rw_flag: log_query.rw_flag, - rollback: log_query.rollback, - is_service: log_query.is_service, - } -} fn to_log_query_1_5_0(log_query: LogQuery) -> LogQuery_1_5_0 { LogQuery_1_5_0 { diff --git a/core/node/consensus/src/config.rs b/core/node/consensus/src/config.rs index 4ad7a551ab42..2cb6045151bd 100644 --- a/core/node/consensus/src/config.rs +++ b/core/node/consensus/src/config.rs @@ -3,7 +3,7 @@ use std::collections::{BTreeMap, HashMap}; use anyhow::Context as _; use secrecy::{ExposeSecret as _, Secret}; -use zksync_concurrency::{limiter, net, time}; +use zksync_concurrency::net; use zksync_config::{ configs, configs::consensus::{ConsensusConfig, ConsensusSecrets, Host, NodePublicKey}, @@ -152,11 +152,6 @@ pub(super) fn executor( let mut rpc = executor::RpcConfig::default(); rpc.get_block_rate = cfg.rpc().get_block_rate(); - // Disable batch syncing, because it is not implemented. - rpc.get_batch_rate = limiter::Rate { - burst: 0, - refresh: time::Duration::ZERO, - }; let debug_page = cfg.debug_page_addr.map(|addr| network::debug_page::Config { addr, @@ -169,6 +164,7 @@ pub(super) fn executor( server_addr: cfg.server_addr, public_addr: net::Host(cfg.public_addr.0.clone()), max_payload_size: cfg.max_payload_size, + view_timeout: cfg.view_timeout(), node_key: node_key(secrets) .context("node_key")? .context("missing node_key")?, diff --git a/core/node/consensus/src/testonly.rs b/core/node/consensus/src/testonly.rs index 479ca1f244cc..1a4da71f85a0 100644 --- a/core/node/consensus/src/testonly.rs +++ b/core/node/consensus/src/testonly.rs @@ -149,6 +149,7 @@ fn make_config( public_addr: config::Host(cfg.public_addr.0.clone()), max_payload_size: usize::MAX, max_batch_size: usize::MAX, + view_timeout: None, gossip_dynamic_inbound_limit: cfg.gossip.dynamic_inbound_limit, gossip_static_inbound: cfg .gossip diff --git a/core/node/eth_watch/src/tests/mod.rs b/core/node/eth_watch/src/tests/mod.rs index df91074beb18..0b34a34ab63f 100644 --- a/core/node/eth_watch/src/tests/mod.rs +++ b/core/node/eth_watch/src/tests/mod.rs @@ -480,7 +480,7 @@ async fn test_batch_root_processor_from_genesis() { .await .unwrap() .unwrap(); - let proof1 = hex::encode(&bincode::serialize(&proof1).unwrap()); + let proof1 = hex::encode(bincode::serialize(&proof1).unwrap()); assert_eq!(proof1, "000000000600000000000000420000000000000030783030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303042000000000000003078303030303030303030303030303030303030303030303030303030303030303530303030303030303030303030303030303030303030303030303030303030334200000000000000307830303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030316639420000000000000030783031303230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303042000000000000003078303932343932386331333737613663663234633339633264343666386562396466323365383131623236646333353237653534383339366664346531373362314200000000000000307833373561356266393039636230323134336533363935636136353865303634316537333961613539306630303034646261393335373263343463646239643264"); sl_client.set_last_finalized_block_number(11).await; @@ -492,7 +492,7 @@ async fn test_batch_root_processor_from_genesis() { .await .unwrap() .unwrap(); - let proof2 = hex::encode(&bincode::serialize(&proof2).unwrap()); + let proof2 = hex::encode(bincode::serialize(&proof2).unwrap()); assert_eq!(proof2, "0100000007000000000000004200000000000000307830303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303031420000000000000030783130613265663736653730396433313862343539626534396631653864376630326437313230663262353031626330616664646439333566316138313363363742000000000000003078303030303030303030303030303030303030303030303030303030303030303930303030303030303030303030303030303030303030303030303030303030334200000000000000307830303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030316639420000000000000030783031303230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303042000000000000003078303932343932386331333737613663663234633339633264343666386562396466323365383131623236646333353237653534383339366664346531373362314200000000000000307861333738613230636132376237616533303731643162643763326164613030343639616263353765343239646436663438613833303932646237303539613138"); let proof3 = connection @@ -501,7 +501,7 @@ async fn test_batch_root_processor_from_genesis() { .await .unwrap() .unwrap(); - let proof3 = hex::encode(&bincode::serialize(&proof3).unwrap()); + let proof3 = hex::encode(bincode::serialize(&proof3).unwrap()); assert_eq!(proof3, "02000000080000000000000042000000000000003078303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030324200000000000000307834363730306234643430616335633335616632633232646461323738376139316562353637623036633932346138666238616539613035623230633038633231420000000000000030786530633333333066363734623662326435373866393538613164626436366631363464303638623062623561396662303737656361303133393736666461366642000000000000003078303030303030303030303030303030303030303030303030303030303030306230303030303030303030303030303030303030303030303030303030303030334200000000000000307830303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030316639420000000000000030783031303230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303042000000000000003078303932343932386331333737613663663234633339633264343666386562396466323365383131623236646333353237653534383339366664346531373362314200000000000000307833373561356266393039636230323134336533363935636136353865303634316537333961613539306630303034646261393335373263343463646239643264"); } @@ -567,7 +567,7 @@ async fn test_batch_root_processor_restart() { .await .unwrap() .unwrap(); - let proof = hex::encode(&bincode::serialize(&proof).unwrap()); + let proof = hex::encode(bincode::serialize(&proof).unwrap()); assert_eq!(proof, "02000000080000000000000042000000000000003078303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030324200000000000000307834363730306234643430616335633335616632633232646461323738376139316562353637623036633932346138666238616539613035623230633038633231420000000000000030786530633333333066363734623662326435373866393538613164626436366631363464303638623062623561396662303737656361303133393736666461366642000000000000003078303030303030303030303030303030303030303030303030303030303030306230303030303030303030303030303030303030303030303030303030303030334200000000000000307830303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030316639420000000000000030783031303230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303042000000000000003078303932343932386331333737613663663234633339633264343666386562396466323365383131623236646333353237653534383339366664346531373362314200000000000000307833373561356266393039636230323134336533363935636136353865303634316537333961613539306630303034646261393335373263343463646239643264"); let proof = connection @@ -576,7 +576,7 @@ async fn test_batch_root_processor_restart() { .await .unwrap() .unwrap(); - let proof = hex::encode(&bincode::serialize(&proof).unwrap()); + let proof = hex::encode(bincode::serialize(&proof).unwrap()); assert_eq!(proof, "02000000080000000000000042000000000000003078303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030334200000000000000307837623765373735373139343639366666393634616233353837393131373362636337663735356132656161393334653935373061636533393139383435313265420000000000000030786530633333333066363734623662326435373866393538613164626436366631363464303638623062623561396662303737656361303133393736666461366642000000000000003078303030303030303030303030303030303030303030303030303030303030306430303030303030303030303030303030303030303030303030303030303030334200000000000000307830303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030316639420000000000000030783031303230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303042000000000000003078303932343932386331333737613663663234633339633264343666386562396466323365383131623236646333353237653534383339366664346531373362314200000000000000307835353063313735316338653764626166633839303939326634353532333636663064643565623665343362653535353936386264616338633732656466316261"); let proof = connection @@ -585,7 +585,7 @@ async fn test_batch_root_processor_restart() { .await .unwrap() .unwrap(); - let proof = hex::encode(&bincode::serialize(&proof).unwrap()); + let proof = hex::encode(bincode::serialize(&proof).unwrap()); assert_eq!(proof, "030000000900000000000000420000000000000030783030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303442000000000000003078303235663065363031353230366661626364326263613930316432633438396536336263356564346231356266356330633963363066396531363735383564614200000000000000307863633463343165646230633230333133343862323932623736386539626163316565386339326330396566386133323737633265636534303963313264383661420000000000000030783533656463316635616437396335393939626435373864666331333566396335316562643766616661343538356236346637316431356232646365316237323842000000000000003078303030303030303030303030303030303030303030303030303030303030306530303030303030303030303030303030303030303030303030303030303030334200000000000000307830303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030316639420000000000000030783031303230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303042000000000000003078303932343932386331333737613663663234633339633264343666386562396466323365383131623236646333353237653534383339366664346531373362314200000000000000307833373561356266393039636230323134336533363935636136353865303634316537333961613539306630303034646261393335373263343463646239643264"); let proof = connection @@ -594,7 +594,7 @@ async fn test_batch_root_processor_restart() { .await .unwrap() .unwrap(); - let proof = hex::encode(&bincode::serialize(&proof).unwrap()); + let proof = hex::encode(bincode::serialize(&proof).unwrap()); assert_eq!(proof, "030000000900000000000000420000000000000030783030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303542000000000000003078323465653435363834376535373364313635613832333634306632303834383139636331613865333433316562633635633865363064333435343266313637324200000000000000307863633463343165646230633230333133343862323932623736386539626163316565386339326330396566386133323737633265636534303963313264383661420000000000000030783533656463316635616437396335393939626435373864666331333566396335316562643766616661343538356236346637316431356232646365316237323842000000000000003078303030303030303030303030303030303030303030303030303030303030306530303030303030303030303030303030303030303030303030303030303030334200000000000000307830303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030316639420000000000000030783031303230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303042000000000000003078303932343932386331333737613663663234633339633264343666386562396466323365383131623236646333353237653534383339366664346531373362314200000000000000307833373561356266393039636230323134336533363935636136353865303634316537333961613539306630303034646261393335373263343463646239643264"); } diff --git a/core/node/genesis/src/utils.rs b/core/node/genesis/src/utils.rs index a9b0831b31bc..ac3435835e80 100644 --- a/core/node/genesis/src/utils.rs +++ b/core/node/genesis/src/utils.rs @@ -99,7 +99,7 @@ pub fn get_deduped_log_queries(storage_logs: &[StorageLog]) -> Vec { }) .collect(); - let deduped_log_queries: Vec = sort_storage_access_queries(&log_queries) + let deduped_log_queries: Vec = sort_storage_access_queries(log_queries) .1 .into_iter() .map(|log_query| LogQuery { diff --git a/core/node/node_sync/src/tree_data_fetcher/provider/tests.rs b/core/node/node_sync/src/tree_data_fetcher/provider/tests.rs index 75bf96092335..e8c855359390 100644 --- a/core/node/node_sync/src/tree_data_fetcher/provider/tests.rs +++ b/core/node/node_sync/src/tree_data_fetcher/provider/tests.rs @@ -418,7 +418,7 @@ async fn using_different_settlement_layers() { .batch_details(number, &get_last_l2_block(&mut storage, number).await) .await .unwrap() - .expect(&format!("no root hash for batch #{number}")); + .unwrap_or_else(|err| panic!("no root hash for batch #{number}: {err:?}")); assert_eq!(root_hash, H256::repeat_byte(number.0 as u8)); let past_l1_batch = provider.past_l1_batch.unwrap(); diff --git a/core/tests/vm-benchmark/src/vm.rs b/core/tests/vm-benchmark/src/vm.rs index e69e7ca1e909..a4b61ee54809 100644 --- a/core/tests/vm-benchmark/src/vm.rs +++ b/core/tests/vm-benchmark/src/vm.rs @@ -113,12 +113,11 @@ impl CountInstructions for Fast { } let (system_env, l1_batch_env) = test_env(); - let mut vm = - vm_fast::Vm::<_, InstructionCount>::custom(l1_batch_env, system_env, &*STORAGE); + let mut vm = vm_fast::Vm::custom(l1_batch_env, system_env, &*STORAGE); vm.push_transaction(tx.clone()); - let mut tracer = InstructionCount(0); + let mut tracer = (InstructionCount(0), ()); vm.inspect(&mut tracer, InspectExecutionMode::OneTx); - tracer.0 + tracer.0 .0 } } diff --git a/prover/Cargo.lock b/prover/Cargo.lock index 453a768c0678..fa8de019c740 100644 --- a/prover/Cargo.lock +++ b/prover/Cargo.lock @@ -63,9 +63,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-tzdata" @@ -142,9 +142,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" [[package]] name = "arr_macro" @@ -241,7 +241,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -252,7 +252,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -323,10 +323,10 @@ dependencies = [ "axum-core", "bytes", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "http-body-util", - "hyper 1.5.1", + "hyper 1.5.2", "hyper-util", "itoa", "matchit", @@ -341,7 +341,7 @@ dependencies = [ "serde_urlencoded", "sync_wrapper 1.0.2", "tokio", - "tower 0.5.1", + "tower 0.5.2", "tower-layer", "tower-service", "tracing", @@ -356,7 +356,7 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "http-body-util", "mime", @@ -441,9 +441,9 @@ dependencies = [ [[package]] name = "bigdecimal" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f850665a0385e070b64c38d2354e6c104c8479c59868d1e48a0c13ee2c7a1c1" +checksum = "7f31f3af01c5c65a07985c804d3366560e6fa7883d640a122819b14ec327482c" dependencies = [ "autocfg", "libm", @@ -480,17 +480,17 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.89", + "syn 2.0.90", "which", ] [[package]] name = "bit-set" -version = "0.5.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ - "bit-vec", + "bit-vec 0.8.0", ] [[package]] @@ -502,6 +502,12 @@ dependencies = [ "serde", ] +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitflags" version = "1.3.2" @@ -619,9 +625,9 @@ dependencies = [ [[package]] name = "boojum" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ec2f007ff8f90cc459f03e9f30ca1065440170f013c868823646e2e48d0234" +checksum = "4337dc7b196fc3e5e55e2857bc21638b7441429ee1a953201a9cd2be187b764e" dependencies = [ "arrayvec 0.7.6", "bincode", @@ -651,9 +657,9 @@ dependencies = [ [[package]] name = "boojum-cuda" -version = "0.151.1" +version = "0.152.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b63a717789f92f16fd566c78655d64017c690be59e473c3e769080c975a1f9e" +checksum = "380468fadcba5dcc4021f18f4516a7aa4f4d0ec598c76cd7e7c5f2ff6a56733f" dependencies = [ "boojum", "cmake", @@ -661,6 +667,7 @@ dependencies = [ "era_cudart_sys", "itertools 0.13.0", "lazy_static", + "snark_wrapper", ] [[package]] @@ -683,14 +690,14 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] name = "bstr" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a68f1f47cdf0ec8ee4b941b2eee2a80cb796db73118c0dd09ac63fbe405be22" +checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8" dependencies = [ "memchr", "regex-automata 0.4.9", @@ -739,15 +746,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cc" -version = "1.2.1" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" dependencies = [ "jobserver", "libc", @@ -783,9 +790,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", @@ -798,11 +805,11 @@ dependencies = [ [[package]] name = "circuit_definitions" -version = "0.150.7" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76be9ee6e75f1f948d175ab9820ecc7189f72154c95ca503a1974012356f5363" +checksum = "931448074d9dad8aa7cf8f8f8d67101d4b2aac4d1f4699708b0744a9c000fc0b" dependencies = [ - "circuit_encodings 0.150.7", + "circuit_encodings", "crossbeam", "derivative", "seq-macro", @@ -812,117 +819,26 @@ dependencies = [ [[package]] name = "circuit_encodings" -version = "0.140.3" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf6b7cc842eadb4c250cdc6a8bc1dd97624d9f08bbe54db3e11fb23c3a72be07" +checksum = "e3dcfcb4aaa17e6a81ebd2db688d980aff50aa643d9b506d4d11c84976dbc03f" 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", + "zk_evm 0.150.18", + "zkevm_circuits", ] [[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", ] @@ -948,15 +864,15 @@ dependencies = [ "bitflags 1.3.2", "strsim 0.8.0", "textwrap", - "unicode-width", + "unicode-width 0.1.14", "vec_map", ] [[package]] name = "clap" -version = "4.5.21" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" dependencies = [ "clap_builder", "clap_derive", @@ -964,9 +880,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.21" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" dependencies = [ "anstream", "anstyle", @@ -983,14 +899,14 @@ dependencies = [ "heck 0.5.0", "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] name = "clap_lex" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "cmake" @@ -1018,12 +934,12 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "colored" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -1053,15 +969,15 @@ dependencies = [ [[package]] name = "console" -version = "0.15.8" +version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" dependencies = [ "encode_unicode", - "lazy_static", "libc", - "unicode-width", - "windows-sys 0.52.0", + "once_cell", + "unicode-width 0.2.0", + "windows-sys 0.59.0", ] [[package]] @@ -1087,18 +1003,18 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const_format" -version = "0.2.33" +version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c655d81ff1114fb0dcdea9225ea9f0cc712a6f8d189378e82bdf62a473a64b" +checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" dependencies = [ "const_format_proc_macros", ] [[package]] name = "const_format_proc_macros" -version = "0.2.33" +version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff1a44b93f47b1bac19a27932f5c591e43d1ba357ee4f61526c8a25603f0eb1" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", @@ -1194,18 +1110,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.13" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -1222,18 +1138,18 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" @@ -1292,7 +1208,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" dependencies = [ "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -1329,7 +1245,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -1377,7 +1293,7 @@ dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", "strsim 0.11.1", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -1399,7 +1315,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -1480,7 +1396,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", "unicode-xid 0.2.6", ] @@ -1493,7 +1409,7 @@ dependencies = [ "console", "shell-words", "tempfile", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -1538,7 +1454,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -1631,7 +1547,7 @@ dependencies = [ "enum-ordinalize", "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -1694,9 +1610,9 @@ dependencies = [ [[package]] name = "encode_unicode" -version = "0.3.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "encoding_rs" @@ -1724,7 +1640,7 @@ checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -1736,7 +1652,7 @@ dependencies = [ "once_cell", "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -1790,9 +1706,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "era_cudart" -version = "0.151.1" +version = "0.152.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad950752eeb44f8938be405b95a1630f82e903f4a7adda355d92aad135fcd382" +checksum = "ac345935bc5d367922a8e44f8b9b8f909f564b4cdc922567e9d3fe6b0fafab28" dependencies = [ "bitflags 2.6.0", "era_cudart_sys", @@ -1801,21 +1717,21 @@ dependencies = [ [[package]] name = "era_cudart_sys" -version = "0.151.1" +version = "0.152.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c38607d52509b5db97cc4447c8644d6c5ca84f22ff8a9254f984669b1eb82ed4" +checksum = "50eca396c549365468fa210b0c9c4a38895e4bff4ae5ce6f6626c337010de143" dependencies = [ "serde_json", ] [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1842,7 +1758,7 @@ dependencies = [ "serde", "serde_json", "sha3 0.10.8", - "thiserror", + "thiserror 1.0.69", "uint", ] @@ -1886,9 +1802,9 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" dependencies = [ "event-listener", "pin-project-lite", @@ -1896,9 +1812,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "ff" @@ -2024,12 +1940,12 @@ dependencies = [ [[package]] name = "franklin-crypto" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "971289216ea5c91872e5e0bb6989214b537bbce375d09fabea5c3ccfe031b204" +checksum = "5c128e2cf791053b3aefdd7b07d6e5ffdc7cf5dd779ca270d727a403057dfb68" dependencies = [ "arr_macro", - "bit-vec", + "bit-vec 0.6.3", "blake2 0.9.2", "blake2-rfc_bellman_edition", "blake2s_simd", @@ -2158,7 +2074,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -2253,7 +2169,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -2299,7 +2215,7 @@ dependencies = [ "reqwest 0.12.9", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "time", "tokio", "tracing", @@ -2313,7 +2229,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f945a208886a13d07636f38fb978da371d0abc3e34bad338124b9f8c135a8f" dependencies = [ "reqwest 0.12.9", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -2343,7 +2259,7 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.69", "time", "tokio", "tracing", @@ -2393,7 +2309,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.6.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -2411,8 +2327,8 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.1.0", - "indexmap 2.6.0", + "http 1.2.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -2476,7 +2392,7 @@ dependencies = [ "base64 0.21.7", "bytes", "headers-core", - "http 1.1.0", + "http 1.2.0", "httpdate", "mime", "sha1", @@ -2488,7 +2404,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" dependencies = [ - "http 1.1.0", + "http 1.2.0", ] [[package]] @@ -2547,11 +2463,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2578,9 +2494,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -2605,7 +2521,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.1.0", + "http 1.2.0", ] [[package]] @@ -2616,7 +2532,7 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "pin-project-lite", ] @@ -2651,9 +2567,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.31" +version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ "bytes", "futures-channel", @@ -2675,15 +2591,15 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", "futures-util", "h2 0.4.7", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "httparse", "httpdate", @@ -2703,8 +2619,8 @@ dependencies = [ "bytes", "futures-util", "headers", - "http 1.1.0", - "hyper 1.5.1", + "http 1.2.0", + "hyper 1.5.2", "hyper-rustls", "hyper-util", "pin-project-lite", @@ -2721,8 +2637,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", - "http 1.1.0", - "hyper 1.5.1", + "http 1.2.0", + "hyper 1.5.2", "hyper-util", "log", "rustls", @@ -2739,7 +2655,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" dependencies = [ - "hyper 1.5.1", + "hyper 1.5.2", "hyper-util", "pin-project-lite", "tokio", @@ -2753,7 +2669,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.31", + "hyper 0.14.32", "native-tls", "tokio", "tokio-native-tls", @@ -2767,7 +2683,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.5.1", + "hyper 1.5.2", "hyper-util", "native-tls", "tokio", @@ -2784,9 +2700,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", - "hyper 1.5.1", + "hyper 1.5.2", "pin-project-lite", "socket2", "tokio", @@ -2932,7 +2848,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -2997,7 +2913,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -3012,9 +2928,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -3125,7 +3041,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.69", "walkdir", ] @@ -3146,10 +3062,11 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -3162,7 +3079,7 @@ dependencies = [ "jsonptr", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3177,7 +3094,7 @@ dependencies = [ "pest_derive", "regex", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3217,14 +3134,14 @@ dependencies = [ "futures-channel", "futures-util", "gloo-net", - "http 1.1.0", + "http 1.2.0", "jsonrpsee-core", "pin-project", "rustls", "rustls-pki-types", "rustls-platform-verifier", "soketto", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-rustls", "tokio-util", @@ -3244,7 +3161,7 @@ dependencies = [ "bytes", "futures-timer", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "http-body-util", "jsonrpsee-types", @@ -3252,7 +3169,7 @@ dependencies = [ "rustc-hash", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", "tracing", @@ -3268,7 +3185,7 @@ dependencies = [ "async-trait", "base64 0.22.1", "http-body 1.0.1", - "hyper 1.5.1", + "hyper 1.5.2", "hyper-rustls", "hyper-util", "jsonrpsee-core", @@ -3277,7 +3194,7 @@ dependencies = [ "rustls-platform-verifier", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tower 0.4.13", "tracing", @@ -3294,7 +3211,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -3304,10 +3221,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c465fbe385238e861fdc4d1c85e04ada6c1fd246161d26385c1b311724d2af" dependencies = [ "beef", - "http 1.1.0", + "http 1.2.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3327,7 +3244,7 @@ version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c28759775f5cb2f1ea9667672d3fe2b0e701d1f4b7b67954e60afe7fd058b5e" dependencies = [ - "http 1.1.0", + "http 1.2.0", "jsonrpsee-client-transport", "jsonrpsee-core", "jsonrpsee-types", @@ -3422,10 +3339,10 @@ dependencies = [ "either", "futures 0.3.31", "home", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "http-body-util", - "hyper 1.5.1", + "hyper 1.5.2", "hyper-http-proxy", "hyper-rustls", "hyper-timeout", @@ -3440,10 +3357,10 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-util", - "tower 0.5.1", + "tower 0.5.2", "tower-http", "tracing", ] @@ -3456,14 +3373,14 @@ checksum = "f42346d30bb34d1d7adc5c549b691bce7aa3a1e60254e68fab7e2d7b26fe3d77" dependencies = [ "chrono", "form_urlencoded", - "http 1.1.0", + "http 1.2.0", "json-patch", "k8s-openapi", "schemars", "serde", "serde-value", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3476,7 +3393,7 @@ dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", "serde_json", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -3501,7 +3418,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-util", "tracing", @@ -3524,15 +3441,15 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.166" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", "windows-targets 0.52.6", @@ -3575,7 +3492,7 @@ checksum = "612ed4ea9ce5acfb5d26339302528a5e1e59dfed95e9e11af3c083236ff1d15d" dependencies = [ "libc", "neli", - "thiserror", + "thiserror 1.0.69", "windows-sys 0.48.0", ] @@ -3615,7 +3532,7 @@ dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", "regex-syntax 0.6.29", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -3678,8 +3595,8 @@ checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" dependencies = [ "miette-derive", "once_cell", - "thiserror", - "unicode-width", + "thiserror 1.0.69", + "unicode-width 0.1.14", ] [[package]] @@ -3690,7 +3607,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -3717,20 +3634,19 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi 0.3.9", "libc", "wasi", "windows-sys 0.52.0", @@ -3991,7 +3907,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -4003,7 +3919,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -4056,7 +3972,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -4088,7 +4004,7 @@ dependencies = [ "js-sys", "once_cell", "pin-project-lite", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4111,7 +4027,7 @@ checksum = "ad31e9de44ee3538fb9d64fe3376c1362f406162434609e79aea2a41a0af78ab" dependencies = [ "async-trait", "bytes", - "http 1.1.0", + "http 1.2.0", "opentelemetry", "reqwest 0.12.9", ] @@ -4124,14 +4040,14 @@ checksum = "6b925a602ffb916fb7421276b86756027b37ee708f9dce2dbdcc51739f07e727" dependencies = [ "async-trait", "futures-core", - "http 1.1.0", + "http 1.2.0", "opentelemetry", "opentelemetry-http", "opentelemetry-proto", "opentelemetry_sdk", - "prost 0.13.3", + "prost 0.13.4", "reqwest 0.12.9", - "thiserror", + "thiserror 1.0.69", "tokio", "tonic", ] @@ -4144,7 +4060,7 @@ checksum = "30ee9f20bff9c984511a02f082dc8ede839e4a9bf15cc2487c8d6fea5ad850d9" dependencies = [ "opentelemetry", "opentelemetry_sdk", - "prost 0.13.3", + "prost 0.13.4", "tonic", ] @@ -4170,7 +4086,7 @@ dependencies = [ "percent-encoding", "rand 0.8.5", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", ] @@ -4186,9 +4102,9 @@ dependencies = [ [[package]] name = "os_info" -version = "3.8.2" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae99c7fa6dd38c7cafe1ec085e804f8f555a2f8659b0dbe03f1f9963a9b51092" +checksum = "e5ca711d8b83edbb00b44d504503cd247c9c0bd8b0fa2694f2a1a3d8165379ce" dependencies = [ "log", "serde", @@ -4215,29 +4131,28 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.7.0" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be4817d39f3272f69c59fe05d0535ae6456c2dc2fa1ba02910296c7e0a5c590" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ "arrayvec 0.7.6", "bitvec", "byte-slice-cast", "impl-trait-for-tuples", "parity-scale-codec-derive", - "rustversion", "serde", ] [[package]] name = "parity-scale-codec-derive" -version = "3.7.0" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8781a75c6205af67215f382092b6e0a4ff3734798523e69073d4bcd294ec767b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 1.0.109", ] [[package]] @@ -4302,20 +4217,20 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.14" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" +checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror", + "thiserror 2.0.7", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.14" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd" +checksum = "816518421cfc6887a0d62bf441b6ffb4536fcc926395a69e1a85852d4363f57e" dependencies = [ "pest", "pest_generator", @@ -4323,22 +4238,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.14" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e" +checksum = "7d1396fd3a870fc7838768d171b4616d5c91f6cc25e377b673d714567d99377b" dependencies = [ "pest", "pest_meta", "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] name = "pest_meta" -version = "2.7.14" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d" +checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea" dependencies = [ "once_cell", "pest", @@ -4352,7 +4267,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.6.0", + "indexmap 2.7.0", ] [[package]] @@ -4372,7 +4287,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -4483,7 +4398,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2 1.0.92", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -4595,17 +4510,17 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] name = "proptest" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ "bit-set", - "bit-vec", + "bit-vec 0.8.0", "bitflags 2.6.0", "lazy_static", "num-traits", @@ -4630,12 +4545,12 @@ dependencies = [ [[package]] name = "prost" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" +checksum = "2c0fef6c4230e4ccf618a35c59d7ede15dea37de8427500f50aff708806e42ec" dependencies = [ "bytes", - "prost-derive 0.13.3", + "prost-derive 0.13.4", ] [[package]] @@ -4655,7 +4570,7 @@ dependencies = [ "prost 0.12.6", "prost-types", "regex", - "syn 2.0.89", + "syn 2.0.90", "tempfile", ] @@ -4669,20 +4584,20 @@ dependencies = [ "itertools 0.12.1", "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] name = "prost-derive" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" +checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3" dependencies = [ "anyhow", "itertools 0.13.0", "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -4722,7 +4637,7 @@ dependencies = [ "prost-reflect", "prost-types", "protox-parse", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4734,7 +4649,7 @@ dependencies = [ "logos", "miette", "prost-types", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4746,7 +4661,7 @@ dependencies = [ "bincode", "chrono", "circuit_definitions", - "clap 4.5.21", + "clap 4.5.23", "colored", "dialoguer", "hex", @@ -4940,9 +4855,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags 2.6.0", ] @@ -5014,7 +4929,7 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.31", + "hyper 0.14.32", "hyper-tls 0.5.0", "ipnet", "js-sys", @@ -5053,10 +4968,10 @@ dependencies = [ "futures-core", "futures-util", "h2 0.4.7", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "http-body-util", - "hyper 1.5.1", + "hyper 1.5.2", "hyper-rustls", "hyper-tls 0.6.0", "hyper-util", @@ -5095,18 +5010,18 @@ checksum = "562ceb5a604d3f7c885a792d42c199fd8af239d0a51b2fa6a78aafa092452b04" dependencies = [ "anyhow", "async-trait", - "http 1.1.0", + "http 1.2.0", "reqwest 0.12.9", "serde", - "thiserror", + "thiserror 1.0.69", "tower-service", ] [[package]] name = "rescue_poseidon" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82900c877a0ba5362ac5756efbd82c5b795dc509011c1253e2389d8708f1389d" +checksum = "b62e4ce7543582ab2df1d9544674a55897e168a23afe938a57e1547d2981a7f4" dependencies = [ "addchain", "arrayvec 0.7.6", @@ -5267,22 +5182,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.41" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "rustls" -version = "0.23.19" +version = "0.23.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" dependencies = [ "aws-lc-rs", "log", @@ -5339,9 +5254,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" [[package]] name = "rustls-platform-verifier" @@ -5445,7 +5360,7 @@ dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", "serde_derive_internals", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -5563,9 +5478,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" [[package]] name = "send_wrapper" @@ -5675,7 +5590,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "time", "url", "uuid", @@ -5689,9 +5604,9 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] @@ -5708,13 +5623,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -5725,7 +5640,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -5792,7 +5707,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "itoa", "ryu", "serde", @@ -5894,12 +5809,11 @@ checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" [[package]] name = "shivini" -version = "0.151.1" +version = "0.152.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d2ac4440b6c23005c43a81cf064b9aa123fbeb992ac91cd04c7d485abb1fbea" +checksum = "2673af97e7ea5aef8d1d2ad395e3833a2a9fd8aca6361c2516c44734c0ed92e2" dependencies = [ "bincode", - "blake2 0.10.6", "boojum", "boojum-cuda", "circuit_definitions", @@ -5907,9 +5821,9 @@ dependencies = [ "era_cudart", "era_cudart_sys", "hex", + "itertools 0.13.0", "rand 0.8.5", "serde", - "sha2 0.10.8", "smallvec", ] @@ -5962,7 +5876,7 @@ checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint 0.4.6", "num-traits", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -5986,20 +5900,21 @@ dependencies = [ [[package]] name = "snark_wrapper" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5dfdc3eed51d79541adff827593743750fe6626a65006814f8cfa4273371de" +checksum = "74645922ea9e18fbd4b6ae9c58e6a7080403edd81e558b610cf5b9dc60a90351" dependencies = [ "derivative", "rand 0.4.6", "rescue_poseidon", + "serde", ] [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -6007,9 +5922,9 @@ dependencies = [ [[package]] name = "soketto" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" +checksum = "2e859df029d160cb88608f5d7df7fb4753fd20fdfb4de5644f3d8b8440841721" dependencies = [ "base64 0.22.1", "bytes", @@ -6101,7 +6016,7 @@ dependencies = [ "hashbrown 0.14.5", "hashlink", "hex", - "indexmap 2.6.0", + "indexmap 2.7.0", "ipnetwork", "log", "memchr", @@ -6115,7 +6030,7 @@ dependencies = [ "sha2 0.10.8", "smallvec", "sqlformat", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", "tracing", @@ -6132,7 +6047,7 @@ dependencies = [ "quote 1.0.37", "sqlx-core", "sqlx-macros-core", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -6155,7 +6070,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.89", + "syn 2.0.90", "tempfile", "tokio", "url", @@ -6201,7 +6116,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.69", "tracing", "whoami", ] @@ -6244,7 +6159,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.69", "tracing", "whoami", ] @@ -6357,7 +6272,7 @@ dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", "rustversion", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -6390,9 +6305,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.89" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", @@ -6422,7 +6337,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -6520,7 +6435,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -6529,7 +6444,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" dependencies = [ - "unicode-width", + "unicode-width 0.1.14", ] [[package]] @@ -6538,7 +6453,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" +dependencies = [ + "thiserror-impl 2.0.7", ] [[package]] @@ -6549,7 +6473,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36" +dependencies = [ + "proc-macro2 1.0.92", + "quote 1.0.37", + "syn 2.0.90", ] [[package]] @@ -6573,9 +6508,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -6594,9 +6529,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", @@ -6647,9 +6582,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.1" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", @@ -6671,7 +6606,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -6686,20 +6621,19 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ "rustls", - "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -6708,9 +6642,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", @@ -6744,7 +6678,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "toml_datetime", "winnow 0.5.40", ] @@ -6755,7 +6689,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "toml_datetime", "winnow 0.6.20", ] @@ -6772,15 +6706,15 @@ dependencies = [ "base64 0.22.1", "bytes", "h2 0.4.7", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "http-body-util", - "hyper 1.5.1", + "hyper 1.5.2", "hyper-timeout", "hyper-util", "percent-encoding", "pin-project", - "prost 0.13.3", + "prost 0.13.4", "socket2", "tokio", "tokio-stream", @@ -6812,14 +6746,14 @@ dependencies = [ [[package]] name = "tower" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", "pin-project-lite", - "sync_wrapper 0.1.2", + "sync_wrapper 1.0.2", "tokio", "tokio-util", "tower-layer", @@ -6836,7 +6770,7 @@ dependencies = [ "base64 0.22.1", "bitflags 2.6.0", "bytes", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "mime", "pin-project-lite", @@ -6877,7 +6811,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -6921,9 +6855,9 @@ dependencies = [ [[package]] name = "tracing-serde" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1" dependencies = [ "serde", "tracing-core", @@ -6931,9 +6865,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -6969,7 +6903,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -7031,9 +6965,9 @@ checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-bidi" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" @@ -7068,6 +7002,12 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "unicode-xid" version = "0.1.0" @@ -7110,9 +7050,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.10.1" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b74fc6b57825be3373f7054754755f03ac3a8f5d70015ccad699ba2029956f4a" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ "base64 0.22.1", "log", @@ -7210,7 +7150,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "671d3b894d5d0849f0a597f56bf071f42d4f2a1cbcf2f78ca21f870ab7c0cc2b" dependencies = [ - "hyper 0.14.31", + "hyper 0.14.32", "once_cell", "tokio", "tracing", @@ -7225,7 +7165,7 @@ checksum = "6a511871dc5de990a3b2a0e715facfbc5da848c0c0395597a1415029fb7c250a" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -7270,9 +7210,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -7281,36 +7221,36 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote 1.0.37", "wasm-bindgen-macro-support", @@ -7318,22 +7258,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "wasm-streams" @@ -7350,9 +7290,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", @@ -7692,7 +7632,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", "synstructure", ] @@ -7714,7 +7654,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -7734,7 +7674,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", "synstructure", ] @@ -7755,7 +7695,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -7777,7 +7717,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2 1.0.92", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -7848,9 +7788,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", @@ -7858,7 +7798,7 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "zk_evm_abstractions 0.150.7", + "zk_evm_abstractions 0.150.18", ] [[package]] @@ -7889,22 +7829,22 @@ 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", + "zkevm_opcode_defs 0.150.18", ] [[package]] name = "zkevm-assembly" -version = "0.150.7" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf011a0c83cbfb175f1e60811f0e0cd56551c9e35df596a762556662c638deb9" +checksum = "b4fdb2b380c43157160ec5f3f4f6912c6c9923e2a00886e79b7f5464f59108a7" dependencies = [ "env_logger 0.9.3", "hex", @@ -7916,59 +7856,15 @@ dependencies = [ "sha3 0.10.8", "smallvec", "structopt", - "thiserror", - "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", + "thiserror 1.0.69", + "zkevm_opcode_defs 0.150.18", ] [[package]] name = "zkevm_circuits" -version = "0.150.7" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06fb35b00699d25175a2ad447f86a9088af8b0bc698bb57086fb04c13e52eab" +checksum = "8b94288d2e246aecd6eecd22ef27db0d1f29a91cb4f59b9e339a45237131a9ff" dependencies = [ "arrayvec 0.7.6", "boojum", @@ -7980,7 +7876,7 @@ dependencies = [ "seq-macro", "serde", "smallvec", - "zkevm_opcode_defs 0.150.7", + "zkevm_opcode_defs 0.150.18", "zksync_cs_derive", ] @@ -8028,9 +7924,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 0.10.6", @@ -8045,13 +7941,14 @@ dependencies = [ [[package]] name = "zkevm_test_harness" -version = "0.150.7" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c801aa17e9009699aacf654588d6adfaeeb8a490b2d9121847c201e2766803" +checksum = "9bd2de75d0bf68137ba150e05dd5d36baad03e682e06b8616643c72b3fcce05d" dependencies = [ "bincode", "circuit_definitions", - "circuit_sequencer_api 0.150.7", + "circuit_encodings", + "circuit_sequencer_api", "codegen", "crossbeam", "derivative", @@ -8072,9 +7969,9 @@ dependencies = [ [[package]] name = "zksync-gpu-ffi" -version = "0.151.1" +version = "0.152.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5688dc060456f6c1e790d589f3abd6d9e9a11eb393d7383fbeb23b55961951e0" +checksum = "bc1f77eb5f1a513357e53fba148f46a03fdbea222dc71f270123984059c285bf" dependencies = [ "cmake", "crossbeam", @@ -8087,11 +7984,11 @@ dependencies = [ [[package]] name = "zksync-gpu-prover" -version = "0.151.1" +version = "0.152.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5714848e6f8361820346483246dd68b4e7fb05ec41dd6610a8b53fb5c3ca7f3a" +checksum = "3cc0c452445a120c5928e0ac89d47242f407b303ee819e3b7b2a97f6ce7491e4" dependencies = [ - "bit-vec", + "bit-vec 0.6.3", "cfg-if", "crossbeam", "franklin-crypto", @@ -8104,9 +8001,9 @@ dependencies = [ [[package]] name = "zksync-wrapper-prover" -version = "0.151.1" +version = "0.152.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52a6a1863818d939d445c53af57e53c222f11c2c94b9a94c3612dd938a3d983c" +checksum = "972dc1059d4a97ad075ab5a3589722b16d22c5241ba6e711ac18a73195aa6584" dependencies = [ "circuit_definitions", "zkevm_test_harness", @@ -8129,19 +8026,19 @@ dependencies = [ "serde_with", "sha2 0.10.8", "strum", - "thiserror", + "thiserror 1.0.69", "tiny-keccak 2.0.2", "url", ] [[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", + "bit-vec 0.6.3", "blake2s_simd", "byteorder", "cfg-if", @@ -8164,7 +8061,7 @@ dependencies = [ "anyhow", "async-trait", "bincode", - "clap 4.5.21", + "clap 4.5.23", "shivini", "tokio", "tokio-util", @@ -8209,16 +8106,16 @@ dependencies = [ [[package]] name = "zksync_concurrency" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c24c9a056499823227503dd9e5fb3037d93bcc3ae9b06c1ac0a47334c6283af" +checksum = "e8312ab73d3caa55775bd531795b507fa8f76bd9dabfaeb0954fe43e8fc1323b" dependencies = [ "anyhow", "once_cell", "pin-project", "rand 0.8.5", "sha3 0.10.8", - "thiserror", + "thiserror 1.0.69", "time", "tokio", "tracing", @@ -8244,9 +8141,9 @@ dependencies = [ [[package]] name = "zksync_consensus_crypto" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da303b01f24283e93f80f361bf62c3df4a761d061c8b38b4faebeebf26362fc" +checksum = "86b539960de98df3c3bd27d2d9b97de862027686bbb3bdfc5aaad5b74bb929a1" dependencies = [ "anyhow", "blst", @@ -8258,25 +8155,25 @@ dependencies = [ "num-traits", "rand 0.8.5", "sha3 0.10.8", - "thiserror", + "thiserror 1.0.69", "tracing", "zeroize", ] [[package]] name = "zksync_consensus_roles" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f07db2a8ec2d2cda5cb4c5ac408101e81c8fa5d95c9f3302829dafae78d11c" +checksum = "c49949546895a10431b9daec6ec4208ef0917ace006446d304b51f5b234ba462" dependencies = [ "anyhow", - "bit-vec", + "bit-vec 0.6.3", "hex", "num-bigint 0.4.6", "prost 0.12.6", "rand 0.8.5", "serde", - "thiserror", + "thiserror 1.0.69", "tracing", "zksync_concurrency", "zksync_consensus_crypto", @@ -8287,15 +8184,15 @@ dependencies = [ [[package]] name = "zksync_consensus_storage" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a42f57cc5afcee634cbd336e9e6ea891d0171352d7c0bc7d6e17f6c8faa554" +checksum = "feb0d6a54e7d8d2adeee4ba38662161e9309180ad497299092e5641db9fb1c1e" dependencies = [ "anyhow", "async-trait", "prost 0.12.6", "rand 0.8.5", - "thiserror", + "thiserror 1.0.69", "tracing", "vise", "zksync_concurrency", @@ -8307,13 +8204,13 @@ dependencies = [ [[package]] name = "zksync_consensus_utils" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3222410c67617a86edb192e0c4bb48afc254a17052200a0a839c90e8b0378842" +checksum = "723e2a4b056cc5af192a83163c89a6951ee75c098cc5c4a4cdc435f4232d88bd" dependencies = [ "anyhow", "rand 0.8.5", - "thiserror", + "thiserror 1.0.69", "zksync_concurrency", ] @@ -8356,15 +8253,15 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.69", "zksync_basic_types", ] [[package]] name = "zksync_cs_derive" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5939e2df4288c263c706ff18ac718e984149223ad4289d6d957d767dcfc04c81" +checksum = "63296ce43c432d5d0111604173e874b2f2a856e1cb1c76378fa0bb5ac6018c27" dependencies = [ "proc-macro-error", "proc-macro2 1.0.92", @@ -8388,7 +8285,7 @@ dependencies = [ "serde_json", "sqlx", "strum", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "vise", @@ -8416,7 +8313,7 @@ dependencies = [ "serde", "serde_json", "sqlx", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "vise", @@ -8441,7 +8338,7 @@ dependencies = [ "async-trait", "jsonrpsee", "rlp", - "thiserror", + "thiserror 1.0.69", "tracing", "vise", "zksync_config", @@ -8457,16 +8354,16 @@ version = "0.1.0" dependencies = [ "async-trait", "rlp", - "thiserror", + "thiserror 1.0.69", "zksync_basic_types", "zksync_crypto_primitives", ] [[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", @@ -8477,9 +8374,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 0.4.6", "num-integer", @@ -8492,9 +8389,9 @@ dependencies = [ [[package]] name = "zksync_kzg" -version = "0.150.7" +version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc58af8e4e4ad1a851ffd2275e6a44ead0f15a7eaac9dc9d60a56b3b9c9b08e8" +checksum = "6384d2475e4a7e6ed4e2a703724cac1d8972d9ec40c49fdd17bf37942a81a635" dependencies = [ "boojum", "derivative", @@ -8504,7 +8401,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "zkevm_circuits 0.150.7", + "zkevm_circuits", ] [[package]] @@ -8536,23 +8433,19 @@ name = "zksync_multivm" version = "0.1.0" 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", "hex", "itertools 0.10.5", "once_cell", - "thiserror", + "thiserror 1.0.69", "tracing", "vise", "zk_evm 0.131.0-rc.2", "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", @@ -8571,7 +8464,7 @@ dependencies = [ "flate2", "google-cloud-auth", "google-cloud-storage", - "http 1.1.0", + "http 1.2.0", "prost 0.12.6", "rand 0.8.5", "reqwest 0.12.9", @@ -8586,9 +8479,9 @@ dependencies = [ [[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", @@ -8604,8 +8497,8 @@ dependencies = [ "anyhow", "async-trait", "bincode", - "circuit_sequencer_api 0.150.7", - "clap 4.5.21", + "circuit_sequencer_api", + "clap 4.5.23", "ctrlc", "futures 0.3.31", "reqwest 0.12.9", @@ -8633,12 +8526,12 @@ dependencies = [ [[package]] name = "zksync_protobuf" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05755c38b134b409736008bfdfd0fdb42bfa061947be93be4c78069aa10c9b3" +checksum = "e8986ad796f8e00d8999fee72effba1a21bce40f5f877d681ac9cd89a94834d8" dependencies = [ "anyhow", - "bit-vec", + "bit-vec 0.6.3", "once_cell", "prost 0.12.6", "prost-reflect", @@ -8654,9 +8547,9 @@ dependencies = [ [[package]] name = "zksync_protobuf_build" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c3930a73ca667780be6dcd94e469d40a93fa52f4654c9ab732991b62238cb5" +checksum = "8d870b31995e3acb8e47afeb68ebeeffcf6121e70020e65b3d5d31692115d236" dependencies = [ "anyhow", "heck 0.5.0", @@ -8666,7 +8559,7 @@ dependencies = [ "prost-reflect", "protox", "quote 1.0.37", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -8682,6 +8575,7 @@ dependencies = [ "serde_yaml", "tracing", "zksync_basic_types", + "zksync_concurrency", "zksync_config", "zksync_protobuf", "zksync_protobuf_build", @@ -8742,7 +8636,7 @@ dependencies = [ "anyhow", "async-trait", "circuit_definitions", - "clap 4.5.21", + "clap 4.5.23", "ctrlc", "futures 0.3.31", "local-ip-address", @@ -8775,7 +8669,7 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "clap 4.5.21", + "clap 4.5.23", "ctrlc", "futures 0.3.31", "log", @@ -8828,7 +8722,7 @@ name = "zksync_prover_interface" version = "0.1.0" dependencies = [ "chrono", - "circuit_sequencer_api 0.150.7", + "circuit_sequencer_api", "serde", "serde_with", "strum", @@ -8844,7 +8738,7 @@ dependencies = [ "anyhow", "async-trait", "axum", - "clap 4.5.21", + "clap 4.5.23", "ctrlc", "serde", "tokio", @@ -8880,6 +8774,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bincode", + "boojum-cuda", "circuit_definitions", "futures 0.3.31", "hex", @@ -8911,9 +8806,9 @@ dependencies = [ [[package]] name = "zksync_solidity_vk_codegen" -version = "0.30.1" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b310ab8a21681270e73f177ddf7974cabb7a96f0624ab8b008fd6ee1f9b4f687" +checksum = "6f03e137db1b29be36abfa1e1e682dd3864b0335c68282c8dab68c2d397b8cbd" dependencies = [ "ethereum-types", "franklin-crypto", @@ -8954,7 +8849,7 @@ dependencies = [ "serde_json", "serde_with", "strum", - "thiserror", + "thiserror 1.0.69", "tracing", "zksync_basic_types", "zksync_contracts", @@ -8974,6 +8869,7 @@ dependencies = [ "once_cell", "reqwest 0.12.9", "serde_json", + "sha2 0.10.8", "tokio", "tracing", "zksync_vlog", @@ -8985,7 +8881,7 @@ version = "0.1.0" dependencies = [ "anyhow", "circuit_definitions", - "clap 4.5.21", + "clap 4.5.23", "indicatif", "proptest", "toml_edit 0.14.4", @@ -9013,7 +8909,7 @@ dependencies = [ "sentry", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "time", "tokio", "tracing", @@ -9031,8 +8927,8 @@ source = "git+https://github.com/matter-labs/vm2.git?rev=457d8a7eea9093af9440662 dependencies = [ "enum_dispatch", "primitive-types", - "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", ] @@ -9053,7 +8949,7 @@ dependencies = [ "hex", "pretty_assertions", "serde", - "thiserror", + "thiserror 1.0.69", "tracing", "zksync_contracts", "zksync_system_constants", @@ -9073,7 +8969,7 @@ dependencies = [ "rustls", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "vise", @@ -9126,7 +9022,7 @@ dependencies = [ "anyhow", "async-trait", "bincode", - "clap 4.5.21", + "clap 4.5.23", "ctrlc", "tokio", "tracing", diff --git a/prover/Cargo.toml b/prover/Cargo.toml index 15e819d77f7d..aea458cb9e48 100644 --- a/prover/Cargo.toml +++ b/prover/Cargo.toml @@ -67,13 +67,14 @@ url = "2.5.2" vise = "0.2.0" # Proving dependencies -circuit_definitions = "=0.150.7" -circuit_sequencer_api = "=0.150.7" -zkevm_test_harness = "=0.150.7" +circuit_definitions = "=0.150.18" +circuit_sequencer_api = "=0.150.18" +zkevm_test_harness = "=0.150.18" # GPU proving dependencies -wrapper_prover = { package = "zksync-wrapper-prover", version = "=0.151.1" } -shivini = "=0.151.1" +wrapper_prover = { package = "zksync-wrapper-prover", version = "=0.152.9" } +shivini = "=0.152.9" +boojum-cuda = "=0.152.9" # Core workspace dependencies zksync_multivm = { path = "../core/lib/multivm", version = "0.1.0" } diff --git a/prover/crates/bin/prover_fri/src/gpu_prover_job_processor.rs b/prover/crates/bin/prover_fri/src/gpu_prover_job_processor.rs index cfd588c26662..9817362c9fea 100644 --- a/prover/crates/bin/prover_fri/src/gpu_prover_job_processor.rs +++ b/prover/crates/bin/prover_fri/src/gpu_prover_job_processor.rs @@ -1,6 +1,6 @@ #[cfg(feature = "gpu")] pub mod gpu_prover { - use std::{collections::HashMap, sync::Arc, time::Instant}; + use std::{alloc::Global, collections::HashMap, sync::Arc, time::Instant}; use anyhow::Context as _; use shivini::{ @@ -174,7 +174,7 @@ pub mod gpu_prover { DefaultTranscript, DefaultTreeHasher, NoPow, - _, + Global, >( &gpu_proof_config, &witness_vector, diff --git a/prover/crates/bin/prover_fri/src/lib.rs b/prover/crates/bin/prover_fri/src/lib.rs index 39757795d980..76a97f119f4b 100644 --- a/prover/crates/bin/prover_fri/src/lib.rs +++ b/prover/crates/bin/prover_fri/src/lib.rs @@ -1,5 +1,5 @@ #![allow(incomplete_features)] // We have to use generic const exprs. -#![feature(generic_const_exprs)] +#![feature(generic_const_exprs, allocator_api)] mod metrics; pub mod prover_job_processor; pub mod utils; diff --git a/prover/crates/bin/prover_fri/src/main.rs b/prover/crates/bin/prover_fri/src/main.rs index cbba8d0ddb4f..d464cb630be2 100644 --- a/prover/crates/bin/prover_fri/src/main.rs +++ b/prover/crates/bin/prover_fri/src/main.rs @@ -1,5 +1,5 @@ #![allow(incomplete_features)] // We have to use generic const exprs. -#![feature(generic_const_exprs)] +#![feature(generic_const_exprs, allocator_api)] use std::{future::Future, sync::Arc, time::Duration}; diff --git a/prover/crates/bin/witness_generator/src/rounds/basic_circuits/mod.rs b/prover/crates/bin/witness_generator/src/rounds/basic_circuits/mod.rs index adb2bf72d04f..233e59877cb8 100644 --- a/prover/crates/bin/witness_generator/src/rounds/basic_circuits/mod.rs +++ b/prover/crates/bin/witness_generator/src/rounds/basic_circuits/mod.rs @@ -4,7 +4,7 @@ use async_trait::async_trait; use circuit_definitions::zkevm_circuits::scheduler::{ block_header::BlockAuxilaryOutputWitness, input::SchedulerCircuitInstanceWitness, }; -use zksync_multivm::circuit_sequencer_api_latest::boojum::{ +use zkevm_test_harness::boojum::{ field::goldilocks::{GoldilocksExt2, GoldilocksField}, gadgets::recursion::recursive_tree_hasher::CircuitGoldilocksPoseidon2Sponge, }; diff --git a/prover/crates/bin/witness_generator/src/rounds/basic_circuits/utils.rs b/prover/crates/bin/witness_generator/src/rounds/basic_circuits/utils.rs index 31dc54814103..348ba1dcd996 100644 --- a/prover/crates/bin/witness_generator/src/rounds/basic_circuits/utils.rs +++ b/prover/crates/bin/witness_generator/src/rounds/basic_circuits/utils.rs @@ -11,11 +11,11 @@ use circuit_definitions::{ }; use tokio::sync::Semaphore; use tracing::Instrument; -use zkevm_test_harness::witness::oracle::WitnessGenerationArtifact; +use zkevm_test_harness::{ + boojum::field::goldilocks::GoldilocksField, witness::oracle::WitnessGenerationArtifact, +}; use zksync_multivm::{ - circuit_sequencer_api_latest::{ - boojum::field::goldilocks::GoldilocksField, geometry_config::get_geometry_config, - }, + circuit_sequencer_api_latest::geometry_config::ProtocolGeometry, interface::storage::StorageView, vm_latest::{constants::MAX_CYCLES_FOR_TX, HistoryDisabled, StorageOracle as VmStorageOracle}, zk_evm_latest::ethereum_types::Address, @@ -52,7 +52,7 @@ pub(super) async fn generate_witness( input.merkle_paths, input.previous_batch_metadata.root_hash.0, ); - let geometry_config = get_geometry_config(); + let geometry_config = ProtocolGeometry::V1_5_0.config(); let mut hasher = DefaultHasher::new(); geometry_config.hash(&mut hasher); tracing::info!( diff --git a/prover/crates/lib/circuit_prover_service/src/lib.rs b/prover/crates/lib/circuit_prover_service/src/lib.rs index 0d7b146cc43b..bbf1f9733f6f 100644 --- a/prover/crates/lib/circuit_prover_service/src/lib.rs +++ b/prover/crates/lib/circuit_prover_service/src/lib.rs @@ -1,5 +1,5 @@ #![allow(incomplete_features)] // Crypto code uses generic const exprs -#![feature(generic_const_exprs)] +#![feature(generic_const_exprs, allocator_api)] mod gpu_circuit_prover; pub mod job_runner; mod metrics; diff --git a/prover/crates/lib/circuit_prover_service/src/types/circuit.rs b/prover/crates/lib/circuit_prover_service/src/types/circuit.rs index 19c05666b2c5..264daba63b7d 100644 --- a/prover/crates/lib/circuit_prover_service/src/types/circuit.rs +++ b/prover/crates/lib/circuit_prover_service/src/types/circuit.rs @@ -1,4 +1,4 @@ -use std::sync::Arc; +use std::{alloc::Global, sync::Arc}; use anyhow::Context; use shivini::{gpu_proof_config::GpuProofConfig, gpu_prove_from_external_witness_data}; @@ -84,7 +84,7 @@ impl Circuit { let span = tracing::info_span!("prove_base_circuit").entered(); let gpu_proof_config = GpuProofConfig::from_base_layer_circuit(circuit); let boojum_proof_config = base_layer_proof_config(); - let proof = gpu_prove_from_external_witness_data::( + let proof = gpu_prove_from_external_witness_data::( &gpu_proof_config, &witness_vector, boojum_proof_config, @@ -113,7 +113,7 @@ impl Circuit { let span = tracing::info_span!("prove_recursive_circuit").entered(); let gpu_proof_config = GpuProofConfig::from_recursive_layer_circuit(circuit); let boojum_proof_config = recursion_layer_proof_config(); - let proof = gpu_prove_from_external_witness_data::( + let proof = gpu_prove_from_external_witness_data::( &gpu_proof_config, &witness_vector, boojum_proof_config, diff --git a/prover/crates/lib/keystore/Cargo.toml b/prover/crates/lib/keystore/Cargo.toml index 4d9addc26bc0..8dac09b782c0 100644 --- a/prover/crates/lib/keystore/Cargo.toml +++ b/prover/crates/lib/keystore/Cargo.toml @@ -17,6 +17,7 @@ zksync_prover_fri_types.workspace = true zkevm_test_harness.workspace = true circuit_definitions = { workspace = true, features = ["log_tracing"] } shivini = { workspace = true, optional = true } +boojum-cuda = { workspace = true, optional = true } anyhow.workspace = true tracing.workspace = true @@ -32,4 +33,4 @@ futures = { workspace = true, features = ["compat"] } [features] default = [] -gpu = ["shivini"] +gpu = ["shivini", "boojum-cuda"] diff --git a/prover/crates/lib/keystore/src/lib.rs b/prover/crates/lib/keystore/src/lib.rs index 7e60e3fa29cd..543b7b18ffe5 100644 --- a/prover/crates/lib/keystore/src/lib.rs +++ b/prover/crates/lib/keystore/src/lib.rs @@ -1,6 +1,8 @@ #![feature(allocator_api)] use serde::{Deserialize, Serialize}; +#[cfg(feature = "gpu")] +use shivini::cs::GpuSetup; use zkevm_test_harness::compute_setups::CircuitSetupData; use zksync_prover_fri_types::circuit_definitions::boojum::{ algebraic_props::{round_function::AbsorptionModeOverwrite, sponge::GenericAlgebraicSponge}, @@ -19,8 +21,6 @@ use zksync_prover_fri_types::circuit_definitions::boojum::{ }, implementations::poseidon2::Poseidon2Goldilocks, }; -#[cfg(feature = "gpu")] -use {shivini::cs::GpuSetup, std::alloc::Global}; pub mod commitment_utils; pub mod keystore; @@ -84,11 +84,12 @@ impl From for GoldilocksProverSetupData { #[cfg(feature = "gpu")] #[derive(Debug, Serialize, Deserialize)] #[serde(bound = "F: serde::Serialize + serde::de::DeserializeOwned")] -pub struct GpuProverSetupData> { - pub setup: GpuSetup, +pub struct GpuProverSetupData> +{ + pub setup: GpuSetup, #[serde(bound( - serialize = "H::Output: serde::Serialize", - deserialize = "H::Output: serde::de::DeserializeOwned" + serialize = ">::Output: serde::Serialize", + deserialize = ">::Output: serde::de::DeserializeOwned" ))] pub vk: VerificationKey, pub finalization_hint: FinalizationHintsForProver, diff --git a/prover/crates/lib/keystore/src/setup_data_generator.rs b/prover/crates/lib/keystore/src/setup_data_generator.rs index c4790d67feaa..0bbd6cb5d14d 100644 --- a/prover/crates/lib/keystore/src/setup_data_generator.rs +++ b/prover/crates/lib/keystore/src/setup_data_generator.rs @@ -5,13 +5,17 @@ use std::collections::HashMap; use anyhow::Context as _; use zkevm_test_harness::{ - compute_setups::{generate_circuit_setup_data, CircuitSetupData}, + compute_setups::{ + generate_circuit_setup_data, light::generate_light_circuit_setup_data, CircuitSetupData, + }, data_source::SetupDataSource, }; use zksync_prover_fri_types::ProverServiceDataKey; #[cfg(feature = "gpu")] use { - crate::GpuProverSetupData, shivini::cs::setup::GpuSetup, shivini::ProverContext, + crate::GpuProverSetupData, + boojum_cuda::poseidon2::GLHasher, + shivini::{cs::gpu_setup_and_vk_from_base_setup_vk_params_and_hints, ProverContext}, zksync_prover_fri_types::circuit_definitions::boojum::worker::Worker, }; @@ -25,7 +29,7 @@ pub fn generate_setup_data_common( ) -> anyhow::Result { let mut data_source = keystore.load_keys_to_data_source()?; let circuit_setup_data = generate_circuit_setup_data( - circuit.is_base_layer(), + circuit.round as u8, // TODO: Actually it's called "ProvingStage" now circuit.circuit_id, &mut data_source, ) @@ -151,20 +155,29 @@ impl SetupDataGenerator for GPUSetupDataGenerator { { let _context = ProverContext::create().context("failed initializing gpu prover context")?; - let circuit_setup_data = generate_setup_data_common(&self.keystore, circuit)?; - let worker = Worker::new(); - let gpu_setup_data = GpuSetup::from_setup_and_hints( - circuit_setup_data.setup_base, - circuit_setup_data.setup_tree, - circuit_setup_data.vars_hint.clone(), - circuit_setup_data.wits_hint, - &worker, + let mut data_source = self.keystore.load_keys_to_data_source()?; + let circuit_setup_data = generate_light_circuit_setup_data( + circuit.round as u8, + circuit.circuit_id, + &mut data_source, ) - .context("failed creating GPU base layer setup data")?; + .unwrap(); + + let worker = Worker::new(); + // TODO: add required assertions + let (gpu_setup_data, vk) = + gpu_setup_and_vk_from_base_setup_vk_params_and_hints::( + circuit_setup_data.setup_base, + circuit_setup_data.vk_geometry, + circuit_setup_data.vars_hint.clone(), + circuit_setup_data.wits_hint, + &worker, + ) + .context("failed creating GPU base layer setup data")?; let gpu_prover_setup_data = GpuProverSetupData { setup: gpu_setup_data, - vk: circuit_setup_data.vk, + vk: vk.clone(), finalization_hint: circuit_setup_data.finalization_hint, }; // Serialization should always succeed. diff --git a/prover/setup-data-gpu-keys.json b/prover/setup-data-gpu-keys.json index 4acc51b9add0..8a3bdeb262c1 100644 --- a/prover/setup-data-gpu-keys.json +++ b/prover/setup-data-gpu-keys.json @@ -1,5 +1,5 @@ { - "us": "gs://matterlabs-setup-data-us/ffc5da2-gpu/", - "europe": "gs://matterlabs-setup-data-europe/ffc5da2-gpu/", - "asia": "gs://matterlabs-setup-data-asia/ffc5da2-gpu/" + "us": "gs://matterlabs-setup-data-us/dc3bba7-gpu/", + "europe": "gs://matterlabs-setup-data-europe/dc3bba7-gpu/", + "asia": "gs://matterlabs-setup-data-asia/dc3bba7-gpu/" } diff --git a/zkstack_cli/Cargo.lock b/zkstack_cli/Cargo.lock index 900ac677fd61..4e9bb4b1c76c 100644 --- a/zkstack_cli/Cargo.lock +++ b/zkstack_cli/Cargo.lock @@ -6771,9 +6771,9 @@ dependencies = [ [[package]] name = "zksync_concurrency" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c24c9a056499823227503dd9e5fb3037d93bcc3ae9b06c1ac0a47334c6283af" +checksum = "e8312ab73d3caa55775bd531795b507fa8f76bd9dabfaeb0954fe43e8fc1323b" dependencies = [ "anyhow", "once_cell", @@ -6804,9 +6804,9 @@ dependencies = [ [[package]] name = "zksync_consensus_crypto" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da303b01f24283e93f80f361bf62c3df4a761d061c8b38b4faebeebf26362fc" +checksum = "86b539960de98df3c3bd27d2d9b97de862027686bbb3bdfc5aaad5b74bb929a1" dependencies = [ "anyhow", "blst", @@ -6825,9 +6825,9 @@ dependencies = [ [[package]] name = "zksync_consensus_roles" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f07db2a8ec2d2cda5cb4c5ac408101e81c8fa5d95c9f3302829dafae78d11c" +checksum = "c49949546895a10431b9daec6ec4208ef0917ace006446d304b51f5b234ba462" dependencies = [ "anyhow", "bit-vec", @@ -6847,9 +6847,9 @@ dependencies = [ [[package]] name = "zksync_consensus_utils" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3222410c67617a86edb192e0c4bb48afc254a17052200a0a839c90e8b0378842" +checksum = "723e2a4b056cc5af192a83163c89a6951ee75c098cc5c4a4cdc435f4232d88bd" dependencies = [ "anyhow", "rand", @@ -6897,9 +6897,9 @@ dependencies = [ [[package]] name = "zksync_protobuf" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05755c38b134b409736008bfdfd0fdb42bfa061947be93be4c78069aa10c9b3" +checksum = "e8986ad796f8e00d8999fee72effba1a21bce40f5f877d681ac9cd89a94834d8" dependencies = [ "anyhow", "bit-vec", @@ -6918,9 +6918,9 @@ dependencies = [ [[package]] name = "zksync_protobuf_build" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c3930a73ca667780be6dcd94e469d40a93fa52f4654c9ab732991b62238cb5" +checksum = "8d870b31995e3acb8e47afeb68ebeeffcf6121e70020e65b3d5d31692115d236" dependencies = [ "anyhow", "heck", @@ -6946,6 +6946,7 @@ dependencies = [ "serde_yaml", "tracing", "zksync_basic_types", + "zksync_concurrency", "zksync_config", "zksync_protobuf", "zksync_protobuf_build", @@ -7000,6 +7001,7 @@ dependencies = [ "once_cell", "reqwest 0.12.9", "serde_json", + "sha2", "tokio", "tracing", "zksync_vlog", diff --git a/zkstack_cli/Cargo.toml b/zkstack_cli/Cargo.toml index 1734673aefba..29a0e5bc43c6 100644 --- a/zkstack_cli/Cargo.toml +++ b/zkstack_cli/Cargo.toml @@ -19,7 +19,6 @@ repository = "https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/" description = "ZK Stack CLI is a set of tools for working with zk stack." keywords = ["zk", "cryptography", "blockchain", "ZKStack", "ZKsync"] - [workspace.dependencies] # Local dependencies common = { path = "crates/common" } @@ -31,11 +30,11 @@ git_version_macro = { path = "crates/git_version_macro" } zksync_config = { path = "../core/lib/config" } zksync_protobuf_config = { path = "../core/lib/protobuf_config" } zksync_basic_types = { path = "../core/lib/basic_types" } -zksync_consensus_roles = "=0.6.0" -zksync_consensus_crypto = "=0.6.0" -zksync_consensus_utils = "=0.6.0" -zksync_protobuf = "=0.6.0" -zksync_protobuf_build = "=0.6.0" +zksync_consensus_roles = "=0.7.0" +zksync_consensus_crypto = "=0.7.0" +zksync_consensus_utils = "=0.7.0" +zksync_protobuf = "=0.7.0" +zksync_protobuf_build = "=0.7.0" # External dependencies anyhow = "1.0.82" diff --git a/zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/input.rs b/zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/input.rs index d5611f805b17..17b2bac38a3f 100644 --- a/zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/input.rs +++ b/zkstack_cli/crates/config/src/forge_interface/deploy_ecosystem/input.rs @@ -11,7 +11,7 @@ use zksync_basic_types::L2ChainId; use crate::{ consts::INITIAL_DEPLOYMENT_FILE, traits::{FileConfigWithDefaultName, ZkStackConfig}, - ContractsConfig, GenesisConfig, WalletsConfig, + ContractsConfig, GenesisConfig, WalletsConfig, ERC20_DEPLOYMENT_FILE, }; #[derive(Debug, Deserialize, Serialize, Clone)] @@ -69,7 +69,7 @@ pub struct Erc20DeploymentConfig { } impl FileConfigWithDefaultName for Erc20DeploymentConfig { - const FILE_NAME: &'static str = INITIAL_DEPLOYMENT_FILE; + const FILE_NAME: &'static str = ERC20_DEPLOYMENT_FILE; } impl ZkStackConfig for Erc20DeploymentConfig {}