From 9ec2b199e54001d030d79473ec2ba5ddd13a9696 Mon Sep 17 00:00:00 2001 From: Thomas Coratger <60488569+tcoratger@users.noreply.github.com> Date: Mon, 16 Sep 2024 14:49:50 +0200 Subject: [PATCH] bump blockifier to sequencer monorepo (#758) * bump blockifier to sequencer monorepo * fmt * fix clippy * add missing versioned constants * add missing versioned constants in other file --- Cargo.lock | 365 ++++++++++-------- Cargo.toml | 14 +- .../src/evm_sequencer/sequencer/mod.rs | 14 +- .../resources/versioned_constants.json | 5 + crates/ef-testing/src/models/result.rs | 2 +- .../src/resources/versioned_constants.json | 5 + crates/sequencer/src/sequencer.rs | 52 +-- crates/sequencer/src/transaction.rs | 40 +- 8 files changed, 285 insertions(+), 212 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6aa9e8ed..7b2345ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1098,8 +1098,8 @@ dependencies = [ [[package]] name = "blockifier" -version = "0.8.0-rc.1" -source = "git+https://github.com/kkrt-labs/blockifier.git?rev=57377d6#57377d6f6772c245b5bd83abb5ad6ece3f32ff79" +version = "0.0.0" +source = "git+https://github.com/kkrt-labs/sequencer.git?rev=d1f32e2#d1f32e241e4a9a404d8b2c292921685f39ee0211" dependencies = [ "anyhow", "ark-ec", @@ -1114,14 +1114,14 @@ dependencies = [ "cairo-vm", "derive_more 0.99.18", "indexmap 2.2.6", - "itertools 0.10.5", + "itertools 0.12.1", "keccak", "log", "num-bigint", "num-integer", "num-rational", "num-traits 0.2.19", - "once_cell", + "papyrus_config", "paste", "phf", "rand 0.8.5", @@ -1132,9 +1132,11 @@ dependencies = [ "sha3", "starknet-types-core", "starknet_api", - "strum 0.24.1", - "strum_macros 0.24.3", + "strum 0.25.0", + "strum_macros 0.25.3", + "tempfile", "thiserror", + "toml", ] [[package]] @@ -1291,9 +1293,9 @@ checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" [[package]] name = "cairo-lang-casm" -version = "2.7.0-rc.3" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5abf875e93f696e783412d3f2a7c6f66e94e07c30b01559380b4d0707dc0050e" +checksum = "60a4b4ca8473c25d1e760c83c2a49d953197556f82f6feb636004d3b6d6cc4a7" dependencies = [ "cairo-lang-utils", "indoc", @@ -1305,9 +1307,9 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2698e2ca73db964e6d496a648fcbb2ace5559941b5179ab3310c9a0b6872b348" +checksum = "5852668d1c6966b34d6e4fe249732769ab9cb2012c201e3889d8119f206760a0" dependencies = [ "anyhow", "cairo-lang-defs", @@ -1322,7 +1324,8 @@ dependencies = [ "cairo-lang-syntax", "cairo-lang-utils", "indoc", - "salsa", + "rayon", + "rust-analyzer-salsa", "semver 1.0.23", "smol_str", "thiserror", @@ -1330,18 +1333,18 @@ dependencies = [ [[package]] name = "cairo-lang-debug" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac7332f2b041ca28b24b0311a0b4a35f426bb52836a2d268a8374ea262e9e6b" +checksum = "b0644fab571f598547993936918c85f0e89b0bbc15140ca3ea723bff376be07d" dependencies = [ "cairo-lang-utils", ] [[package]] name = "cairo-lang-defs" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "079a34b560a82b463cd12ae62022d70981e8ab56b6505f9499348ebeaf460de8" +checksum = "7f5f437d75ac25644880458effde562edcac45a888d27f2e497d30c6450fa97d" dependencies = [ "cairo-lang-debug", "cairo-lang-diagnostics", @@ -1350,15 +1353,15 @@ dependencies = [ "cairo-lang-syntax", "cairo-lang-utils", "itertools 0.12.1", - "salsa", + "rust-analyzer-salsa", "smol_str", ] [[package]] name = "cairo-lang-diagnostics" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c29625349297ad791942377763f5b04c779ea694f436488dc6ad194720b89487" +checksum = "6ec5b44d3eaf50e28e068d163e56b9effcea6afe3625c32dd96418d2d4ebc34c" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -1368,9 +1371,9 @@ dependencies = [ [[package]] name = "cairo-lang-eq-solver" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cb26cd75126db6eaf94d5dffe0ce750d030ac879a88de5a621551969e9b59e3" +checksum = "a0cd844e568f51e39729e8ac18bd27ada2e2b6dc9138f8c81adad48456480681" dependencies = [ "cairo-lang-utils", "good_lp", @@ -1378,14 +1381,14 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "651012f2956bea884c7a3ab9df21dc76112d7edd3f403b37ca5be62fc3f41b09" +checksum = "323a2385e000589f7591f8a46599b4a462db6e36e5935bad3bceddcc1a1608e1" dependencies = [ "cairo-lang-debug", "cairo-lang-utils", "path-clean", - "salsa", + "rust-analyzer-salsa", "semver 1.0.23", "serde", "smol_str", @@ -1393,9 +1396,9 @@ dependencies = [ [[package]] name = "cairo-lang-formatter" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d09ffb9498368cf4e95d0b28662596331aef1677e4f759ab5e609d27dfcb587" +checksum = "1cf9cf637e12d41260dc59f3d988c76a6347424913ac8b6b8449ff3e79b59750" dependencies = [ "anyhow", "cairo-lang-diagnostics", @@ -1406,7 +1409,7 @@ dependencies = [ "diffy", "ignore", "itertools 0.12.1", - "salsa", + "rust-analyzer-salsa", "serde", "smol_str", "thiserror", @@ -1414,9 +1417,9 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da4ffe6c197c35dec665029fcf695422f02c55b5118b4da1142e182b9fe77f87" +checksum = "5d71bc5b1f19a00eb662c2cac33259b16b9cdbf9c005047aca0d538c13936407" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -1432,16 +1435,15 @@ dependencies = [ "log", "num-bigint", "num-traits 0.2.19", - "once_cell", - "salsa", + "rust-analyzer-salsa", "smol_str", ] [[package]] name = "cairo-lang-parser" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f262ad5f1110ff70c93deb81cce024cf160f4a4518762e7deb2047fe73846789" +checksum = "5d939d258e26ace0f3cb1e50338ae18981a7505e3c20eabd24a62d70ee862d6c" dependencies = [ "cairo-lang-diagnostics", "cairo-lang-filesystem", @@ -1452,16 +1454,16 @@ dependencies = [ "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", - "salsa", + "rust-analyzer-salsa", "smol_str", "unescaper", ] [[package]] name = "cairo-lang-plugins" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18024b44b5edbc1f378ba85c1a4ff04e880ea465a33251053aec507f08250668" +checksum = "b67a553a6d2d2b54264e77e3c8cb5bc866b40b32d5e2144a58b74c559c7e289f" dependencies = [ "cairo-lang-defs", "cairo-lang-diagnostics", @@ -1472,15 +1474,15 @@ dependencies = [ "indent", "indoc", "itertools 0.12.1", - "salsa", + "rust-analyzer-salsa", "smol_str", ] [[package]] name = "cairo-lang-proc-macros" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "124402d8fad2a033bb36910dd7d0651f3100845c63dce679c58797a8cb0448c2" +checksum = "c33b5f4502b7efde6ac07fd5468f6dae15d88760aeece3d57a7bc4c224ba693e" dependencies = [ "cairo-lang-debug", "quote", @@ -1489,9 +1491,9 @@ dependencies = [ [[package]] name = "cairo-lang-project" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f37dba9653eabf4dcb43a5e1436cd6bc093b5ad6f28ff42eaaef12549014213" +checksum = "b63d6a3cc86a79a29978acaaf6f94738c5487e265247fe06c7bf359645d8c200" dependencies = [ "cairo-lang-filesystem", "cairo-lang-utils", @@ -1503,9 +1505,9 @@ dependencies = [ [[package]] name = "cairo-lang-runner" -version = "2.7.0-rc.3" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ab7b0e0640adaed21b9d9b9b94b3edf7f7ab95514b1dd40c679317a33dabea" +checksum = "528a247ac59cb35b2f99d64605a81de815fa5fb0b0e7f7ece1d4e7fcf267d4ea" dependencies = [ "ark-ff 0.4.2", "ark-secp256k1", @@ -1534,9 +1536,9 @@ dependencies = [ [[package]] name = "cairo-lang-semantic" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1612476b548e9ab8ae89ee38a73d9875339f62f2f59d9ce8a719bc1761c54c3" +checksum = "00c284031fd14796dad91483c3039d7929f8440e1e9e334017744b1d22df5aa8" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -1553,17 +1555,16 @@ dependencies = [ "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", - "once_cell", - "salsa", + "rust-analyzer-salsa", "smol_str", "toml", ] [[package]] name = "cairo-lang-sierra" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8209be8cf22263bf8a55df334a642b74fe563beecbbbefa55cda39fa4b131a61" +checksum = "891488c1a3184ce91679f5bdb63015a1d24769a48bd07e5d51a1779d0031dfbe" dependencies = [ "anyhow", "cairo-lang-utils", @@ -1576,9 +1577,8 @@ dependencies = [ "num-bigint", "num-integer", "num-traits 0.2.19", - "once_cell", "regex", - "salsa", + "rust-analyzer-salsa", "serde", "serde_json", "sha3", @@ -1589,9 +1589,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c9d1350366c23e4a9f6e18ea95939f18df52df455f06c0e3d7889f80ce18a94" +checksum = "ea7752cd48c86b2cde8603b753a6df4da086dacd16a73d288854d5f040b51171" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -1605,9 +1605,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fe1ff15052b173537360b7dca5f9b2ccb10392b2a1c11af99add35d42632115" +checksum = "340892a09c9421414b2ac45b03c705f16e2bd737e4559dfd98ee1d20718dec9e" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -1621,9 +1621,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-generator" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3802e7b6722fabc9cc0a61c86e7ad53138f6f41880aca80a60f889739fbf55" +checksum = "c5cc616e8df44c4d685fe3c5f81f35ebbda57225098b35cea8602457c45c9e96" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -1637,8 +1637,7 @@ dependencies = [ "cairo-lang-utils", "itertools 0.12.1", "num-traits 0.2.19", - "once_cell", - "salsa", + "rust-analyzer-salsa", "serde", "serde_json", "smol_str", @@ -1646,9 +1645,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" -version = "2.7.0-rc.3" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8607cc5cf16f3a930ad4b3799e986b0ca36ada2c0da1dd6bd2ef35cbb1eb9e74" +checksum = "1c22ff7e8113a46a907f82f191096c96935cc48247e3079971ddf536ccc2f4f8" dependencies = [ "assert_matches", "cairo-lang-casm", @@ -1667,9 +1666,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-type-size" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ddddaacc814e0ffda9f176c913fb2a9cd74fe6594dea789e8281eef10cac201" +checksum = "5bf41941776e7410a8853a8e2a116292fc24d219df1989a92ffe5ab0e98037eb" dependencies = [ "cairo-lang-sierra", "cairo-lang-utils", @@ -1677,9 +1676,9 @@ dependencies = [ [[package]] name = "cairo-lang-starknet" -version = "2.7.0-rc.3" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a54ebea4ea990a33a2158ecdf46ffb3cb1af8fff6a79c3dd310c6a9ed43e82" +checksum = "b5508fa5ee8d24adf7d2c65505d0ac35efc892eac16d1449c6f7e314a0288cb8" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -1698,7 +1697,6 @@ dependencies = [ "indent", "indoc", "itertools 0.12.1", - "once_cell", "serde", "serde_json", "smol_str", @@ -1708,9 +1706,9 @@ dependencies = [ [[package]] name = "cairo-lang-starknet-classes" -version = "2.7.0-rc.3" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb66ae799e1963318e1bab782848f53797787c396dfd590be539f3f12d56ac4" +checksum = "482b8f9d7f8cc7140f1260ee71f3308a66d15bd228a06281067ca3f8f4410db2" dependencies = [ "cairo-lang-casm", "cairo-lang-sierra", @@ -1721,7 +1719,6 @@ dependencies = [ "num-bigint", "num-integer", "num-traits 0.2.19", - "once_cell", "serde", "serde_json", "sha3", @@ -1732,25 +1729,25 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a376f88d815b63505be54a6afa93d75b67cfd65835922ec648cfcbb0a5e4b4" +checksum = "7db0776c3d06cea65d7afe7a3c7685f6867eb6d951cf505caf35abfd1746773b" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", "cairo-lang-utils", "num-bigint", "num-traits 0.2.19", - "salsa", + "rust-analyzer-salsa", "smol_str", "unescaper", ] [[package]] name = "cairo-lang-syntax-codegen" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01f276bc28f6302fc63032046a12b60d18498906e65f646acb963244eed97f7c" +checksum = "8ce0f7fa01c26cc731bc1d6350ac02fae91a68b5fdf60e684f991e861715adc4" dependencies = [ "genco", "xshell", @@ -1758,9 +1755,9 @@ dependencies = [ [[package]] name = "cairo-lang-test-utils" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e90b6236439e19077ec913351a17a33c7be199dcafdacd8389c4c5199400d6" +checksum = "630a070a69c387eee9c0eda65e4f2508d129d4fbe081091077e661020ab95637" dependencies = [ "cairo-lang-formatter", "cairo-lang-utils", @@ -1771,9 +1768,9 @@ dependencies = [ [[package]] name = "cairo-lang-utils" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55a394e545f1500bea093d01be40895d3234faaa24d9585d08a509c514cabd88" +checksum = "73104609a7d865e4cd1de9cbf4e750683d076b6d0233bf81be511df274a26916" dependencies = [ "hashbrown 0.14.5", "indexmap 2.2.6", @@ -1787,9 +1784,9 @@ dependencies = [ [[package]] name = "cairo-vm" -version = "1.0.0-rc5" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e09134ea1e0be6c1fbd330f0945df0512fa70944fd0b3ecc2f74a6008f01e9da" +checksum = "58363ad8065ed891e3b14a8191b707677c7c7cb5b9d10030822506786d8d8108" dependencies = [ "anyhow", "arbitrary", @@ -3316,15 +3313,6 @@ dependencies = [ "hashbrown 0.14.5", ] -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.4.1" @@ -3640,6 +3628,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "idna" version = "0.4.0" @@ -3660,6 +3659,12 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "if_chain" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" + [[package]] name = "ignore" version = "0.4.22" @@ -4389,6 +4394,12 @@ dependencies = [ "regex-automata 0.1.10", ] +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + [[package]] name = "matrixmultiply" version = "0.2.4" @@ -4916,6 +4927,20 @@ dependencies = [ "winapi", ] +[[package]] +name = "papyrus_config" +version = "0.0.0" +source = "git+https://github.com/kkrt-labs/sequencer.git?rev=d1f32e2#d1f32e241e4a9a404d8b2c292921685f39ee0211" +dependencies = [ + "clap", + "itertools 0.12.1", + "serde", + "serde_json", + "strum_macros 0.25.3", + "thiserror", + "validator", +] + [[package]] name = "parity-scale-codec" version = "3.6.12" @@ -7296,6 +7321,35 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" +[[package]] +name = "rust-analyzer-salsa" +version = "0.17.0-pre.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719825638c59fd26a55412a24561c7c5bcf54364c88b9a7a04ba08a6eafaba8d" +dependencies = [ + "indexmap 2.2.6", + "lock_api", + "oorandom", + "parking_lot 0.12.3", + "rust-analyzer-salsa-macros", + "rustc-hash 1.1.0", + "smallvec", + "tracing", + "triomphe", +] + +[[package]] +name = "rust-analyzer-salsa-macros" +version = "0.17.0-pre.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d96498e9684848c6676c399032ebc37c52da95ecbefa83d71ccc53b9f8a4a8e" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.71", +] + [[package]] name = "rust_decimal" version = "1.35.0" @@ -7498,35 +7552,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "salsa" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b84d9f96071f3f3be0dc818eae3327625d8ebc95b58da37d6850724f31d3403" -dependencies = [ - "crossbeam-utils", - "indexmap 1.9.3", - "lock_api", - "log", - "oorandom", - "parking_lot 0.11.2", - "rustc-hash 1.1.0", - "salsa-macros", - "smallvec", -] - -[[package]] -name = "salsa-macros" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3904a4ba0a9d0211816177fd34b04c7095443f8cdacd11175064fe541c8fe2" -dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "salsa20" version = "0.10.2" @@ -8103,6 +8128,12 @@ dependencies = [ "num-traits 0.1.43", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "starknet" version = "0.11.0" @@ -8167,26 +8198,6 @@ dependencies = [ "starknet-types-core", ] -[[package]] -name = "starknet-crypto" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3f2175b0b3fc24ff2ec6dc07f5a720498994effca7e78b11a6e1c1bd02cad52" -dependencies = [ - "crypto-bigint", - "hex", - "hmac 0.12.1", - "num-bigint", - "num-integer", - "num-traits 0.2.19", - "rfc6979", - "sha2 0.10.8", - "starknet-crypto-codegen 0.3.3", - "starknet-curve 0.3.0", - "starknet-ff", - "zeroize", -] - [[package]] name = "starknet-crypto" version = "0.6.2" @@ -8249,15 +8260,6 @@ dependencies = [ "syn 2.0.71", ] -[[package]] -name = "starknet-curve" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "252610baff59e4c4332ce3569f7469c5d3f9b415a2240d698fb238b2b4fc0942" -dependencies = [ - "starknet-ff", -] - [[package]] name = "starknet-curve" version = "0.4.2" @@ -8354,9 +8356,8 @@ dependencies = [ [[package]] name = "starknet_api" -version = "0.13.0-rc.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a80f50db7439ceb65de759fcbadb1695c82aec82126b2313413632e40d4eec" +version = "0.0.0" +source = "git+https://github.com/kkrt-labs/sequencer.git?rev=d1f32e2#d1f32e241e4a9a404d8b2c292921685f39ee0211" dependencies = [ "bitvec", "cairo-lang-starknet-classes", @@ -8364,15 +8365,14 @@ dependencies = [ "hex", "indexmap 2.2.6", "itertools 0.12.1", - "once_cell", "primitive-types", "serde", "serde_json", "sha3", - "starknet-crypto 0.5.2", + "starknet-crypto 0.7.1", "starknet-types-core", - "strum 0.24.1", - "strum_macros 0.24.3", + "strum 0.25.0", + "strum_macros 0.25.3", "thiserror", ] @@ -8409,9 +8409,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" [[package]] name = "strum" @@ -8424,15 +8424,15 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ "heck 0.4.1", "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn 2.0.71", ] [[package]] @@ -8993,6 +8993,16 @@ dependencies = [ "rlp", ] +[[package]] +name = "triomphe" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" +dependencies = [ + "serde", + "stable_deref_trait", +] + [[package]] name = "trust-dns-proto" version = "0.23.2" @@ -9172,6 +9182,45 @@ dependencies = [ "serde", ] +[[package]] +name = "validator" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d6937c33ec6039d8071bcf72933146b5bbe378d645d8fa59bdadabfc2a249" +dependencies = [ + "idna 0.2.3", + "lazy_static", + "regex", + "serde", + "serde_derive", + "serde_json", + "url", + "validator_derive", + "validator_types", +] + +[[package]] +name = "validator_derive" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4286b4497f270f59276a89ae0ad109d5f8f18c69b613e3fb22b61201aadb0c4d" +dependencies = [ + "if_chain", + "lazy_static", + "proc-macro-error", + "proc-macro2", + "quote", + "regex", + "syn 1.0.109", + "validator_types", +] + +[[package]] +name = "validator_types" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad9680608df133af2c1ddd5eaf1ddce91d60d61b6bc51494ef326458365a470a" + [[package]] name = "valuable" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 20b9e539..a04bca56 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,17 +37,17 @@ revm-interpreter = { version = "10.0.0", default-features = false } revm-primitives = { version = "9.0.0", default-features = false } # Starknet deps -cairo-lang-casm = "2.7.0-rc.3" -cairo-lang-starknet = "2.7.0-rc.3" -cairo-lang-utils = "2.7.0-rc.3" -cairo-lang-starknet-classes = "2.7.0-rc.3" -cairo-vm = "1.0.0-rc5" -blockifier = { package = "blockifier", git = "https://github.com/kkrt-labs/blockifier.git", rev = "57377d6", default-features = false, features = [ +cairo-lang-casm = "2.8.0" +cairo-lang-starknet = "2.8.0" +cairo-lang-utils = "2.8.0" +cairo-lang-starknet-classes = "2.8.0" +cairo-vm = "1.0.1" +blockifier = { package = "blockifier", git = "https://github.com/kkrt-labs/sequencer.git", rev = "d1f32e2", default-features = false, features = [ "testing", ] } starknet = "0.11.0" starknet-crypto = "0.7.1" -starknet_api = "0.13.0-rc.0" +starknet_api = { package = "starknet_api", git = "https://github.com/kkrt-labs/sequencer.git", rev = "d1f32e2" } # Other async-trait = "0.1" diff --git a/crates/ef-testing/src/evm_sequencer/sequencer/mod.rs b/crates/ef-testing/src/evm_sequencer/sequencer/mod.rs index 4f62cd5a..d1a88874 100644 --- a/crates/ef-testing/src/evm_sequencer/sequencer/mod.rs +++ b/crates/ef-testing/src/evm_sequencer/sequencer/mod.rs @@ -110,12 +110,14 @@ impl KakarotSequencer { ) .try_into() .expect("Failed to convert to ContractAddress"), - gas_prices: GasPrices { - eth_l1_gas_price: NonZeroU128::new(1).unwrap(), - strk_l1_gas_price: NonZeroU128::new(1).unwrap(), - eth_l1_data_gas_price: NonZeroU128::new(1).unwrap(), - strk_l1_data_gas_price: NonZeroU128::new(1).unwrap(), - }, + gas_prices: GasPrices::new( + NonZeroU128::new(1).unwrap(), + NonZeroU128::new(1).unwrap(), + NonZeroU128::new(1).unwrap(), + NonZeroU128::new(1).unwrap(), + NonZeroU128::new(1).unwrap(), + NonZeroU128::new(1).unwrap(), + ), use_kzg_da: false, }; diff --git a/crates/ef-testing/src/evm_sequencer/sequencer/resources/versioned_constants.json b/crates/ef-testing/src/evm_sequencer/sequencer/resources/versioned_constants.json index c9efcddc..33579709 100644 --- a/crates/ef-testing/src/evm_sequencer/sequencer/resources/versioned_constants.json +++ b/crates/ef-testing/src/evm_sequencer/sequencer/resources/versioned_constants.json @@ -86,7 +86,12 @@ "memory_hole_gas_cost": 10, "nop_entry_point_offset": -1, "range_check_gas_cost": 70, + "pedersen_gas_cost": 0, "bitwise_builtin_gas_cost": 594, + "ecop_gas_cost": 0, + "poseidon_gas_cost": 0, + "add_mod_gas_cost": 0, + "mul_mod_gas_cost": 0, "replace_class_gas_cost": { "step_gas_cost": 50, "syscall_base_gas_cost": 1 diff --git a/crates/ef-testing/src/models/result.rs b/crates/ef-testing/src/models/result.rs index c4afddbe..d97f3185 100644 --- a/crates/ef-testing/src/models/result.rs +++ b/crates/ef-testing/src/models/result.rs @@ -93,7 +93,7 @@ pub(crate) fn extract_output_and_log_execution_result( return None; } - info!("{} passed: {:?}", case, info.transaction_receipt.resources); + info!("{} passed: {:?}", case, info.receipt.resources); if let Some(call) = info.execute_call_info.as_ref() { use starknet::core::types::Felt; let events = kakarot_execution_events(call); diff --git a/crates/sequencer/src/resources/versioned_constants.json b/crates/sequencer/src/resources/versioned_constants.json index c9efcddc..33579709 100644 --- a/crates/sequencer/src/resources/versioned_constants.json +++ b/crates/sequencer/src/resources/versioned_constants.json @@ -86,7 +86,12 @@ "memory_hole_gas_cost": 10, "nop_entry_point_offset": -1, "range_check_gas_cost": 70, + "pedersen_gas_cost": 0, "bitwise_builtin_gas_cost": 594, + "ecop_gas_cost": 0, + "poseidon_gas_cost": 0, + "add_mod_gas_cost": 0, + "mul_mod_gas_cost": 0, "replace_class_gas_cost": { "step_gas_cost": 50, "syscall_base_gas_cost": 1 diff --git a/crates/sequencer/src/sequencer.rs b/crates/sequencer/src/sequencer.rs index 3369d26f..b56131fb 100644 --- a/crates/sequencer/src/sequencer.rs +++ b/crates/sequencer/src/sequencer.rs @@ -81,7 +81,7 @@ where } blockifier::transaction::account_transaction::AccountTransaction::DeployAccount( tx, - ) => tx.contract_address, + ) => tx.contract_address(), }, Transaction::L1HandlerTransaction(_) => ContractAddress::from(0u8), }; @@ -130,9 +130,9 @@ mod tests { use starknet::core::types::Felt; use starknet::macros::selector; use starknet_api::core::{ChainId, ClassHash, ContractAddress, Nonce}; + use starknet_api::executable_transaction::InvokeTransaction; use starknet_api::transaction::{ - Calldata, Fee, InvokeTransaction, InvokeTransactionV1, TransactionHash, - TransactionSignature, + Calldata, Fee, InvokeTransactionV1, TransactionHash, TransactionSignature, }; use crate::constants::test_constants::{ @@ -255,12 +255,14 @@ mod tests { block_number: *ONE_BLOCK_NUMBER, block_timestamp: *ONE_BLOCK_TIMESTAMP, sequencer_address: *SEQUENCER_ADDRESS, - gas_prices: GasPrices { - eth_l1_gas_price: NonZeroU128::new(1).unwrap(), - strk_l1_gas_price: NonZeroU128::new(1).unwrap(), - eth_l1_data_gas_price: NonZeroU128::new(1).unwrap(), - strk_l1_data_gas_price: NonZeroU128::new(1).unwrap(), - }, + gas_prices: GasPrices::new( + NonZeroU128::new(1).unwrap(), + NonZeroU128::new(1).unwrap(), + NonZeroU128::new(1).unwrap(), + NonZeroU128::new(1).unwrap(), + NonZeroU128::new(1).unwrap(), + NonZeroU128::new(1).unwrap(), + ), use_kzg_da: false, }; @@ -283,22 +285,24 @@ mod tests { fn test_transaction() -> Transaction { Transaction::AccountTransaction(AccountTransaction::Invoke(BlockifierInvokeTransaction { - tx: InvokeTransaction::V1(InvokeTransactionV1 { - sender_address: *TEST_ACCOUNT, - calldata: Calldata( - vec![ - *TEST_CONTRACT.0.key(), // destination - selector!("inc"), - *ZERO_FELT, // no data - ] - .into(), - ), - max_fee: Fee(1_000_000), - signature: TransactionSignature(vec![]), - nonce: Nonce(*ZERO_FELT), - }), + tx: InvokeTransaction { + tx: starknet_api::transaction::InvokeTransaction::V1(InvokeTransactionV1 { + sender_address: *TEST_ACCOUNT, + calldata: Calldata( + vec![ + *TEST_CONTRACT.0.key(), // destination + selector!("inc"), + *ZERO_FELT, // no data + ] + .into(), + ), + max_fee: Fee(1_000_000), + signature: TransactionSignature(vec![]), + nonce: Nonce(*ZERO_FELT), + }), + tx_hash: TransactionHash(*ZERO_FELT), + }, only_query: false, - tx_hash: TransactionHash(*ZERO_FELT), })) } diff --git a/crates/sequencer/src/transaction.rs b/crates/sequencer/src/transaction.rs index 4d8f1782..907802b3 100644 --- a/crates/sequencer/src/transaction.rs +++ b/crates/sequencer/src/transaction.rs @@ -8,7 +8,7 @@ use blockifier::transaction::{ use starknet::core::crypto::compute_hash_on_elements; use starknet::core::types::{BroadcastedInvokeTransaction, BroadcastedTransaction, Felt}; use starknet_api::core::Nonce; -use starknet_api::transaction::InvokeTransaction; +use starknet_api::executable_transaction::InvokeTransaction; use starknet_api::transaction::{ Calldata, Fee, InvokeTransactionV1, TransactionHash, TransactionSignature, }; @@ -36,23 +36,31 @@ impl BroadcastedTransactionWrapper { BroadcastedInvokeTransaction::V1(invoke_v1) => { Ok(ExecutionTransaction::AccountTransaction( AccountTransaction::Invoke(BlockifierInvokeTransaction { - tx: InvokeTransaction::V1(InvokeTransactionV1 { - max_fee: Fee(invoke_v1.max_fee.to_biguint().try_into()?), - signature: TransactionSignature( - invoke_v1.signature.into_iter().map(Into::into).collect(), + tx: InvokeTransaction { + tx: starknet_api::transaction::InvokeTransaction::V1( + InvokeTransactionV1 { + max_fee: Fee(invoke_v1.max_fee.to_biguint().try_into()?), + signature: TransactionSignature( + invoke_v1 + .signature + .into_iter() + .map(Into::into) + .collect(), + ), + nonce: Nonce(invoke_v1.nonce), + sender_address: invoke_v1.sender_address.try_into()?, + calldata: Calldata(Arc::new(invoke_v1.calldata.to_vec())), + }, ), - nonce: Nonce(invoke_v1.nonce), - sender_address: invoke_v1.sender_address.try_into()?, - calldata: Calldata(Arc::new(invoke_v1.calldata.to_vec())), - }), + tx_hash: TransactionHash(compute_transaction_hash( + invoke_v1.sender_address, + &invoke_v1.calldata, + invoke_v1.max_fee, + chain_id, + invoke_v1.nonce, + )), + }, only_query: false, - tx_hash: TransactionHash(compute_transaction_hash( - invoke_v1.sender_address, - &invoke_v1.calldata, - invoke_v1.max_fee, - chain_id, - invoke_v1.nonce, - )), }), )) }