From c99f2c0bedbcc9c47c0fc0eba331b402672d18d6 Mon Sep 17 00:00:00 2001 From: Pedro Fontana Date: Mon, 3 Jun 2024 17:44:34 -0300 Subject: [PATCH 1/6] copy starknet_in_rust::rpc_state_reader implementation --- Cargo.lock | 5474 +++++++++++++++++++- Cargo.toml | 4 + rpc-state-reader/Cargo.toml | 27 + rpc-state-reader/src/lib.rs | 256 +- rpc-state-reader/src/rpc_state.rs | 634 +++ rpc-state-reader/src/rpc_state_errors.rs | 27 + rpc-state-reader/src/sir_state_reader.rs | 299 ++ rpc-state-reader/src/utils.rs | 121 + rpc-state-reader/tests/blockifier_tests.rs | 628 +++ rpc-state-reader/tests/sir_tests.rs | 403 ++ 10 files changed, 7869 insertions(+), 4 deletions(-) create mode 100644 rpc-state-reader/src/rpc_state.rs create mode 100644 rpc-state-reader/src/rpc_state_errors.rs create mode 100644 rpc-state-reader/src/sir_state_reader.rs create mode 100644 rpc-state-reader/src/utils.rs create mode 100644 rpc-state-reader/tests/blockifier_tests.rs create mode 100644 rpc-state-reader/tests/sir_tests.rs diff --git a/Cargo.lock b/Cargo.lock index e9da76b..e600838 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,9 +3,5479 @@ version = 3 [[package]] -name = "replay" +name = "addr2line" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" + +[[package]] +name = "anstyle-parse" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits 0.2.19", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest", + "itertools 0.10.5", + "num-bigint", + "num-traits 0.2.19", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits 0.2.19", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-secp256k1" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c02e954eaeb4ddb29613fee20840c2bbc85ca4396d53e33837e11905363c5f2" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-secp256r1" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3975a01b0a6e3eae0f72ec7ca8598a6620fc72fa5981f6f5cca33b7cd788f633" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits 0.2.19", + "rand", +] + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "ascii-canvas" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +dependencies = [ + "term", +] + +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + +[[package]] +name = "async-trait" +version = "0.1.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "auto_impl" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "backtrace" +version = "0.3.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bigdecimal" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "serde", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bincode" +version = "2.0.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f11ea1a0346b94ef188834a65c068a03aec181c94896d481d7a0a40d85b0ce95" +dependencies = [ + "serde", +] + +[[package]] +name = "bindgen" +version = "0.66.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.66", + "which", +] + +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools 0.12.1", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.66", + "which", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blockifier" +version = "0.5.0-dev.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b5acc7622f7b7af1e1df0c4065211d4665f29bbd0e658b8d21975f4a0ab6b8e" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-secp256k1", + "ark-secp256r1", + "cached", + "cairo-felt", + "cairo-lang-casm", + "cairo-lang-runner", + "cairo-lang-starknet", + "cairo-lang-utils", + "cairo-vm 0.9.2", + "ctor", + "derive_more", + "indexmap 2.2.6", + "itertools 0.10.5", + "keccak", + "log", + "memoize", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "phf", + "serde", + "serde_json", + "sha3", + "starknet-crypto 0.5.2", + "starknet_api", + "strum", + "strum_macros", + "thiserror", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "cached" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b195e4fbc4b6862bbd065b991a34750399c119797efff72492f28a5864de8700" +dependencies = [ + "async-trait", + "cached_proc_macro", + "cached_proc_macro_types", + "futures", + "hashbrown 0.13.2", + "instant", + "once_cell", + "thiserror", + "tokio", +] + +[[package]] +name = "cached_proc_macro" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b48814962d2fd604c50d2b9433c2a41a0ab567779ee2c02f7fba6eca1221f082" +dependencies = [ + "cached_proc_macro_types", + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cached_proc_macro_types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" + +[[package]] +name = "cairo-felt" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae932292b9ba497a4e892b56aa4e0c6f329a455180fdbdc132700dfe68d9b153" +dependencies = [ + "lazy_static", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "serde", +] + +[[package]] +name = "cairo-lang-casm" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ceb71a4cbf5b474bd671c79b2c05e8168a97199bfea1c01ef63b1bdaac3db03" +dependencies = [ + "cairo-lang-utils", + "indoc", + "num-bigint", + "num-traits 0.2.19", + "parity-scale-codec", + "serde", +] + +[[package]] +name = "cairo-lang-compiler" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95c1aab3213462c5b7c21508f1a4330bdf0766c90e6dd4ed79b0002c2b96a715" +dependencies = [ + "anyhow", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-lowering", + "cairo-lang-parser", + "cairo-lang-project", + "cairo-lang-semantic", + "cairo-lang-sierra", + "cairo-lang-sierra-generator", + "cairo-lang-syntax", + "cairo-lang-utils", + "salsa", + "thiserror", +] + +[[package]] +name = "cairo-lang-debug" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03623ba892200c6b3c55fab260d4aa0bff833d6bcecdb1fb022565ac00d5a683" +dependencies = [ + "cairo-lang-utils", +] + +[[package]] +name = "cairo-lang-defs" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09131755b08a485322656e061ad05602215a198dd4a2daf3897e64dc76e7544e" +dependencies = [ + "cairo-lang-debug", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-parser", + "cairo-lang-syntax", + "cairo-lang-utils", + "itertools 0.11.0", + "salsa", + "smol_str", +] + +[[package]] +name = "cairo-lang-diagnostics" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b8185cc9472c648ac9db970ce558595c71259eebd55d25a502fe569cb871448" +dependencies = [ + "cairo-lang-debug", + "cairo-lang-filesystem", + "cairo-lang-utils", + "itertools 0.11.0", +] + +[[package]] +name = "cairo-lang-eq-solver" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae71750096b64d4dd54dd2c39ef50651bb4aff4bc829e3d07549a5035620e0a" +dependencies = [ + "cairo-lang-utils", + "good_lp", +] + +[[package]] +name = "cairo-lang-filesystem" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1819ef5a5396df695dcec993500c46bc44c309590b503da26965c873dfe8a84a" +dependencies = [ + "cairo-lang-debug", + "cairo-lang-utils", + "path-clean", + "salsa", + "serde", + "smol_str", +] + +[[package]] +name = "cairo-lang-lowering" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0968f0da6117dca1a70d6ac7d2e252d8b1710f333458c54ce08dbef1c0323881" +dependencies = [ + "cairo-lang-debug", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-parser", + "cairo-lang-proc-macros", + "cairo-lang-semantic", + "cairo-lang-syntax", + "cairo-lang-utils", + "id-arena", + "itertools 0.11.0", + "log", + "num-bigint", + "num-traits 0.2.19", + "once_cell", + "salsa", + "smol_str", +] + +[[package]] +name = "cairo-lang-parser" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae556e49c0a90d30e52f068b0fb5ed4d419766661d3713a1644f3894a9255a5a" +dependencies = [ + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-syntax", + "cairo-lang-syntax-codegen", + "cairo-lang-utils", + "colored", + "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", + "salsa", + "smol_str", + "unescaper", +] + +[[package]] +name = "cairo-lang-plugins" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d319f3e84ff679159f97e3baa1d918d369ba9e3ade5ad490e0a9e4eca19591" +dependencies = [ + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-parser", + "cairo-lang-syntax", + "cairo-lang-utils", + "indent", + "indoc", + "itertools 0.11.0", + "salsa", + "smol_str", +] + +[[package]] +name = "cairo-lang-proc-macros" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fef002aac874d76492eb9577dab663f9a84fe4584b4215c7ebfda7d025fcadae" +dependencies = [ + "cairo-lang-debug", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "cairo-lang-project" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f384c26e6907de9c94b44051e386498159e8c9e1567b9b1eae9c22e16ff17e5" +dependencies = [ + "cairo-lang-filesystem", + "cairo-lang-utils", + "serde", + "smol_str", + "thiserror", + "toml", +] + +[[package]] +name = "cairo-lang-runner" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ccd9dce6f931508a21ac4d29965dadcaf7c22bbf2a237239763128b8647a53" +dependencies = [ + "ark-ff", + "ark-secp256k1", + "ark-secp256r1", + "ark-std", + "cairo-felt", + "cairo-lang-casm", + "cairo-lang-sierra", + "cairo-lang-sierra-ap-change", + "cairo-lang-sierra-generator", + "cairo-lang-sierra-to-casm", + "cairo-lang-sierra-type-size", + "cairo-lang-starknet", + "cairo-lang-utils", + "cairo-vm 0.9.2", + "itertools 0.11.0", + "keccak", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "smol_str", + "starknet-crypto 0.6.2", + "thiserror", +] + +[[package]] +name = "cairo-lang-semantic" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "311434caae9542b7c442ac69a04e3c8eaa477654f215abe0bd7dfd3c0de70669" +dependencies = [ + "cairo-lang-debug", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-parser", + "cairo-lang-plugins", + "cairo-lang-proc-macros", + "cairo-lang-syntax", + "cairo-lang-utils", + "id-arena", + "indoc", + "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", + "once_cell", + "salsa", + "smol_str", +] + +[[package]] +name = "cairo-lang-sierra" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52c00c34fcaf97bbc4111d1631af8c65838841a38b3502b5bbc04355b7d46982" +dependencies = [ + "anyhow", + "cairo-felt", + "cairo-lang-utils", + "const-fnv1a-hash", + "convert_case 0.6.0", + "derivative", + "itertools 0.11.0", + "lalrpop", + "lalrpop-util", + "num-bigint", + "num-traits 0.2.19", + "regex", + "salsa", + "serde", + "serde_json", + "sha3", + "smol_str", + "thiserror", +] + +[[package]] +name = "cairo-lang-sierra-ap-change" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c99a0be021b359c51383cce4372cb1061f7d53438d80f208c56af2154583c98e" +dependencies = [ + "cairo-lang-eq-solver", + "cairo-lang-sierra", + "cairo-lang-sierra-type-size", + "cairo-lang-utils", + "itertools 0.11.0", + "num-traits 0.2.19", + "thiserror", +] + +[[package]] +name = "cairo-lang-sierra-gas" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f273d4de9d30e556e72ebe2751f9ed6bf3d84a70f6c76f52b178c24cddb12e43" +dependencies = [ + "cairo-lang-eq-solver", + "cairo-lang-sierra", + "cairo-lang-sierra-type-size", + "cairo-lang-utils", + "itertools 0.11.0", + "num-traits 0.2.19", + "thiserror", +] + +[[package]] +name = "cairo-lang-sierra-generator" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "734f72e9e8b1ec7a96208aa8dfba87ca1614188e3646ae67c519afe707569490" +dependencies = [ + "cairo-lang-debug", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-lowering", + "cairo-lang-parser", + "cairo-lang-semantic", + "cairo-lang-sierra", + "cairo-lang-syntax", + "cairo-lang-utils", + "itertools 0.11.0", + "num-bigint", + "once_cell", + "salsa", + "smol_str", +] + +[[package]] +name = "cairo-lang-sierra-to-casm" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "842ae37ee3f1cd06b926aceb480fd70b84300aae82e9606b876678d30c21649a" +dependencies = [ + "assert_matches", + "cairo-felt", + "cairo-lang-casm", + "cairo-lang-sierra", + "cairo-lang-sierra-ap-change", + "cairo-lang-sierra-gas", + "cairo-lang-sierra-type-size", + "cairo-lang-utils", + "indoc", + "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", + "thiserror", +] + +[[package]] +name = "cairo-lang-sierra-type-size" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f969cbaf81f3beb1dc693674fc792a815bf8fc13471227020a5faf309d5faf80" +dependencies = [ + "cairo-lang-sierra", + "cairo-lang-utils", +] + +[[package]] +name = "cairo-lang-starknet" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cd2d120f39369c7bd7d124dee638c250495054030d01d4e1d1b88f0063bd80" +dependencies = [ + "anyhow", + "cairo-felt", + "cairo-lang-casm", + "cairo-lang-compiler", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-lowering", + "cairo-lang-plugins", + "cairo-lang-semantic", + "cairo-lang-sierra", + "cairo-lang-sierra-generator", + "cairo-lang-sierra-to-casm", + "cairo-lang-syntax", + "cairo-lang-utils", + "const_format", + "convert_case 0.6.0", + "indent", + "indoc", + "itertools 0.11.0", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "once_cell", + "serde", + "serde_json", + "sha3", + "smol_str", + "starknet-crypto 0.6.2", + "thiserror", +] + +[[package]] +name = "cairo-lang-syntax" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552d3438fec55832976bc7c7d7490100e8ce7385d3f3f1539f9a46fffa2197c6" +dependencies = [ + "cairo-lang-debug", + "cairo-lang-filesystem", + "cairo-lang-utils", + "num-bigint", + "num-traits 0.2.19", + "salsa", + "smol_str", + "unescaper", +] + +[[package]] +name = "cairo-lang-syntax-codegen" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e2d692eae4bb4179a4a1148fd5eb738a91653d86750c813658ffad4a99fa97" +dependencies = [ + "genco", + "xshell", +] + +[[package]] +name = "cairo-lang-test-plugin" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5e416a932754f190de2de011f3b3eb20dcb8093fb073cad15a8e70be833c3d" +dependencies = [ + "anyhow", + "cairo-felt", + "cairo-lang-compiler", + "cairo-lang-debug", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-lowering", + "cairo-lang-semantic", + "cairo-lang-sierra", + "cairo-lang-sierra-generator", + "cairo-lang-starknet", + "cairo-lang-syntax", + "cairo-lang-utils", + "indoc", + "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", + "serde", +] + +[[package]] +name = "cairo-lang-utils" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12d0939f42d40fb1d975cae073d7d4f82d83de4ba2149293115525245425f909" +dependencies = [ + "hashbrown 0.14.5", + "indexmap 2.2.6", + "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", + "schemars", + "serde", +] + +[[package]] +name = "cairo-native" version = "0.1.0" +source = "git+https://github.com/lambdaclass/cairo_native?rev=baf57d2dde0036ac4848fc40c672826fb7ffcde4#baf57d2dde0036ac4848fc40c672826fb7ffcde4" +dependencies = [ + "anyhow", + "bumpalo", + "cairo-felt", + "cairo-lang-compiler", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-lowering", + "cairo-lang-runner", + "cairo-lang-semantic", + "cairo-lang-sierra", + "cairo-lang-sierra-ap-change", + "cairo-lang-sierra-gas", + "cairo-lang-sierra-generator", + "cairo-lang-starknet", + "cairo-lang-test-plugin", + "cairo-lang-utils", + "cairo-native-runtime", + "cc", + "clap", + "colored", + "educe", + "id-arena", + "itertools 0.12.1", + "lazy_static", + "libc", + "libloading", + "llvm-sys", + "melior", + "mlir-sys", + "num-bigint", + "num-traits 0.2.19", + "starknet-types-core", + "tempfile", + "thiserror", + "tracing", + "tracing-subscriber", +] [[package]] -name = "rpc-state-reader" +name = "cairo-native-runtime" version = "0.1.0" +source = "git+https://github.com/lambdaclass/cairo_native?rev=baf57d2dde0036ac4848fc40c672826fb7ffcde4#baf57d2dde0036ac4848fc40c672826fb7ffcde4" +dependencies = [ + "cairo-lang-runner", + "lazy_static", + "libc", + "starknet-crypto 0.6.2", + "starknet-curve 0.4.2", + "starknet-types-core", +] + +[[package]] +name = "cairo-vm" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd569684da80d747273613d5c809e4f81bf6f6b1b64d0301b12bac8f2fb8ffb1" +dependencies = [ + "anyhow", + "bincode 2.0.0-rc.3", + "bitvec", + "cairo-felt", + "generic-array", + "hashbrown 0.14.5", + "hex", + "keccak", + "lazy_static", + "mimalloc", + "nom", + "num-bigint", + "num-integer", + "num-prime", + "num-traits 0.2.19", + "rand", + "serde", + "serde_json", + "sha2", + "sha3", + "starknet-crypto 0.6.2", + "starknet-curve 0.4.2", + "thiserror-no-std", +] + +[[package]] +name = "cairo-vm" +version = "1.0.0-rc1" +source = "git+https://github.com/lambdaclass/cairo-vm?rev=3547089579dd74f815edbc2d1caa91e00fc8a2f7#3547089579dd74f815edbc2d1caa91e00fc8a2f7" +dependencies = [ + "anyhow", + "ark-ff", + "ark-std", + "bincode 2.0.0-rc.3", + "bitvec", + "cairo-lang-casm", + "cairo-lang-starknet", + "generic-array", + "hashbrown 0.14.5", + "hex", + "keccak", + "lazy_static", + "mimalloc", + "nom", + "num-bigint", + "num-integer", + "num-prime", + "num-traits 0.2.19", + "rand", + "serde", + "serde_json", + "sha2", + "sha3", + "starknet-crypto 0.6.2", + "starknet-types-core", + "thiserror-no-std", + "zip", +] + +[[package]] +name = "cc" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +dependencies = [ + "jobserver", + "libc", + "once_cell", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits 0.2.19", + "serde", + "windows-targets 0.52.5", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "4.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim 0.11.1", + "terminal_size", +] + +[[package]] +name = "clap_derive" +version = "4.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "clap_lex" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" + +[[package]] +name = "colorchoice" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + +[[package]] +name = "colored" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +dependencies = [ + "lazy_static", + "windows-sys 0.48.0", +] + +[[package]] +name = "comrak" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0436149c9f6a1935b13306206c739b1ba84fa81f551b5eb87fc2ca7a13700af" +dependencies = [ + "clap", + "derive_builder", + "entities", + "memchr", + "once_cell", + "regex", + "shell-words", + "slug", + "syntect", + "typed-arena", + "unicode_categories", + "xdg", +] + +[[package]] +name = "const-fnv1a-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b13ea120a812beba79e34316b3942a857c86ec1593cb34f27bb28272ce2cca" + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const_format" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ctor" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" +dependencies = [ + "quote", + "syn 2.0.66", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + +[[package]] +name = "darling" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +dependencies = [ + "darling_core 0.20.9", + "darling_macro 0.20.9", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 1.0.109", +] + +[[package]] +name = "darling_core" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.11.1", + "syn 2.0.66", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +dependencies = [ + "darling_core 0.20.9", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "darrentsung_debug_parser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf488eca7807ce3c8e64bee95c3fbf8f1935c905b3b73835e75db16fc458fdc4" +dependencies = [ + "anyhow", + "html-escape", + "nom", + "ordered-float", +] + +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core 0.9.10", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case 0.4.0", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "deunicode" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339544cc9e2c4dc3fc7149fd630c5f22263a4fdf18a98afd0075784968b5cf00" + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "educe" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4bd92664bf78c4d3dba9b7cdafce6fa15b13ed3ed16175218196942e99168a8" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "either" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "pem-rfc7468", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "ena" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" +dependencies = [ + "log", +] + +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "entities" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca" + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "eth-keystore" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" +dependencies = [ + "aes", + "ctr", + "digest", + "hex", + "hmac", + "pbkdf2", + "rand", + "scrypt", + "serde", + "serde_json", + "sha2", + "sha3", + "thiserror", + "uuid", +] + +[[package]] +name = "ethbloom" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" +dependencies = [ + "crunchy", + "fixed-hash", + "impl-rlp", + "impl-serde", + "tiny-keccak", +] + +[[package]] +name = "ethereum-types" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" +dependencies = [ + "ethbloom", + "fixed-hash", + "impl-rlp", + "impl-serde", + "primitive-types", + "uint", +] + +[[package]] +name = "fancy-regex" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" +dependencies = [ + "bit-set", + "regex", +] + +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "genco" +version = "0.17.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afac3cbb14db69ac9fef9cdb60d8a87e39a7a527f85a81a923436efa40ad42c6" +dependencies = [ + "genco-macros", + "relative-path", + "smallvec", +] + +[[package]] +name = "genco-macros" +version = "0.17.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "553630feadf7b76442b0849fd25fdf89b860d933623aec9693fed19af0400c78" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getset" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "good_lp" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3198bd13dea84c76a64621d6ee8ee26a4960a9a0d538eca95ca8f1320a469ac9" +dependencies = [ + "fnv", + "minilp", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.2.6", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.8", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.11", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash 0.8.11", + "allocator-api2", + "serde", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "html-escape" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1ad449764d627e22bfd7cd5e8868264fc9236e07c752972b4080cd351cb476" +dependencies = [ + "utf8-width", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls 0.21.12", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "id-arena" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-rlp" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +dependencies = [ + "rlp", +] + +[[package]] +name = "impl-serde" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "indent" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f1a0777d972970f204fdf8ef319f1f4f8459131636d7e3c96c5d59570d0fa6" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown 0.14.5", + "serde", +] + +[[package]] +name = "indoc" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jobserver" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", + "signature", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lalrpop" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" +dependencies = [ + "ascii-canvas", + "bit-set", + "ena", + "itertools 0.11.0", + "lalrpop-util", + "petgraph", + "pico-args", + "regex", + "regex-syntax 0.8.3", + "string_cache", + "term", + "tiny-keccak", + "unicode-xid", + "walkdir", +] + +[[package]] +name = "lalrpop-util" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" +dependencies = [ + "regex-automata 0.4.6", +] + +[[package]] +name = "lambdaworks-crypto" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d4c222d5b2fdc0faf702d3ab361d14589b097f40eac9dc550e27083483edc65" +dependencies = [ + "lambdaworks-math", + "serde", + "sha2", + "sha3", +] + +[[package]] +name = "lambdaworks-math" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ee7dcab3968c71896b8ee4dc829147acc918cffe897af6265b1894527fe3add" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin 0.5.2", +] + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libloading" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +dependencies = [ + "cfg-if", + "windows-targets 0.52.5", +] + +[[package]] +name = "libmimalloc-sys" +version = "0.1.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7bb23d733dfcc8af652a78b7bf232f0e967710d044732185e561e47c0336b6" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", +] + +[[package]] +name = "line-wrap" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd1bc4d24ad230d21fb898d1116b1801d7adfc449d42026475862ab48b11e70e" + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "llvm-sys" +version = "170.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed90f72df5504c0af2e3a08ee7762a4a3e42ec2605811fc19f64879de40c50a" +dependencies = [ + "anyhow", + "cc", + "lazy_static", + "libc", + "regex-lite", + "semver", +] + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "lru" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" +dependencies = [ + "hashbrown 0.12.3", +] + +[[package]] +name = "lru" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +dependencies = [ + "hashbrown 0.14.5", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matrixmultiply" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "916806ba0031cd542105d916a97c8572e1fa6dd79c9c51e7eb43a09ec2dd84c1" +dependencies = [ + "rawpointer", +] + +[[package]] +name = "melior" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e76dd7ff903474595023aebb93f8287667a2fe95132c65e1c77efdb99c64a973" +dependencies = [ + "dashmap", + "melior-macro", + "mlir-sys", + "once_cell", +] + +[[package]] +name = "melior-macro" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fc9d57809ee6146f482b68555a605df4d5b018c5d5377d08a6aa99006f389" +dependencies = [ + "comrak", + "convert_case 0.6.0", + "once_cell", + "proc-macro2", + "quote", + "regex", + "syn 2.0.66", + "tblgen", + "unindent", +] + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "memoize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5df4051db13d0816cf23196d3baa216385ae099339f5d0645a8d9ff2305e82b8" +dependencies = [ + "lazy_static", + "lru 0.7.8", + "memoize-inner", +] + +[[package]] +name = "memoize-inner" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27bdece7e91f0d1e33df7b46ec187a93ea0d4e642113a1039ac8bfdd4a3273ac" +dependencies = [ + "lazy_static", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "mimalloc" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9186d86b79b52f4a77af65604b51225e8db1d6ee7e3f41aec1e40829c71a176" +dependencies = [ + "libmimalloc-sys", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minilp" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82a7750a9e5076c660b7bec5e6457b4dbff402b9863c8d112891434e18fd5385" +dependencies = [ + "log", + "sprs", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "mlir-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1b5806a63bc959cd5c4e5db8cadd20e40045d41969d325132748db8af11b7f" +dependencies = [ + "bindgen 0.69.4", +] + +[[package]] +name = "ndarray" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac06db03ec2f46ee0ecdca1a1c34a99c0d188a0d83439b84bf0cb4b386e4ab09" +dependencies = [ + "matrixmultiply", + "num-complex", + "num-integer", + "num-traits 0.2.19", + "rawpointer", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-bigint" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +dependencies = [ + "num-integer", + "num-traits 0.2.19", + "rand", + "serde", +] + +[[package]] +name = "num-complex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +dependencies = [ + "autocfg", + "num-traits 0.2.19", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits 0.2.19", +] + +[[package]] +name = "num-modular" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a5fe11d4135c3bcdf3a95b18b194afa9608a5f6ff034f5d857bc9a27fb0119" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits 0.2.19", +] + +[[package]] +name = "num-prime" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e238432a7881ec7164503ccc516c014bf009be7984cde1ba56837862543bdec3" +dependencies = [ + "bitvec", + "either", + "lru 0.12.3", + "num-bigint", + "num-integer", + "num-modular", + "num-traits 0.2.19", + "rand", +] + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +dependencies = [ + "num-traits 0.2.19", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "onig" +version = "6.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f" +dependencies = [ + "bitflags 1.3.2", + "libc", + "once_cell", + "onig_sys", +] + +[[package]] +name = "onig_sys" +version = "69.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b829e3d7e9cc74c7e315ee8edb185bf4190da5acde74afd7fc59c35b1f086e7" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "oorandom" +version = "11.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" + +[[package]] +name = "ordered-float" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits 0.2.19", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "parity-scale-codec" +version = "3.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.10", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.5.1", + "smallvec", + "windows-targets 0.52.5", +] + +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "path-clean" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef" + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest", + "hmac", + "password-hash", + "sha2", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap 2.2.6", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared 0.11.2", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared 0.11.2", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared 0.11.2", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "plist" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9d34169e64b3c7a80c8621a48adaf44e0cf62c78a9b25dd9dd35f1881a17cf9" +dependencies = [ + "base64 0.21.7", + "indexmap 2.2.6", + "line-wrap", + "quick-xml", + "serde", + "time", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "pretty_assertions" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +dependencies = [ + "diff", + "yansi", +] + +[[package]] +name = "pretty_assertions_sorted" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa95d32882f2adbdfd30312733271b83c527ee8007bf78dc21afe510463ac6a0" +dependencies = [ + "darrentsung_debug_parser", + "pretty_assertions", +] + +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2", + "syn 2.0.66", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-xml" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + +[[package]] +name = "redox_users" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +dependencies = [ + "getrandom", + "libredox", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-lite" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b661b2f27137bdbc16f00eda72866a92bb28af1753ffbd56744fb6e2e9cd8e" + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" + +[[package]] +name = "relative-path" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" + +[[package]] +name = "replay" +version = "0.1.0" + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls 0.21.12", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 0.25.4", + "winreg", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "rpc-state-reader" +version = "0.1.0" +dependencies = [ + "blockifier", + "cairo-lang-starknet", + "cairo-lang-utils", + "cairo-vm 0.9.2", + "cairo-vm 1.0.0-rc1", + "dotenv", + "flate2", + "pretty_assertions_sorted", + "serde", + "serde_json", + "serde_with 3.8.1", + "starknet", + "starknet_api", + "starknet_in_rust", + "test-case", + "thiserror", + "ureq", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring", + "rustls-webpki 0.101.7", + "sct", +] + +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring", + "rustls-pki-types", + "rustls-webpki 0.102.4", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "rustls-webpki" +version = "0.102.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ryu" +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", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "indexmap 1.9.3", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.66", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scrypt" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" +dependencies = [ + "hmac", + "pbkdf2", + "salsa20", + "sha2", +] + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "serde_json" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_json_pythonic" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62212da9872ca2a0cad0093191ee33753eddff9266cbbc1b4a602d13a3a768db" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" +dependencies = [ + "base64 0.13.1", + "chrono", + "hex", + "indexmap 1.9.3", + "serde", + "serde_json", + "serde_with_macros 2.3.3", + "time", +] + +[[package]] +name = "serde_with" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.2.6", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros 3.8.1", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +dependencies = [ + "darling 0.20.9", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "serde_with_macros" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" +dependencies = [ + "darling 0.20.9", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "slug" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bd94acec9c8da640005f8e135a39fc0372e74535e6b368b7a04b875f784c8c4" +dependencies = [ + "deunicode", + "wasm-bindgen", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "smol_str" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" +dependencies = [ + "serde", +] + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "sprs" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec63571489873d4506683915840eeb1bb16b3198ee4894cc6f2fe3013d505e56" +dependencies = [ + "ndarray", + "num-complex", + "num-traits 0.1.43", +] + +[[package]] +name = "starknet" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "351ffff1bcf6a1dc569a1b330dfd85779e16506e7d4a87baa8be3744cb5415a6" +dependencies = [ + "starknet-accounts", + "starknet-contract", + "starknet-core 0.7.2", + "starknet-crypto 0.6.2", + "starknet-ff", + "starknet-macros", + "starknet-providers", + "starknet-signers", +] + +[[package]] +name = "starknet-accounts" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7062b020f65d9da7f9dd9f1d97bfb644e881cda8ddb999799a799e6f2e408dd" +dependencies = [ + "async-trait", + "auto_impl", + "starknet-core 0.7.2", + "starknet-providers", + "starknet-signers", + "thiserror", +] + +[[package]] +name = "starknet-contract" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d858efc93d85de95065a5732cb3e94d0c746674964c0859aab442ffbb9de76b4" +dependencies = [ + "serde", + "serde_json", + "serde_with 2.3.3", + "starknet-accounts", + "starknet-core 0.7.2", + "starknet-providers", + "thiserror", +] + +[[package]] +name = "starknet-core" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f1683ca7c63f0642310eddedb7d35056d8306084dff323d440711065c63ed87" +dependencies = [ + "base64 0.21.7", + "flate2", + "hex", + "serde", + "serde_json", + "serde_json_pythonic", + "serde_with 2.3.3", + "sha3", + "starknet-crypto 0.6.2", + "starknet-ff", +] + +[[package]] +name = "starknet-core" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ed286d637e34fb8ae1cd2f9615120ec8ff38d1cffd311ed7fdd497cdd2bd01f" +dependencies = [ + "base64 0.21.7", + "flate2", + "hex", + "serde", + "serde_json", + "serde_json_pythonic", + "serde_with 2.3.3", + "sha3", + "starknet-crypto 0.6.2", + "starknet-ff", +] + +[[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", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "rfc6979", + "sha2", + "starknet-crypto-codegen", + "starknet-curve 0.3.0", + "starknet-ff", + "zeroize", +] + +[[package]] +name = "starknet-crypto" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e2c30c01e8eb0fc913c4ee3cf676389fffc1d1182bfe5bb9670e4e72e968064" +dependencies = [ + "crypto-bigint", + "hex", + "hmac", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "rfc6979", + "sha2", + "starknet-crypto-codegen", + "starknet-curve 0.4.2", + "starknet-ff", + "zeroize", +] + +[[package]] +name = "starknet-crypto-codegen" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbc159a1934c7be9761c237333a57febe060ace2bc9e3b337a59a37af206d19f" +dependencies = [ + "starknet-curve 0.4.2", + "starknet-ff", + "syn 2.0.66", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1c383518bb312751e4be80f53e8644034aa99a0afb29d7ac41b89a997db875b" +dependencies = [ + "starknet-ff", +] + +[[package]] +name = "starknet-ff" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abf1b44ec5b18d87c1ae5f54590ca9d0699ef4dd5b2ffa66fc97f24613ec585" +dependencies = [ + "ark-ff", + "bigdecimal", + "crypto-bigint", + "getrandom", + "hex", + "num-bigint", + "serde", +] + +[[package]] +name = "starknet-macros" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95d549d3078bdbe775d0deaa8ddb57a19942989ce7c1f2dfd60beeb322bb4945" +dependencies = [ + "starknet-core 0.10.0", + "syn 2.0.66", +] + +[[package]] +name = "starknet-providers" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52072c2d258bf692affeccd602613d5f6c61a6ffc84da8f191ab4a1b0a5e24d1" +dependencies = [ + "async-trait", + "auto_impl", + "ethereum-types", + "flate2", + "log", + "reqwest", + "serde", + "serde_json", + "serde_with 2.3.3", + "starknet-core 0.7.2", + "thiserror", + "url", +] + +[[package]] +name = "starknet-signers" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "347b1bfc09846aafe16d2b3a5bc2d8a2f845e2958602442182d265fbd6011c2e" +dependencies = [ + "async-trait", + "auto_impl", + "crypto-bigint", + "eth-keystore", + "rand", + "starknet-core 0.7.2", + "starknet-crypto 0.6.2", + "thiserror", +] + +[[package]] +name = "starknet-types-core" +version = "0.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d53160556d1f23425100f42b3230df747ea05763efee685a2cd939dfb640701" +dependencies = [ + "bitvec", + "lambdaworks-crypto", + "lambdaworks-math", + "lazy_static", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "serde", +] + +[[package]] +name = "starknet_api" +version = "0.7.0-dev.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88969610ab6ea9391e0e05a3e7c38acc49dc1cb49941b93ca52814075002b92f" +dependencies = [ + "cairo-lang-starknet", + "derive_more", + "hex", + "indexmap 2.2.6", + "once_cell", + "parity-scale-codec", + "parity-scale-codec-derive", + "primitive-types", + "serde", + "serde_json", + "starknet-crypto 0.5.2", + "strum", + "strum_macros", + "thiserror", +] + +[[package]] +name = "starknet_in_rust" +version = "0.4.0" +source = "git+https://github.com/lambdaclass/starknet_in_rust?rev=99c7b3b29a78cf8a27cc61bcdc029ed4255817ad#99c7b3b29a78cf8a27cc61bcdc029ed4255817ad" +dependencies = [ + "anyhow", + "base64 0.21.7", + "cairo-lang-casm", + "cairo-lang-sierra", + "cairo-lang-starknet", + "cairo-lang-utils", + "cairo-native", + "cairo-vm 1.0.0-rc1", + "flate2", + "getset", + "hex", + "k256", + "keccak", + "lazy_static", + "mimalloc", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "once_cell", + "p256", + "sec1", + "serde", + "serde_json", + "serde_json_pythonic", + "sha3", + "starknet", + "starknet-crypto 0.6.2", + "starknet_api", + "thiserror", + "tracing", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot 0.12.3", + "phf_shared 0.10.0", + "precomputed-hash", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "syntect" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1" +dependencies = [ + "bincode 1.3.3", + "bitflags 1.3.2", + "fancy-regex", + "flate2", + "fnv", + "once_cell", + "onig", + "plist", + "regex-syntax 0.8.3", + "serde", + "serde_derive", + "serde_json", + "thiserror", + "walkdir", + "yaml-rust", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tblgen" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d19c09266feb8b16718d1183044d14703a0b4b59e55ce8beb4d6e21dd066b1b" +dependencies = [ + "bindgen 0.66.1", + "cc", + "paste", + "thiserror", +] + +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + +[[package]] +name = "terminal_size" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +dependencies = [ + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "test-case" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb2550dd13afcd286853192af8601920d959b14c401fcece38071d53bf0768a8" +dependencies = [ + "test-case-macros", +] + +[[package]] +name = "test-case-core" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcb7fd841cd518e279be3d5a3eb0636409487998a4aff22f3de87b81e88384f" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "test-case-macros" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "test-case-core", +] + +[[package]] +name = "thiserror" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "thiserror-impl-no-std" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58e6318948b519ba6dc2b442a6d0b904ebfb8d411a3ad3e07843615a72249758" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "thiserror-no-std" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3ad459d94dd517257cc96add8a43190ee620011bb6e6cdc82dafd97dfafafea" +dependencies = [ + "thiserror-impl-no-std", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot 0.12.3", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.12", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.22.14", +] + +[[package]] +name = "toml_datetime" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" +dependencies = [ + "indexmap 2.2.6", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.6.10", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typed-arena" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unescaper" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0adf6ad32eb5b3cadff915f7b770faaac8f7ff0476633aa29eb0d9584d889d34" +dependencies = [ + "thiserror", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + +[[package]] +name = "unindent" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "2.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d11a831e3c0b56e438a28308e7c810799e3c118417f342d30ecec080105395cd" +dependencies = [ + "base64 0.22.1", + "flate2", + "log", + "once_cell", + "rustls 0.22.4", + "rustls-pki-types", + "rustls-webpki 0.102.4", + "serde", + "serde_json", + "url", + "webpki-roots 0.26.1", +] + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom", + "serde", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.66", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "web-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + +[[package]] +name = "webpki-roots" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f217b6745021054125ef5741032a021a9c65f82bee2a8017cca928f1e3179991" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "xdg" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546" + +[[package]] +name = "xshell" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db0ab86eae739efd1b054a8d3d16041914030ac4e01cd1dca0cf252fd8b6437" +dependencies = [ + "xshell-macros", +] + +[[package]] +name = "xshell-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d422e8e38ec76e2f06ee439ccc765e9c6a9638b9e7c9f2e8255e4d41e8bd852" + +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + +[[package]] +name = "zerocopy" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac", + "pbkdf2", + "sha1", + "time", + "zstd", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.10+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml index 166219f..f9aa77e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,3 +8,7 @@ members = [ # Explicitly set the resolver to the default for edition >= 2021 # https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html resolver = "2" + +[workspace.dependencies] +thiserror = "1.0.32" + diff --git a/rpc-state-reader/Cargo.toml b/rpc-state-reader/Cargo.toml index ebb86c6..aff9ed1 100644 --- a/rpc-state-reader/Cargo.toml +++ b/rpc-state-reader/Cargo.toml @@ -3,4 +3,31 @@ name = "rpc-state-reader" version = "0.1.0" edition = "2021" +[features] +default = ["starknet_in_rust"] +starknet_in_rust = [] +cairo-native = ["starknet_in_rust/cairo-native"] + [dependencies] +ureq = { version = "2.7.1", features = ["json"] } +serde = { version = "1.0", features = ["derive"] } +serde_json = { version = "1.0", features = [ + "arbitrary_precision", + "raw_value", +] } +starknet_api = "0.7.0-dev.0" +cairo-lang-starknet = "=2.5.4" +cairo-lang-utils = "=2.5.4" +starknet = "0.7.0" +thiserror = { workspace = true } +flate2 = "1.0.25" +serde_with = "3.0.0" +dotenv = "0.15.0" +cairo-vm = { git = "https://github.com/lambdaclass/cairo-vm", rev = "3547089579dd74f815edbc2d1caa91e00fc8a2f7", features = ["cairo-1-hints"] } +cairo-vm-blockifier = { package = "cairo-vm", version = "0.9.1" } +blockifier = "=0.5.0-dev.0" +starknet_in_rust = {git = "https://github.com/lambdaclass/starknet_in_rust", rev = "99c7b3b29a78cf8a27cc61bcdc029ed4255817ad" } + +[dev-dependencies] +pretty_assertions_sorted = "1.2.3" +test-case = "3.1.0" diff --git a/rpc-state-reader/src/lib.rs b/rpc-state-reader/src/lib.rs index e7a11a9..6bf1c3e 100644 --- a/rpc-state-reader/src/lib.rs +++ b/rpc-state-reader/src/lib.rs @@ -1,3 +1,255 @@ -fn main() { - println!("Hello, world!"); +pub mod rpc_state; +pub mod rpc_state_errors; +pub mod utils; + +// only export the sir_state_reader module when the starknet_in_rust feature +// is enabled. +#[cfg(feature = "starknet_in_rust")] +mod sir_state_reader; +#[cfg(feature = "starknet_in_rust")] +pub use sir_state_reader::{ + execute_tx, execute_tx_configurable, execute_tx_configurable_with_state, + execute_tx_without_validate, get_transaction_hashes, RpcStateReader, +}; + +#[cfg(test)] +mod tests { + use cairo_vm::Felt252; + use pretty_assertions_sorted::{assert_eq, assert_eq_sorted}; + use starknet_api::{ + class_hash, + core::{ClassHash, ContractAddress, PatriciaKey}, + hash::{StarkFelt, StarkHash}, + patricia_key, stark_felt, + state::StorageKey, + transaction::{Transaction as SNTransaction, TransactionHash}, + }; + use starknet_in_rust::transaction::InvokeFunction; + + use crate::rpc_state::*; + + /// A utility macro to create a [`ContractAddress`] from a hex string / unsigned integer + /// representation. + /// Imported from starknet_api + macro_rules! contract_address { + ($s:expr) => { + ContractAddress(patricia_key!($s)) + }; + } + + #[test] + fn test_get_contract_class_cairo1() { + let rpc_state = RpcState::new_rpc(RpcChain::MainNet, BlockTag::Latest.into()).unwrap(); + + let class_hash = + class_hash!("0298e56befa6d1446b86ed5b900a9ba51fd2faa683cd6f50e8f833c0fb847216"); + // This belongs to + // https://starkscan.co/class/0x0298e56befa6d1446b86ed5b900a9ba51fd2faa683cd6f50e8f833c0fb847216 + // which is cairo1.0 + + rpc_state.get_contract_class(&class_hash); + } + + #[test] + fn test_get_contract_class_cairo0() { + let rpc_state = RpcState::new_rpc(RpcChain::MainNet, BlockTag::Latest.into()).unwrap(); + + let class_hash = + class_hash!("025ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918"); + rpc_state.get_contract_class(&class_hash); + } + + #[test] + fn test_get_class_hash_at() { + let rpc_state = RpcState::new_rpc(RpcChain::MainNet, BlockTag::Latest.into()).unwrap(); + let address = + contract_address!("00b081f7ba1efc6fe98770b09a827ae373ef2baa6116b3d2a0bf5154136573a9"); + + assert_eq!( + rpc_state.get_class_hash_at(&address), + class_hash!("025ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918") + ); + } + + #[test] + fn test_get_nonce_at() { + let rpc_state = RpcState::new_rpc(RpcChain::TestNet, BlockTag::Latest.into()).unwrap(); + // Contract deployed by xqft which will not be used again, so nonce changes will not break + // this test. + let address = + contract_address!("07185f2a350edcc7ea072888edb4507247de23e710cbd56084c356d265626bea"); + assert_eq!(rpc_state.get_nonce_at(&address), stark_felt!("0x0")); + } + + #[test] + fn test_get_storage_at() { + let rpc_state = RpcState::new_rpc(RpcChain::MainNet, BlockTag::Latest.into()).unwrap(); + let address = + contract_address!("00b081f7ba1efc6fe98770b09a827ae373ef2baa6116b3d2a0bf5154136573a9"); + let key = StorageKey(patricia_key!(0u128)); + + assert_eq_sorted!(rpc_state.get_storage_at(&address, &key), stark_felt!("0x0")); + } + + #[test] + fn test_get_transaction() { + let rpc_state = RpcState::new_rpc(RpcChain::MainNet, BlockTag::Latest.into()).unwrap(); + let tx_hash = TransactionHash(stark_felt!( + "06da92cfbdceac5e5e94a1f40772d6c79d34f011815606742658559ec77b6955" + )); + + assert!(rpc_state.get_transaction(&tx_hash).is_ok()); + } + + #[test] + fn test_try_from_invoke() { + let rpc_state = RpcState::new_rpc(RpcChain::MainNet, BlockTag::Latest.into()).unwrap(); + let tx_hash = TransactionHash(stark_felt!( + "06da92cfbdceac5e5e94a1f40772d6c79d34f011815606742658559ec77b6955" + )); + + let tx = rpc_state.get_transaction(&tx_hash).unwrap(); + match tx { + SNTransaction::Invoke(tx) => InvokeFunction::from_invoke_transaction( + tx, + Felt252::from_bytes_be_slice(tx_hash.0.bytes()), + ), + _ => unreachable!(), + } + .unwrap(); + } + + #[test] + fn test_get_block_info() { + let rpc_state = RpcState::new_rpc(RpcChain::MainNet, BlockTag::Latest.into()).unwrap(); + + assert!(rpc_state.get_block_info().is_ok()); + } + + // Tested with the following query to the Feeder Gateway API: + // https://alpha-mainnet.starknet.io/feeder_gateway/get_transaction_trace?transactionHash=0x035673e42bd485ae699c538d8502f730d1137545b22a64c094ecdaf86c59e592 + #[test] + fn test_get_transaction_trace() { + let rpc_state = RpcState::new_rpc(RpcChain::MainNet, BlockTag::Latest.into()).unwrap(); + + let tx_hash = TransactionHash(stark_felt!( + "0x035673e42bd485ae699c538d8502f730d1137545b22a64c094ecdaf86c59e592" + )); + + let tx_trace = rpc_state.get_transaction_trace(&tx_hash).unwrap(); + + assert_eq!( + tx_trace.validate_invocation.as_ref().unwrap().calldata, + Some(vec![ + stark_felt!("1"), + stark_felt!("0x45dc42889b6292c540de9def0341364bd60c2d8ccced459fac8b1bfc24fa1f5"), + stark_felt!("0xb758361d5e84380ef1e632f89d8e76a8677dbc3f4b93a4f9d75d2a6048f312"), + stark_felt!("0"), + stark_felt!("0xa"), + stark_felt!("0xa"), + stark_felt!("0x3fed4"), + stark_felt!("0"), + stark_felt!("0xdf6aedb"), + stark_felt!("0"), + stark_felt!("0"), + stark_felt!("0"), + stark_felt!("0x47c5f10d564f1623566b940a61fe54754bfff996f7536901ec969b12874f87f"), + stark_felt!("2"), + stark_felt!("0x72034953cd93dc8618123b4802003bae1f469b526bc18355250080c0f93dc17"), + stark_felt!("0x5f2ac628fa43d58fb8a6b7a2739de5c1edb550cb13cdcec5bc99f00135066a7"), + ]) + ); + assert_eq!( + tx_trace.validate_invocation.as_ref().unwrap().retdata, + Some(vec![]) + ); + assert_eq!( + tx_trace + .validate_invocation + .as_ref() + .unwrap() + .internal_calls + .len(), + 1 + ); + + assert_eq!( + tx_trace.execute_invocation.as_ref().unwrap().calldata, + Some(vec![ + stark_felt!("0x1"), + stark_felt!("0x45dc42889b6292c540de9def0341364bd60c2d8ccced459fac8b1bfc24fa1f5"), + stark_felt!("0xb758361d5e84380ef1e632f89d8e76a8677dbc3f4b93a4f9d75d2a6048f312"), + stark_felt!("0x0"), + stark_felt!("0xa"), + stark_felt!("0xa"), + stark_felt!("0x3fed4"), + stark_felt!("0x0"), + stark_felt!("0xdf6aedb"), + stark_felt!("0x0"), + stark_felt!("0x0"), + stark_felt!("0x0"), + stark_felt!("0x47c5f10d564f1623566b940a61fe54754bfff996f7536901ec969b12874f87f"), + stark_felt!("0x2"), + stark_felt!("0x72034953cd93dc8618123b4802003bae1f469b526bc18355250080c0f93dc17"), + stark_felt!("0x5f2ac628fa43d58fb8a6b7a2739de5c1edb550cb13cdcec5bc99f00135066a7") + ]) + ); + assert_eq!( + tx_trace.execute_invocation.as_ref().unwrap().retdata, + Some(vec![0u128.into()]) + ); + assert_eq!( + tx_trace + .execute_invocation + .as_ref() + .unwrap() + .internal_calls + .len(), + 1 + ); + assert_eq!( + tx_trace.execute_invocation.as_ref().unwrap().internal_calls[0] + .internal_calls + .len(), + 1 + ); + assert_eq!( + tx_trace.execute_invocation.as_ref().unwrap().internal_calls[0].internal_calls[0] + .internal_calls + .len(), + 0 + ); + + assert_eq!( + tx_trace.fee_transfer_invocation.as_ref().unwrap().calldata, + Some(vec![ + stark_felt!("0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8"), + stark_felt!("0x2439e47667460"), + stark_felt!("0"), + ]) + ); + assert_eq!( + tx_trace.fee_transfer_invocation.as_ref().unwrap().retdata, + Some(vec![1u128.into()]) + ); + assert_eq!( + tx_trace + .fee_transfer_invocation + .as_ref() + .unwrap() + .internal_calls + .len(), + 1 + ); + } + + #[test] + fn test_get_transaction_receipt() { + let rpc_state = RpcState::new_rpc(RpcChain::MainNet, BlockTag::Latest.into()).unwrap(); + let tx_hash = TransactionHash(stark_felt!( + "06da92cfbdceac5e5e94a1f40772d6c79d34f011815606742658559ec77b6955" + )); + + assert!(rpc_state.get_transaction_receipt(&tx_hash).is_ok()); + } } diff --git a/rpc-state-reader/src/rpc_state.rs b/rpc-state-reader/src/rpc_state.rs new file mode 100644 index 0000000..30896cb --- /dev/null +++ b/rpc-state-reader/src/rpc_state.rs @@ -0,0 +1,634 @@ +use cairo_vm::vm::runners::{ + builtin_runner::{ + BITWISE_BUILTIN_NAME, EC_OP_BUILTIN_NAME, HASH_BUILTIN_NAME, KECCAK_BUILTIN_NAME, + OUTPUT_BUILTIN_NAME, POSEIDON_BUILTIN_NAME, RANGE_CHECK_BUILTIN_NAME, + SIGNATURE_BUILTIN_NAME, + }, + cairo_runner::ExecutionResources as VmExecutionResources, +}; +use core::fmt; +use dotenv::dotenv; +use serde::{Deserialize, Deserializer}; +use serde_json::json; +use starknet::core::types::ContractClass as SNContractClass; +use starknet_api::{ + block::{BlockNumber, BlockTimestamp}, + core::{ChainId, ClassHash, ContractAddress}, + hash::{StarkFelt, StarkHash}, + state::StorageKey, + transaction::{Transaction as SNTransaction, TransactionHash}, +}; +use starknet_in_rust::definitions::block_context::{GasPrices, StarknetChainId}; +use std::{collections::HashMap, env, fmt::Display}; + +use crate::{rpc_state_errors::RpcStateError, utils}; + +/// Starknet chains supported in Infura. +#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord)] +pub enum RpcChain { + MainNet, + TestNet, + TestNet2, +} + +impl From for StarknetChainId { + fn from(network: RpcChain) -> StarknetChainId { + match network { + RpcChain::MainNet => StarknetChainId::MainNet, + RpcChain::TestNet => StarknetChainId::TestNet, + RpcChain::TestNet2 => StarknetChainId::TestNet2, + } + } +} + +impl fmt::Display for RpcChain { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + RpcChain::MainNet => write!(f, "starknet-mainnet"), + RpcChain::TestNet => write!(f, "starknet-goerli"), + RpcChain::TestNet2 => write!(f, "starknet-goerli2"), + } + } +} + +impl From for ChainId { + fn from(value: RpcChain) -> Self { + ChainId(match value { + RpcChain::MainNet => "alpha-mainnet".to_string(), + RpcChain::TestNet => "alpha4".to_string(), + RpcChain::TestNet2 => "alpha4-2".to_string(), + }) + } +} + +/// A [StateReader] that holds all the data in memory. +/// +/// This implementation is uses HTTP requests to call the RPC endpoint, +/// using Infura. +/// In order to use it an Infura API key is necessary. +#[derive(Debug, Clone, Eq, PartialEq, Hash, PartialOrd, Ord)] +pub struct RpcState { + /// Enum with one of the supported Infura chains/ + pub chain: RpcChain, + /// RPC Endpoint URL. + rpc_endpoint: String, + /// Struct that holds information on the block where we are going to use to read the state. + pub block: BlockValue, +} + +/// Represents the tag of a block value. +#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord)] +pub enum BlockTag { + Latest, + Pending, +} + +impl Display for BlockTag { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let string = match self { + BlockTag::Latest => "latest", + BlockTag::Pending => "pending", + }; + write!(f, "{}", string) + } +} + +/// [`BlockValue`] is an Enum that represent which block we are going to use to retrieve information. +#[allow(dead_code)] +#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord)] +pub enum BlockValue { + /// String one of: ["latest", "pending"] + Tag(BlockTag), + /// Integer + Number(BlockNumber), + /// String with format: 0x{felt252} + Hash(StarkHash), +} + +impl From for BlockValue { + fn from(value: BlockTag) -> Self { + BlockValue::Tag(value) + } +} + +impl From for BlockValue { + fn from(value: BlockNumber) -> Self { + BlockValue::Number(value) + } +} + +impl From for BlockValue { + fn from(value: StarkHash) -> Self { + BlockValue::Hash(value) + } +} + +impl BlockValue { + fn to_value(self) -> Result { + serde_json::to_value(match self { + BlockValue::Tag(block_tag) => block_tag.to_string().into(), + BlockValue::Number(block_number) => json!({ "block_number": block_number }), + BlockValue::Hash(block_hash) => json!({ "block_hash": block_hash }), + }) + } +} + +/// The RPC block info. +#[derive(Debug, Clone, Eq, PartialEq, Hash, PartialOrd, Ord)] +pub struct RpcBlockInfo { + /// The sequence number of the last block created. + pub block_number: BlockNumber, + /// Timestamp of the beginning of the last block creation attempt. + pub block_timestamp: BlockTimestamp, + /// The sequencer address of this block. + pub sequencer_address: ContractAddress, + /// The transactions of this block. + pub transactions: Vec, +} + +/// A RPC response. +#[derive(Debug, Deserialize, Clone, Eq, PartialEq, Hash, PartialOrd, Ord)] +pub struct RpcResponse { + result: T, +} + +#[derive(Debug, Deserialize, Clone, Eq, PartialEq)] +pub struct TransactionTrace { + pub validate_invocation: Option, + #[serde( + alias = "execute_invocation", + alias = "constructor_invocation", + alias = "function_invocation" + )] + pub execute_invocation: Option, + pub fee_transfer_invocation: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq)] +pub struct RpcExecutionResources { + pub n_steps: usize, + pub n_memory_holes: usize, + pub builtin_instance_counter: HashMap, +} + +#[derive(Debug, Clone, Eq, PartialEq, Default)] +pub struct RpcCallInfo { + pub retdata: Option>, + pub calldata: Option>, + pub internal_calls: Vec, + pub revert_reason: Option, +} + +#[derive(Debug, Deserialize)] +pub struct RpcTransactionReceipt { + pub actual_fee: FeePayment, + pub block_hash: StarkHash, + pub block_number: u64, + pub execution_status: String, + #[serde(rename = "type")] + pub tx_type: String, + #[serde(deserialize_with = "vm_execution_resources_deser")] + pub execution_resources: VmExecutionResources, +} + +#[allow(unused)] +#[derive(Debug, Deserialize)] +pub struct FeePayment { + #[serde(deserialize_with = "fee_amount_deser")] + pub amount: u128, + pub unit: String, +} + +fn fee_amount_deser<'de, D>(deserializer: D) -> Result +where + D: Deserializer<'de>, +{ + let hex: String = Deserialize::deserialize(deserializer)?; + u128::from_str_radix(&hex[2..], 16).map_err(serde::de::Error::custom) +} + +fn vm_execution_resources_deser<'de, D>(deserializer: D) -> Result +where + D: Deserializer<'de>, +{ + let value: serde_json::Value = Deserialize::deserialize(deserializer)?; + // Parse n_steps + let n_steps: usize = serde_json::from_value( + value + .get("steps") + .ok_or(serde::de::Error::custom( + RpcStateError::MissingRpcResponseField("steps".to_string()), + ))? + .clone(), + ) + .map_err(|e| serde::de::Error::custom(e.to_string()))?; + + // Parse n_memory_holes + let n_memory_holes: usize = if let Some(memory_holes) = value.get("memory_holes") { + serde_json::from_value(memory_holes.clone()) + .map_err(|e| serde::de::Error::custom(e.to_string()))? + } else { + 0 + }; + // Parse builtin instance counter + const BUILTIN_NAMES: [&str; 8] = [ + OUTPUT_BUILTIN_NAME, + RANGE_CHECK_BUILTIN_NAME, + HASH_BUILTIN_NAME, + SIGNATURE_BUILTIN_NAME, + KECCAK_BUILTIN_NAME, + BITWISE_BUILTIN_NAME, + EC_OP_BUILTIN_NAME, + POSEIDON_BUILTIN_NAME, + ]; + let mut builtin_instance_counter = HashMap::new(); + for name in BUILTIN_NAMES { + let builtin_counter: Option = value + .get(format!("{}_applications", name)) + .and_then(|a| serde_json::from_value(a.clone()).ok()); + if let Some(builtin_counter) = builtin_counter { + if builtin_counter > 0 { + builtin_instance_counter.insert(name.to_string(), builtin_counter); + } + }; + } + Ok(VmExecutionResources { + n_steps, + n_memory_holes, + builtin_instance_counter, + }) +} + +impl<'de> Deserialize<'de> for RpcCallInfo { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let value: serde_json::Value = Deserialize::deserialize(deserializer)?; + + // In case of a revert error, the struct will only contain the revert_reason field + if let Some(revert_error) = value.get("revert_reason") { + return Ok(RpcCallInfo { + revert_reason: serde_json::from_value(revert_error.clone()) + .map_err(|e| serde::de::Error::custom(e.to_string()))?, + ..Default::default() + }); + } + // Parse retdata + let retdata_value = value + .get("result") + .ok_or(serde::de::Error::custom( + RpcStateError::MissingRpcResponseField("result".to_string()), + ))? + .clone(); + let retdata = serde_json::from_value(retdata_value) + .map_err(|e| serde::de::Error::custom(e.to_string()))?; + + // Parse calldata + let calldata_value = value + .get("calldata") + .ok_or(serde::de::Error::custom( + RpcStateError::MissingRpcResponseField("calldata".to_string()), + ))? + .clone(); + let calldata = serde_json::from_value(calldata_value) + .map_err(|e| serde::de::Error::custom(e.to_string()))?; + + // Parse internal calls + let internal_calls_value = value + .get("calls") + .ok_or(serde::de::Error::custom( + RpcStateError::MissingRpcResponseField("calls".to_string()), + ))? + .clone(); + let mut internal_calls = vec![]; + + for call in internal_calls_value + .as_array() + .ok_or(serde::de::Error::custom( + RpcStateError::RpcResponseWrongType("internal_calls".to_string()), + ))? + { + internal_calls + .push(serde_json::from_value(call.clone()).map_err(serde::de::Error::custom)?); + } + + Ok(RpcCallInfo { + retdata, + calldata, + internal_calls, + revert_reason: None, + }) + } +} + +impl RpcState { + pub fn new(chain: RpcChain, block: BlockValue, rpc_endpoint: &str) -> Self { + Self { + chain, + rpc_endpoint: rpc_endpoint.to_string(), + block, + } + } + + pub fn new_rpc(chain: RpcChain, block: BlockValue) -> Result { + if env::var("RPC_ENDPOINT_MAINNET").is_err() || env::var("RPC_ENDPOINT_TESTNET").is_err() { + dotenv().map_err(|_| RpcStateError::MissingEnvFile)?; + } + + let rpc_endpoint = + match chain { + RpcChain::MainNet => env::var("RPC_ENDPOINT_MAINNET") + .map_err(|_| RpcStateError::MissingRpcEndpoints)?, + RpcChain::TestNet => env::var("RPC_ENDPOINT_TESTNET") + .map_err(|_| RpcStateError::MissingRpcEndpoints)?, + RpcChain::TestNet2 => unimplemented!(), + }; + + Ok(Self::new(chain, block, &rpc_endpoint)) + } + + fn rpc_call_result Deserialize<'a>>( + &self, + method: &str, + params: &serde_json::Value, + ) -> Result { + Ok(self.rpc_call::>(method, params)?.result) + } + + fn rpc_call Deserialize<'a>>( + &self, + method: &str, + params: &serde_json::Value, + ) -> Result { + let payload = serde_json::json!({ + "jsonrpc": "2.0", + "method": method, + "params": params, + "id": 1 + }); + let response = self.rpc_call_no_deserialize(&payload)?.into_json()?; + Self::deserialize_call(response) + } + + fn rpc_call_no_deserialize( + &self, + params: &serde_json::Value, + ) -> Result { + ureq::post(&self.rpc_endpoint) + .set("Content-Type", "application/json") + .set("accept", "application/json") + .send_json(params) + .map_err(|err| { + if err + .to_string() + .contains("request failed or timed out through") + { + RpcStateError::RpcConnectionNotAvailable + } else { + RpcStateError::Request(err.to_string()) + } + }) + } + + fn deserialize_call Deserialize<'a>>( + response: serde_json::Value, + ) -> Result { + serde_json::from_value(response).map_err(|err| RpcStateError::RpcCall(err.to_string())) + } + + /// Requests the transaction trace to the Feeder Gateway API. + /// It's useful for testing the transaction outputs like: + /// - execution resources + /// - actual fee + /// - events + /// - return data + pub fn get_transaction_trace( + &self, + hash: &TransactionHash, + ) -> Result { + let result = self + .rpc_call::("starknet_traceTransaction", &json!([hash.to_string()]))? + .get("result") + .ok_or(RpcStateError::MissingRpcResponseField("result".into()))? + .clone(); + serde_json::from_value(result).map_err(|e| RpcStateError::Request(e.to_string())) + } + + /// Requests the given transaction to the Feeder Gateway API. + pub fn get_transaction(&self, hash: &TransactionHash) -> Result { + let result = self + .rpc_call::( + "starknet_getTransactionByHash", + &json!([hash.to_string()]), + )? + .get("result") + .ok_or(RpcStateError::MissingRpcResponseField("result".into()))? + .clone(); + utils::deserialize_transaction_json(result).map_err(RpcStateError::SerdeJson) + } + + /// Gets the gas price of a given block. + pub fn get_gas_price(&self, block_number: u64) -> Result { + let res = self + .rpc_call::( + "starknet_getBlockWithTxHashes", + &json!({"block_id" : { "block_number": block_number }}), + )? + .get("result") + .ok_or(RpcStateError::MissingRpcResponseField("result".into()))? + .clone(); + + let gas_price_eth = u128::from_str_radix( + res.get("l1_gas_price") + .and_then(|gp| gp.get("price_in_wei")) + .and_then(|gp| gp.as_str()) + .ok_or(RpcStateError::MissingRpcResponseField( + "gas_price.price_in_wei".to_string(), + ))? + .trim_start_matches("0x"), + 16, + ) + .map_err(|_| RpcStateError::RpcResponseWrongType("gas_price".to_string()))?; + + let gas_price_strk = u128::from_str_radix( + res.get("l1_gas_price") + .and_then(|gp| gp.get("price_in_fri")) + .and_then(|gp| gp.as_str()) + .ok_or(RpcStateError::MissingRpcResponseField( + "gas_price.price_in_fri".to_string(), + ))? + .trim_start_matches("0x"), + 16, + ) + .map_err(|_| RpcStateError::RpcResponseWrongType("gas_price".to_string()))?; + + Ok(GasPrices::new(gas_price_eth, gas_price_strk)) + } + + pub fn get_chain_name(&self) -> ChainId { + self.chain.into() + } + + pub fn get_block_info(&self) -> Result { + let block_info: serde_json::Value = self + .rpc_call("starknet_getBlockWithTxs", &json!([self.block.to_value()?])) + .map_err(|e| RpcStateError::RpcCall(e.to_string()))?; + + let sequencer_address: StarkFelt = block_info + .get("result") + .and_then(|result| result.get("sequencer_address")) + .and_then(|sa| serde_json::from_value(sa.clone()).ok()) + .ok_or_else(|| { + RpcStateError::RpcObjectHasNoField("block_info".into(), "sequencer_address".into()) + })?; + + let transactions: Vec<_> = block_info + .get("result") + .and_then(|result| result.get("transactions")) + .and_then(|txs| txs.as_array()) + .map(|arr| { + arr.iter() + .filter_map(|result| utils::deserialize_transaction_json(result.clone()).ok()) + .collect() + }) + .ok_or_else(|| { + RpcStateError::RpcObjectHasNoField("block_info".into(), "transactions".into()) + })?; + + Ok(RpcBlockInfo { + block_number: BlockNumber( + block_info + .get("result") + .and_then(|result| result.get("block_number")) + .and_then(|v| v.to_string().parse::().ok()) + .ok_or_else(|| { + RpcStateError::RpcObjectHasNoField( + "block_info".into(), + "block_number".into(), + ) + })?, + ), + block_timestamp: BlockTimestamp( + block_info + .get("result") + .and_then(|result| result.get("timestamp")) + .and_then(|v| v.to_string().parse::().ok()) + .ok_or_else(|| { + RpcStateError::RpcObjectHasNoField("block_info".into(), "timestamp".into()) + })?, + ), + sequencer_address: ContractAddress( + sequencer_address + .try_into() + .map_err(|_| RpcStateError::StarkFeltToParticiaKeyConversion)?, + ), + transactions, + }) + } + + pub fn get_contract_class(&self, class_hash: &ClassHash) -> Option { + self.block.to_value().ok().and_then(|block| { + self.rpc_call_result( + "starknet_getClass", + &json!([block, class_hash.0.to_string()]), + ) + .ok() + }) + } + + pub fn get_class_hash_at(&self, contract_address: &ContractAddress) -> ClassHash { + let hash = self + .block + .to_value() + .ok() + .and_then(|block| { + self.rpc_call_result( + "starknet_getClassHashAt", + &json!([block, contract_address.0.key().clone().to_string()]), + ) + .ok() + }) + .unwrap_or_default(); + + ClassHash(hash) + } + + pub fn get_nonce_at(&self, contract_address: &ContractAddress) -> StarkFelt { + self.block + .to_value() + .ok() + .and_then(|block| { + self.rpc_call_result( + "starknet_getNonce", + &json!([block, contract_address.0.key().clone().to_string()]), + ) + .ok() + }) + // When running deploy_account transactions, the nonce doesn't exist on the previous block so we return 0 + .unwrap_or_default() + } + + pub fn get_storage_at( + &self, + contract_address: &ContractAddress, + key: &StorageKey, + ) -> StarkFelt { + let contract_address = contract_address.0.key(); + let key = key.0.key(); + self.block + .to_value() + .ok() + .and_then(|block| { + self.rpc_call_result( + "starknet_getStorageAt", + &json!([contract_address.to_string(), key.to_string(), block]), + ) + .ok() + }) + .unwrap_or_default() + } + + /// Requests the given transaction to the Feeder Gateway API. + pub fn get_transaction_receipt( + &self, + hash: &TransactionHash, + ) -> Result { + self.rpc_call_result("starknet_getTransactionReceipt", &json!([hash.to_string()])) + .map_err(|e| RpcStateError::RpcCall(e.to_string())) + } + + pub fn get_transaction_hashes(&self) -> Result, RpcStateError> { + let params = &json![vec![self.block.to_value()?]]; + let payload = serde_json::json!({ + "jsonrpc": "2.0", + "method": "starknet_getBlockWithTxHashes", + "params": params, + "id": 1 + }); + let response: serde_json::Value = self + .rpc_call_no_deserialize(&payload) + .unwrap() + .into_json()?; + let hashes: Vec = response + .get("result") + .and_then(|res| res.get("transactions")) + .and_then(|txs| txs.as_array()) + .map(|arr| { + arr.iter() + .filter_map(|tx| tx.as_str().map(|x| x.to_string())) + .collect() + }) + .unwrap_or_default(); + Ok(hashes) + } +} + +#[test] +fn test_tx_hashes() { + let rpc_state = + RpcState::new_rpc(RpcChain::MainNet, BlockValue::Number(BlockNumber(397709))).unwrap(); + + let hashes = rpc_state.get_transaction_hashes().unwrap(); + assert_eq!(hashes.len(), 211); +} diff --git a/rpc-state-reader/src/rpc_state_errors.rs b/rpc-state-reader/src/rpc_state_errors.rs new file mode 100644 index 0000000..6c1fe78 --- /dev/null +++ b/rpc-state-reader/src/rpc_state_errors.rs @@ -0,0 +1,27 @@ +use thiserror::Error; + +#[derive(Debug, Error)] +pub enum RpcStateError { + #[error("Missing .env file")] + MissingEnvFile, + #[error("Missing rpc endpoints")] + MissingRpcEndpoints, + #[error("RPC call failed with error: {0}")] + RpcCall(String), + #[error("Request failed with error: {0}")] + Request(String), + #[error(transparent)] + Io(#[from] std::io::Error), + #[error(transparent)] + SerdeJson(#[from] serde_json::Error), + #[error("Object {0} obtained from rpc call has no field {1}")] + RpcObjectHasNoField(String, String), + #[error("Failed to convert StarkFelt to PatriciaKey")] + StarkFeltToParticiaKeyConversion, + #[error("The service is down")] + RpcConnectionNotAvailable, + #[error("The response does not have a field named '{0}'")] + MissingRpcResponseField(String), + #[error("Wrong type for response field '{0}'")] + RpcResponseWrongType(String), +} diff --git a/rpc-state-reader/src/sir_state_reader.rs b/rpc-state-reader/src/sir_state_reader.rs new file mode 100644 index 0000000..415b019 --- /dev/null +++ b/rpc-state-reader/src/sir_state_reader.rs @@ -0,0 +1,299 @@ +use std::sync::Arc; + +use cairo_vm::Felt252; +use starknet_api::{ + block::BlockNumber, + core::{ClassHash as SNClassHash, ContractAddress, PatriciaKey}, + hash::{StarkFelt, StarkHash}, + state::StorageKey, + transaction::{Transaction as SNTransaction, TransactionHash}, +}; +use starknet_in_rust::{ + core::errors::state_errors::StateError, + definitions::{ + block_context::{BlockContext, FeeTokenAddresses, StarknetChainId, StarknetOsConfig}, + constants::{ + DEFAULT_CAIRO_RESOURCE_FEE_WEIGHTS, DEFAULT_CONTRACT_STORAGE_COMMITMENT_TREE_HEIGHT, + DEFAULT_GLOBAL_STATE_COMMITMENT_TREE_HEIGHT, DEFAULT_INVOKE_TX_MAX_N_STEPS, + DEFAULT_VALIDATE_MAX_N_STEPS, + }, + }, + execution::TransactionExecutionInfo, + services::api::contract_classes::compiled_class::CompiledClass, + state::{ + cached_state::CachedState, + contract_class_cache::{ContractClassCache, PermanentContractClassCache}, + state_api::StateReader, + state_cache::StorageEntry, + BlockInfo, + }, + transaction::{ + declare_tx_from_sn_api_transaction, error::TransactionError, Address, ClassHash, + DeployAccount, InvokeFunction, L1Handler, + }, +}; + +use crate::{ + rpc_state::{ + BlockValue, RpcBlockInfo, RpcChain, RpcState, RpcTransactionReceipt, TransactionTrace, + }, + rpc_state_errors::RpcStateError, +}; + +#[derive(Debug)] +pub struct RpcStateReader(pub RpcState); + +impl RpcStateReader { + pub fn new(state: RpcState) -> Self { + Self(state) + } +} + +impl StateReader for RpcStateReader { + fn get_contract_class(&self, class_hash: &ClassHash) -> Result { + let hash = SNClassHash(StarkHash::new(class_hash.0).unwrap()); + let contract_class = self + .0 + .get_contract_class(&hash) + .ok_or(StateError::MissingCasmClass(*class_hash))?; + Ok(CompiledClass::from(contract_class)) + } + + fn get_class_hash_at(&self, contract_address: &Address) -> Result { + let address = ContractAddress( + PatriciaKey::try_from( + StarkHash::new(contract_address.clone().0.to_bytes_be()).unwrap(), + ) + .unwrap(), + ); + let mut bytes = [0u8; 32]; + bytes.copy_from_slice(self.0.get_class_hash_at(&address).0.bytes()); + Ok(ClassHash(bytes)) + } + + fn get_nonce_at(&self, contract_address: &Address) -> Result { + let address = ContractAddress( + PatriciaKey::try_from( + StarkHash::new(contract_address.clone().0.to_bytes_be()).unwrap(), + ) + .unwrap(), + ); + let nonce = self.0.get_nonce_at(&address); + Ok(Felt252::from_bytes_be_slice(nonce.bytes())) + } + + fn get_storage_at(&self, storage_entry: &StorageEntry) -> Result { + let (contract_address, key) = storage_entry; + let address = ContractAddress( + PatriciaKey::try_from( + StarkHash::new(contract_address.clone().0.to_bytes_be()).unwrap(), + ) + .unwrap(), + ); + let key = StorageKey(PatriciaKey::try_from(StarkHash::new(*key).unwrap()).unwrap()); + let value = self.0.get_storage_at(&address, &key); + Ok(Felt252::from_bytes_be_slice(value.bytes())) + } + + fn get_compiled_class_hash(&self, class_hash: &ClassHash) -> Result { + Ok(*class_hash) + } +} + +pub fn execute_tx_configurable( + tx_hash: &str, + network: RpcChain, + block_number: BlockNumber, + skip_validate: bool, + skip_nonce_check: bool, +) -> Result< + ( + TransactionExecutionInfo, + TransactionTrace, + RpcTransactionReceipt, + ), + TransactionError, +> { + let rpc_reader = RpcStateReader(RpcState::new_rpc(network, block_number.into()).unwrap()); + let class_cache = PermanentContractClassCache::default(); + let mut state = CachedState::new(Arc::new(rpc_reader), Arc::new(class_cache)); + let tx_hash = + TransactionHash(StarkFelt::try_from(tx_hash.strip_prefix("0x").unwrap()).unwrap()); + let tx = state.state_reader.0.get_transaction(&tx_hash).unwrap(); + let gas_price = state.state_reader.0.get_gas_price(block_number.0).unwrap(); + let RpcBlockInfo { + block_timestamp, + sequencer_address, + .. + } = state.state_reader.0.get_block_info().unwrap(); + let sequencer_address = Address(Felt252::from_bytes_be_slice( + sequencer_address.0.key().bytes(), + )); + let block_info = BlockInfo { + block_number: block_number.0, + block_timestamp: block_timestamp.0, + gas_price, + sequencer_address, + }; + let sir_exec_info = execute_tx_configurable_with_state( + &tx_hash, + tx, + network, + block_info, + skip_validate, + skip_nonce_check, + &mut state, + )?; + let trace = state + .state_reader + .0 + .get_transaction_trace(&tx_hash) + .unwrap(); + let receipt = state + .state_reader + .0 + .get_transaction_receipt(&tx_hash) + .unwrap(); + Ok((sir_exec_info, trace, receipt)) +} + +pub fn execute_tx_configurable_with_state( + tx_hash: &TransactionHash, + tx: SNTransaction, + network: RpcChain, + block_info: BlockInfo, + skip_validate: bool, + skip_nonce_check: bool, + state: &mut CachedState, +) -> Result { + let fee_token_address = FeeTokenAddresses::new( + Address( + Felt252::from_hex("049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7") + .unwrap(), + ), + Address::default(), + ); + + // Get values for block context before giving ownership of the reader + let chain_id = match state.state_reader.0.chain { + RpcChain::MainNet => StarknetChainId::MainNet, + RpcChain::TestNet => StarknetChainId::TestNet, + RpcChain::TestNet2 => StarknetChainId::TestNet2, + }; + let starknet_os_config = StarknetOsConfig::new( + chain_id.to_felt(), + fee_token_address, + block_info.gas_price.clone(), + ); + + // Get transaction before giving ownership of the reader + let tx = match tx { + SNTransaction::Invoke(tx) => InvokeFunction::from_invoke_transaction( + tx, + Felt252::from_bytes_be_slice(tx_hash.0.bytes()), + ) + .unwrap() + .create_for_simulation(skip_validate, false, false, false, skip_nonce_check), + SNTransaction::DeployAccount(tx) => DeployAccount::from_sn_api_transaction( + tx, + Felt252::from_bytes_be_slice(tx_hash.0.bytes()), + ) + .unwrap() + .create_for_simulation(skip_validate, false, false, false, skip_nonce_check), + SNTransaction::Declare(tx) => { + // Try to fetch contract class from cache + let class_hash = ClassHash(tx.class_hash().0.bytes().try_into().unwrap()); + let contract_class = if let Ok(contract_class) = state.get_contract_class(&class_hash) { + contract_class + } else { + // Fetch the contract_class from the next block (as we don't have it in the previous one) + let next_block_state_reader = RpcStateReader( + RpcState::new_rpc(network, BlockNumber(block_info.block_number).next().into()) + .unwrap(), + ); + + let contract_class = next_block_state_reader + .get_contract_class(&class_hash) + .unwrap(); + + // Manually add the contract class to the cache so we don't need to fetch it when benchmarking (replay crate) + state + .contract_class_cache_mut() + .set_contract_class(class_hash, contract_class.clone()); + contract_class + }; + + let declare = declare_tx_from_sn_api_transaction( + tx, + Felt252::from_bytes_be_slice(tx_hash.0.bytes()), + contract_class, + )?; + declare.create_for_simulation(skip_validate, false, false, false, skip_nonce_check) + } + SNTransaction::L1Handler(tx) => L1Handler::from_sn_api_tx( + tx, + Felt252::from_bytes_be_slice(tx_hash.0.bytes()), + Some(Felt252::from(u128::MAX)), + ) + .unwrap() + .create_for_simulation(skip_validate, false), + SNTransaction::Deploy(_) => unimplemented!(), + }; + + let block_context = BlockContext::new( + starknet_os_config, + DEFAULT_CONTRACT_STORAGE_COMMITMENT_TREE_HEIGHT, + DEFAULT_GLOBAL_STATE_COMMITMENT_TREE_HEIGHT, + DEFAULT_CAIRO_RESOURCE_FEE_WEIGHTS.clone(), + DEFAULT_INVOKE_TX_MAX_N_STEPS, + DEFAULT_VALIDATE_MAX_N_STEPS, + block_info, + Default::default(), + true, + ); + + #[cfg(not(feature = "cairo-native"))] + let sir_execution = tx.execute(state, &block_context, u128::MAX)?; + #[cfg(feature = "cairo-native")] + let sir_execution = tx.execute(state, &block_context, u128::MAX, None)?; + + Ok(sir_execution) +} + +pub fn execute_tx( + tx_hash: &str, + network: RpcChain, + block_number: BlockNumber, +) -> Result< + ( + TransactionExecutionInfo, + TransactionTrace, + RpcTransactionReceipt, + ), + TransactionError, +> { + execute_tx_configurable(tx_hash, network, block_number, false, false) +} + +pub fn execute_tx_without_validate( + tx_hash: &str, + network: RpcChain, + block_number: BlockNumber, +) -> Result< + ( + TransactionExecutionInfo, + TransactionTrace, + RpcTransactionReceipt, + ), + TransactionError, +> { + execute_tx_configurable(tx_hash, network, block_number, true, true) +} + +pub fn get_transaction_hashes( + block_number: BlockNumber, + network: RpcChain, +) -> Result, RpcStateError> { + let rpc_state = RpcState::new_rpc(network, BlockValue::Number(block_number))?; + rpc_state.get_transaction_hashes() +} diff --git a/rpc-state-reader/src/utils.rs b/rpc-state-reader/src/utils.rs new file mode 100644 index 0000000..ced0663 --- /dev/null +++ b/rpc-state-reader/src/utils.rs @@ -0,0 +1,121 @@ +use std::{ + collections::HashMap, + io::{self, Read}, +}; + +use cairo_lang_starknet::contract_class::ContractEntryPoints; +use cairo_lang_utils::bigint::BigUintAsHex; +use serde::Deserialize; +use starknet::core::types::{LegacyContractEntryPoint, LegacyEntryPointsByType}; +use starknet_api::{ + core::EntryPointSelector, + deprecated_contract_class::{EntryPoint, EntryPointOffset, EntryPointType}, + hash::{StarkFelt, StarkHash}, + transaction::{DeclareTransaction, DeployAccountTransaction, InvokeTransaction, Transaction}, +}; + +#[derive(Debug, Deserialize)] +pub struct MiddleSierraContractClass { + pub sierra_program: Vec, + pub contract_class_version: String, + pub entry_points_by_type: ContractEntryPoints, +} + +pub fn map_entry_points_by_type_legacy( + entry_points_by_type: LegacyEntryPointsByType, +) -> HashMap> { + let entry_types_to_points = HashMap::from([ + ( + EntryPointType::Constructor, + entry_points_by_type.constructor, + ), + (EntryPointType::External, entry_points_by_type.external), + (EntryPointType::L1Handler, entry_points_by_type.l1_handler), + ]); + + let to_contract_entry_point = |entrypoint: &LegacyContractEntryPoint| -> EntryPoint { + let felt: StarkFelt = StarkHash::new(entrypoint.selector.to_bytes_be()).unwrap(); + EntryPoint { + offset: EntryPointOffset(entrypoint.offset as usize), + selector: EntryPointSelector(felt), + } + }; + + let mut entry_points_by_type_map = HashMap::new(); + for (entry_point_type, entry_points) in entry_types_to_points.into_iter() { + let values = entry_points + .iter() + .map(to_contract_entry_point) + .collect::>(); + entry_points_by_type_map.insert(entry_point_type, values); + } + + entry_points_by_type_map +} + +/// Uncompresses a Gz Encoded vector of bytes and returns a string or error +/// Here &[u8] implements BufRead +pub fn decode_reader(bytes: Vec) -> io::Result { + use flate2::bufread; + let mut gz = bufread::GzDecoder::new(&bytes[..]); + let mut s = String::new(); + gz.read_to_string(&mut s)?; + Ok(s) +} + +/// Freestanding deserialize method to avoid a new type. +pub fn deserialize_transaction_json( + transaction: serde_json::Value, +) -> serde_json::Result { + let tx_type: String = serde_json::from_value(transaction["type"].clone())?; + let tx_version: String = serde_json::from_value(transaction["version"].clone())?; + + match tx_type.as_str() { + "INVOKE" => match tx_version.as_str() { + "0x0" => Ok(Transaction::Invoke(InvokeTransaction::V0( + serde_json::from_value(transaction)?, + ))), + "0x1" => Ok(Transaction::Invoke(InvokeTransaction::V1( + serde_json::from_value(transaction)?, + ))), + "0x3" => Ok(Transaction::Invoke(InvokeTransaction::V3( + serde_json::from_value(transaction)?, + ))), + x => Err(serde::de::Error::custom(format!( + "unimplemented invoke version: {x}" + ))), + }, + "DEPLOY_ACCOUNT" => match tx_version.as_str() { + "0x1" => Ok(Transaction::DeployAccount(DeployAccountTransaction::V1( + serde_json::from_value(transaction)?, + ))), + "0x3" => Ok(Transaction::DeployAccount(DeployAccountTransaction::V3( + serde_json::from_value(transaction)?, + ))), + x => Err(serde::de::Error::custom(format!( + "unimplemented declare version: {x}" + ))), + }, + "DECLARE" => match tx_version.as_str() { + "0x0" => Ok(Transaction::Declare(DeclareTransaction::V0( + serde_json::from_value(transaction)?, + ))), + "0x1" => Ok(Transaction::Declare(DeclareTransaction::V1( + serde_json::from_value(transaction)?, + ))), + "0x2" => Ok(Transaction::Declare(DeclareTransaction::V2( + serde_json::from_value(transaction)?, + ))), + "0x3" => Ok(Transaction::Declare(DeclareTransaction::V3( + serde_json::from_value(transaction)?, + ))), + x => Err(serde::de::Error::custom(format!( + "unimplemented declare version: {x}" + ))), + }, + "L1_HANDLER" => Ok(Transaction::L1Handler(serde_json::from_value(transaction)?)), + x => Err(serde::de::Error::custom(format!( + "unimplemented transaction type deserialization: {x}" + ))), + } +} diff --git a/rpc-state-reader/tests/blockifier_tests.rs b/rpc-state-reader/tests/blockifier_tests.rs new file mode 100644 index 0000000..30b86b8 --- /dev/null +++ b/rpc-state-reader/tests/blockifier_tests.rs @@ -0,0 +1,628 @@ +use blockifier::{ + block_context::{BlockContext, FeeTokenAddresses, GasPrices}, + execution::{ + call_info::CallInfo, + contract_class::{ + ContractClass as BlockifierContractClass, ContractClassV0, ContractClassV0Inner, + }, + }, + state::{ + cached_state::{CachedState, GlobalContractCache}, + errors::StateError, + state_api::{StateReader, StateResult}, + }, + transaction::{ + account_transaction::AccountTransaction, + objects::TransactionExecutionInfo, + transactions::{ + DeclareTransaction, DeployAccountTransaction, ExecutableTransaction, InvokeTransaction, + L1HandlerTransaction, + }, + }, +}; +use cairo_lang_starknet::{ + casm_contract_class::CasmContractClass, contract_class::ContractClass as SierraContractClass, +}; +use cairo_vm_blockifier::types::program::Program; +use pretty_assertions_sorted::assert_eq; +use rpc_state_reader::rpc_state::*; +use rpc_state_reader::utils; +use starknet::core::types::ContractClass as SNContractClass; +use starknet_api::{ + block::BlockNumber, + contract_address, + core::{ + calculate_contract_address, ClassHash, CompiledClassHash, ContractAddress, Nonce, + PatriciaKey, + }, + hash::{StarkFelt, StarkHash}, + patricia_key, stark_felt, + state::StorageKey, + transaction::{Transaction as SNTransaction, TransactionHash}, +}; +use std::{collections::HashMap, sync::Arc}; +use test_case::test_case; + +pub struct RpcStateReader(RpcState); + +impl StateReader for RpcStateReader { + fn get_storage_at( + &mut self, + contract_address: starknet_api::core::ContractAddress, + key: StorageKey, + ) -> StateResult { + Ok(self.0.get_storage_at(&contract_address, &key)) + } + + fn get_nonce_at(&mut self, contract_address: ContractAddress) -> StateResult { + Ok(Nonce(self.0.get_nonce_at(&contract_address))) + } + + fn get_class_hash_at(&mut self, contract_address: ContractAddress) -> StateResult { + Ok(self.0.get_class_hash_at(&contract_address)) + } + + /// Returns the contract class of the given class hash. + fn get_compiled_contract_class( + &mut self, + class_hash: &ClassHash, + ) -> StateResult { + Ok(match self.0.get_contract_class(class_hash) { + Some(SNContractClass::Legacy(compressed_legacy_cc)) => { + let as_str = utils::decode_reader(compressed_legacy_cc.program).unwrap(); + let program = Program::from_bytes(as_str.as_bytes(), None).unwrap(); + let entry_points_by_type = utils::map_entry_points_by_type_legacy( + compressed_legacy_cc.entry_points_by_type, + ); + let inner = Arc::new(ContractClassV0Inner { + program, + entry_points_by_type, + }); + BlockifierContractClass::V0(ContractClassV0(inner)) + } + Some(SNContractClass::Sierra(flattened_sierra_cc)) => { + let middle_sierra: utils::MiddleSierraContractClass = { + let v = serde_json::to_value(flattened_sierra_cc).unwrap(); + serde_json::from_value(v).unwrap() + }; + let sierra_cc = SierraContractClass { + sierra_program: middle_sierra.sierra_program, + contract_class_version: middle_sierra.contract_class_version, + entry_points_by_type: middle_sierra.entry_points_by_type, + sierra_program_debug_info: None, + abi: None, + }; + let casm_cc = CasmContractClass::from_contract_class(sierra_cc, false).unwrap(); + BlockifierContractClass::V1(casm_cc.try_into().unwrap()) + } + None => return Err(StateError::UndeclaredClassHash(*class_hash)), + }) + } + + /// Returns the compiled class hash of the given class hash. + fn get_compiled_class_hash(&mut self, class_hash: ClassHash) -> StateResult { + Ok(CompiledClassHash( + self.0 + .get_class_hash_at(&ContractAddress(class_hash.0.try_into().unwrap())) + .0, + )) + } +} + +pub fn execute_tx( + tx_hash: &str, + network: RpcChain, + block_number: BlockNumber, +) -> ( + TransactionExecutionInfo, + TransactionTrace, + RpcTransactionReceipt, +) { + let tx_hash = tx_hash.strip_prefix("0x").unwrap(); + + // Instantiate the RPC StateReader and the CachedState + let rpc_reader = RpcStateReader(RpcState::new_rpc(network, block_number.into()).unwrap()); + let gas_price = rpc_reader.0.get_gas_price(block_number.0).unwrap(); + + // Get values for block context before giving ownership of the reader + let chain_id = rpc_reader.0.get_chain_name(); + let RpcBlockInfo { + block_number, + block_timestamp, + sequencer_address, + .. + } = rpc_reader.0.get_block_info().unwrap(); + + // Get transaction before giving ownership of the reader + let tx_hash = TransactionHash(stark_felt!(tx_hash)); + let sn_api_tx = rpc_reader.0.get_transaction(&tx_hash); + + let trace = rpc_reader.0.get_transaction_trace(&tx_hash).unwrap(); + let receipt = rpc_reader.0.get_transaction_receipt(&tx_hash).unwrap(); + + // Create state from RPC reader + let global_cache = GlobalContractCache::default(); + let mut state = CachedState::new(rpc_reader, global_cache); + + let fee_token_address = + contract_address!("049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"); + + const N_STEPS_FEE_WEIGHT: f64 = 0.01; + let vm_resource_fee_cost = Arc::new(HashMap::from([ + ("n_steps".to_string(), N_STEPS_FEE_WEIGHT), + ("output_builtin".to_string(), 0.0), + ("pedersen_builtin".to_string(), N_STEPS_FEE_WEIGHT * 32.0), + ("range_check_builtin".to_string(), N_STEPS_FEE_WEIGHT * 16.0), + ("ecdsa_builtin".to_string(), N_STEPS_FEE_WEIGHT * 2048.0), + ("bitwise_builtin".to_string(), N_STEPS_FEE_WEIGHT * 64.0), + ("ec_op_builtin".to_string(), N_STEPS_FEE_WEIGHT * 1024.0), + ("poseidon_builtin".to_string(), N_STEPS_FEE_WEIGHT * 32.0), + ( + "segment_arena_builtin".to_string(), + N_STEPS_FEE_WEIGHT * 10.0, + ), + ("keccak_builtin".to_string(), N_STEPS_FEE_WEIGHT * 2048.0), // 2**11 + ])); + + let block_context = BlockContext { + chain_id, + block_number, + block_timestamp, + sequencer_address, + // TODO: Add strk token address when updated + fee_token_addresses: FeeTokenAddresses { + strk_fee_token_address: fee_token_address, + eth_fee_token_address: fee_token_address, + }, + vm_resource_fee_cost, + // TODO: Add strk l1 gas price when updated + gas_prices: GasPrices { + eth_l1_gas_price: gas_price.eth_l1_gas_price, + strk_l1_gas_price: gas_price.strk_l1_gas_price, + }, + invoke_tx_max_n_steps: 1_000_000, + validate_max_n_steps: 1_000_000, + max_recursion_depth: 500, + }; + + // Map starknet_api transaction to blockifier's + let blockifier_tx = match sn_api_tx.unwrap() { + SNTransaction::Invoke(tx) => { + let invoke = InvokeTransaction { + tx, + tx_hash, + only_query: false, + }; + AccountTransaction::Invoke(invoke) + } + SNTransaction::DeployAccount(tx) => { + let contract_address = calculate_contract_address( + tx.contract_address_salt(), + tx.class_hash(), + &tx.constructor_calldata(), + ContractAddress::default(), + ) + .unwrap(); + AccountTransaction::DeployAccount(DeployAccountTransaction { + only_query: false, + tx, + tx_hash, + contract_address, + }) + } + SNTransaction::Declare(tx) => { + // Fetch the contract_class from the next block (as we don't have it in the previous one) + let mut next_block_state_reader = + RpcStateReader(RpcState::new_rpc(network, (block_number.next()).into()).unwrap()); + let contract_class = next_block_state_reader + .get_compiled_contract_class(&tx.class_hash()) + .unwrap(); + + let declare = DeclareTransaction::new(tx, tx_hash, contract_class).unwrap(); + AccountTransaction::Declare(declare) + } + SNTransaction::L1Handler(tx) => { + // As L1Hanlder is not an account transaction we execute it here and return the result + let blockifier_tx = L1HandlerTransaction { + tx, + tx_hash, + paid_fee_on_l1: starknet_api::transaction::Fee(u128::MAX), + }; + return ( + blockifier_tx + .execute(&mut state, &block_context, true, true) + .unwrap(), + trace, + receipt, + ); + } + _ => unimplemented!(), + }; + + ( + blockifier_tx + .execute(&mut state, &block_context, true, true) + .unwrap(), + trace, + receipt, + ) +} + +#[test] +fn test_get_gas_price() { + let block = BlockValue::Number(BlockNumber(169928)); + let rpc_state = RpcState::new_rpc(RpcChain::MainNet, block).unwrap(); + + let price = rpc_state.get_gas_price(169928).unwrap(); + assert_eq!(price.eth_l1_gas_price, 22804578690); +} + +#[test] +#[ignore = "Current blockifier version is not currently in production, no recent tx available for testing"] +fn blockifier_test_recent_tx() { + let (tx_info, trace, receipt) = execute_tx( + "0x05d200ef175ba15d676a68b36f7a7b72c17c17604eda4c1efc2ed5e4973e2c91", + RpcChain::MainNet, + BlockNumber(169928), + ); + + let TransactionExecutionInfo { + execute_call_info, + actual_fee, + .. + } = tx_info; + + let CallInfo { + vm_resources, + inner_calls, + .. + } = execute_call_info.unwrap(); + + assert_eq!(actual_fee.0, receipt.actual_fee.amount); + assert_eq!( + vm_resources.n_memory_holes, + receipt.execution_resources.n_memory_holes + ); + assert_eq!(vm_resources.n_steps, receipt.execution_resources.n_steps); + assert_eq!( + vm_resources.builtin_instance_counter, + receipt.execution_resources.builtin_instance_counter + ); + assert_eq!( + inner_calls.len(), + trace + .execute_invocation + .as_ref() + .unwrap() + .internal_calls + .len() + ); +} + +#[test_case( + "0x014640564509873cf9d24a311e1207040c8b60efd38d96caef79855f0b0075d5", + 90006, + RpcChain::MainNet + => ignore["old transaction, gas mismatch"] +)] +#[test_case( + "0x025844447697eb7d5df4d8268b23aef6c11de4087936048278c2559fc35549eb", + 197000, + RpcChain::MainNet +)] +#[test_case( + "0x00164bfc80755f62de97ae7c98c9d67c1767259427bcf4ccfcc9683d44d54676", + 197000, + RpcChain::MainNet +)] +#[test_case( + "0x05d200ef175ba15d676a68b36f7a7b72c17c17604eda4c1efc2ed5e4973e2c91", + 169928, // real block 169929 + RpcChain::MainNet +)] +#[test_case( + "0x0528ec457cf8757f3eefdf3f0728ed09feeecc50fd97b1e4c5da94e27e9aa1d6", + 169928, // real block 169929 + RpcChain::MainNet +)] +#[test_case( + "0x0737677385a30ec4cbf9f6d23e74479926975b74db3d55dc5e46f4f8efee41cf", + 169928, // real block 169929 + RpcChain::MainNet + => ignore["resource mismatch"] +)] +#[test_case( + "0x026c17728b9cd08a061b1f17f08034eb70df58c1a96421e73ee6738ad258a94c", + 169928, // real block 169929 + RpcChain::MainNet +)] +#[test_case( + // review later + "0x0743092843086fa6d7f4a296a226ee23766b8acf16728aef7195ce5414dc4d84", + 186548, // real block 186549 + RpcChain::MainNet + => ignore["resource mismatch"] +)] +#[test_case( + "0x00724fc4a84f489ed032ebccebfc9541eb8dc64b0e76b933ed6fc30cd6000bd1", + 186551, // real block 186552 + RpcChain::MainNet +)] +#[test_case( + "0x04db9b88e07340d18d53b8b876f28f449f77526224afb372daaf1023c8b08036", + 398051, // real block 398052 + RpcChain::MainNet +)] +#[test_case( + "0x5a5de1f42f6005f3511ea6099daed9bcbcf9de334ee714e8563977e25f71601", + 281513, // real block 281514 + RpcChain::MainNet +)] +#[test_case( + "0x26be3e906db66973de1ca5eec1ddb4f30e3087dbdce9560778937071c3d3a83", + 351268, // real block 351269 + RpcChain::MainNet +)] +#[test_case( + "0x4f552c9430bd21ad300db56c8f4cae45d554a18fac20bf1703f180fac587d7e", + 351225, // real block 351226 + RpcChain::MainNet +)] +// DeployAccount for different account providers: + +// OpenZeppelin (v0.7.0) +#[test_case( + "0x04df8a364233d995c33c7f4666a776bf458631bec2633e932b433a783db410f8", + 422881, // real block 422882 + RpcChain::MainNet +)] +// Argent X (v5.7.0) +#[test_case( + "0x039683c034f8e67cfb4af6e3109cefb3c170ee15ceacf07ee2d926915c4620e5", + 475945, // real block 475946 + RpcChain::MainNet +)] +fn blockifier_test_case_tx(hash: &str, block_number: u64, chain: RpcChain) { + let (tx_info, trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)); + let TransactionExecutionInfo { + execute_call_info, + actual_fee, + .. + } = tx_info; + + let CallInfo { + vm_resources, + inner_calls, + .. + } = execute_call_info.unwrap(); + + let actual_fee = actual_fee.0; + if receipt.actual_fee.amount != actual_fee { + let diff = 100 * receipt.actual_fee.amount.abs_diff(actual_fee) / receipt.actual_fee.amount; + + if diff >= 35 { + assert_eq!( + actual_fee, receipt.actual_fee.amount, + "actual_fee mismatch differs from the baseline by more than 35% ({diff}%)", + ); + } + } + + assert_eq!( + vm_resources.n_memory_holes, + receipt.execution_resources.n_memory_holes + ); + assert_eq!(vm_resources.n_steps, receipt.execution_resources.n_steps); + assert_eq!( + vm_resources.builtin_instance_counter, + receipt.execution_resources.builtin_instance_counter + ); + + assert_eq!( + inner_calls.len(), + trace + .execute_invocation + .as_ref() + .unwrap() + .internal_calls + .len() + ); +} + +#[test_case( + "0x00b6d59c19d5178886b4c939656167db0660fe325345138025a3cc4175b21897", + 200303, // real block 200304 + RpcChain::MainNet => ignore["Doesn't revert in newest blockifier version"] + )] +#[test_case( + "0x02b28b4846a756e0cec6385d6d13f811e745a88c7e75a3ebc5fead5b4af152a3", + 200302, // real block 200304 + RpcChain::MainNet + => ignore["broken on both due to a cairo-vm error"] +)] +fn blockifier_test_case_reverted_tx(hash: &str, block_number: u64, chain: RpcChain) { + let (tx_info, trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)); + + assert_eq!( + tx_info.revert_error.is_some(), + trace.execute_invocation.unwrap().revert_reason.is_some() + ); + + let diff = + 100 * receipt.actual_fee.amount.abs_diff(tx_info.actual_fee.0) / receipt.actual_fee.amount; + + if diff >= 5 { + assert_eq!( + tx_info.actual_fee.0, receipt.actual_fee.amount, + "actual_fee mismatch differs from the baseline by more than 5% ({diff}%)", + ); + } +} + +#[test_case( + // Declare tx + "0x60506c49e65d84e2cdd0e9142dc43832a0a59cb6a9cbcce1ab4f57c20ba4afb", + 347899, // real block 347900 + RpcChain::MainNet +)] +#[test_case( + // Declare tx + "0x1088aa18785779e1e8eef406dc495654ad42a9729b57969ad0dbf2189c40bee", + 271887, // real block 271888 + RpcChain::MainNet +)] +fn blockifier_test_case_declare_tx(hash: &str, block_number: u64, chain: RpcChain) { + let (tx_info, _trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)); + let TransactionExecutionInfo { + execute_call_info, + actual_fee, + .. + } = tx_info; + + assert!(execute_call_info.is_none()); + + let actual_fee = actual_fee.0; + if receipt.actual_fee.amount != actual_fee { + let diff = 100 * receipt.actual_fee.amount.abs_diff(actual_fee) / receipt.actual_fee.amount; + + if diff >= 35 { + assert_eq!( + actual_fee, receipt.actual_fee.amount, + "actual_fee mismatch differs from the baseline by more than 35% ({diff}%)", + ); + } + } +} + +// Tests comparing SIR vs Blockifier execution results +// As the blockifier version used can vary from tx to tx depending on when it was executed, we can not expect to get the same result as the network +// In order to have more exact tests we compare sir results to those obtained from the blockifier version sir is compatible with +#[test_case( + "0x014640564509873cf9d24a311e1207040c8b60efd38d96caef79855f0b0075d5", + 90006, + RpcChain::MainNet +)] +#[test_case( + "0x025844447697eb7d5df4d8268b23aef6c11de4087936048278c2559fc35549eb", + 197000, + RpcChain::MainNet +)] +#[test_case( + "0x00164bfc80755f62de97ae7c98c9d67c1767259427bcf4ccfcc9683d44d54676", + 197000, + RpcChain::MainNet +)] +#[test_case( + "0x05d200ef175ba15d676a68b36f7a7b72c17c17604eda4c1efc2ed5e4973e2c91", + 169928, // real block 169929 + RpcChain::MainNet + )] +#[test_case( + "0x0528ec457cf8757f3eefdf3f0728ed09feeecc50fd97b1e4c5da94e27e9aa1d6", + 169928, // real block 169929 + RpcChain::MainNet + )] +#[test_case( + "0x0737677385a30ec4cbf9f6d23e74479926975b74db3d55dc5e46f4f8efee41cf", + 169928, // real block 169929 + RpcChain::MainNet + )] +#[test_case( + "0x026c17728b9cd08a061b1f17f08034eb70df58c1a96421e73ee6738ad258a94c", + 169928, // real block 169929 + RpcChain::MainNet + )] +#[test_case( + // review later + "0x0743092843086fa6d7f4a296a226ee23766b8acf16728aef7195ce5414dc4d84", + 186548, // real block 186549 + RpcChain::MainNet + )] +#[test_case( + // fails in blockifier + "0x00724fc4a84f489ed032ebccebfc9541eb8dc64b0e76b933ed6fc30cd6000bd1", + 186551, // real block 186552 + RpcChain::MainNet + )] +#[test_case( + "0x176a92e8df0128d47f24eebc17174363457a956fa233cc6a7f8561bfbd5023a", + 317092, // real block 317093 + RpcChain::MainNet +)] +#[test_case( + "0x04db9b88e07340d18d53b8b876f28f449f77526224afb372daaf1023c8b08036", + 398051, // real block 398052 + RpcChain::MainNet +)] +#[test_case( + "0x5a5de1f42f6005f3511ea6099daed9bcbcf9de334ee714e8563977e25f71601", + 281513, // real block 281514 + RpcChain::MainNet +)] +#[test_case( + "0x26be3e906db66973de1ca5eec1ddb4f30e3087dbdce9560778937071c3d3a83", + 351268, // real block 351269 + RpcChain::MainNet +)] +#[test_case( + "0x4f552c9430bd21ad300db56c8f4cae45d554a18fac20bf1703f180fac587d7e", + 351225, // real block 351226 + RpcChain::MainNet +)] +// DeployAccount for different account providers: + +// OpenZeppelin (v0.7.0) +#[test_case( + "0x04df8a364233d995c33c7f4666a776bf458631bec2633e932b433a783db410f8", + 422881, // real block 422882 + RpcChain::MainNet +)] +// Argent X (v5.7.0) +#[test_case( + "0x039683c034f8e67cfb4af6e3109cefb3c170ee15ceacf07ee2d926915c4620e5", + 475945, // real block 475946 + RpcChain::MainNet +)] +#[cfg(not(feature = "cairo-native"))] +fn starknet_in_rust_vs_blockifier_tx(hash: &str, block_number: u64, chain: RpcChain) { + // Execute using sir + let (sir_tx_info, _, _) = + rpc_state_reader::execute_tx(hash, chain, BlockNumber(block_number)).unwrap(); + // Execute using blockifier + let (blockifier_tx_info, _, _) = execute_tx(hash, chain, BlockNumber(block_number)); + + let (sir_fee, sir_resources) = { + let starknet_in_rust::execution::TransactionExecutionInfo { + actual_fee, + call_info, + .. + } = sir_tx_info; + let starknet_in_rust::execution::CallInfo { + execution_resources, + .. + } = call_info.unwrap(); + (actual_fee, execution_resources.unwrap()) + }; + + let (blockifier_fee, blockifier_resources) = { + let TransactionExecutionInfo { + actual_fee, + execute_call_info, + .. + } = blockifier_tx_info; + let CallInfo { vm_resources, .. } = execute_call_info.unwrap(); + (actual_fee.0, vm_resources) + }; + + // Compare sir vs blockifier fee & resources + assert_eq!(sir_fee, blockifier_fee); + assert_eq!(sir_resources.n_steps, blockifier_resources.n_steps); + assert_eq!( + sir_resources.n_memory_holes, + blockifier_resources.n_memory_holes + ); + assert_eq!( + sir_resources.builtin_instance_counter, + blockifier_resources.builtin_instance_counter + ); +} diff --git a/rpc-state-reader/tests/sir_tests.rs b/rpc-state-reader/tests/sir_tests.rs new file mode 100644 index 0000000..b833900 --- /dev/null +++ b/rpc-state-reader/tests/sir_tests.rs @@ -0,0 +1,403 @@ +#![cfg(feature = "starknet_in_rust")] + +use cairo_vm::Felt252; +use pretty_assertions_sorted::{assert_eq, assert_eq_sorted}; +use rpc_state_reader::{ + execute_tx, execute_tx_configurable, execute_tx_without_validate, rpc_state::*, +}; +use starknet_api::{ + block::BlockNumber, + hash::StarkFelt, + stark_felt, + transaction::{Transaction as SNTransaction, TransactionHash}, +}; +use starknet_in_rust::{ + execution::{CallInfo, TransactionExecutionInfo}, + transaction::InvokeFunction, +}; +use test_case::test_case; + +#[test] +fn test_get_transaction_try_from() { + let rpc_state = RpcState::new_rpc(RpcChain::MainNet, BlockTag::Latest.into()).unwrap(); + let str_hash = stark_felt!("0x5d200ef175ba15d676a68b36f7a7b72c17c17604eda4c1efc2ed5e4973e2c91"); + let tx_hash = TransactionHash(str_hash); + + let sn_tx = rpc_state.get_transaction(&tx_hash).unwrap(); + match &sn_tx { + SNTransaction::Invoke(sn_tx) => { + let tx = InvokeFunction::from_invoke_transaction( + sn_tx.clone(), + Felt252::from_bytes_be_slice(tx_hash.0.bytes()), + ) + .unwrap(); + assert_eq!(tx.hash_value().to_bytes_be().as_slice(), str_hash.bytes()) + } + _ => unimplemented!(), + }; +} + +#[test] +fn test_get_gas_price() { + let block = BlockValue::Number(BlockNumber(169928)); + let rpc_state = RpcState::new_rpc(RpcChain::MainNet, block).unwrap(); + + let price = rpc_state.get_gas_price(169928).unwrap(); + assert_eq!(price.eth_l1_gas_price, 22804578690); +} + +#[test_case( + "0x014640564509873cf9d24a311e1207040c8b60efd38d96caef79855f0b0075d5", + 90006, + RpcChain::MainNet + => ignore["old transaction, gas mismatch"] +)] +#[test_case( + "0x025844447697eb7d5df4d8268b23aef6c11de4087936048278c2559fc35549eb", + 197000, + RpcChain::MainNet +)] +#[test_case( + "0x00164bfc80755f62de97ae7c98c9d67c1767259427bcf4ccfcc9683d44d54676", + 197000, + RpcChain::MainNet +)] +#[test_case( + "0x05d200ef175ba15d676a68b36f7a7b72c17c17604eda4c1efc2ed5e4973e2c91", + 169928, // real block 169929 + RpcChain::MainNet + )] +#[test_case( + "0x0528ec457cf8757f3eefdf3f0728ed09feeecc50fd97b1e4c5da94e27e9aa1d6", + 169928, // real block 169929 + RpcChain::MainNet + )] +#[test_case( + "0x0737677385a30ec4cbf9f6d23e74479926975b74db3d55dc5e46f4f8efee41cf", + 169928, // real block 169929 + RpcChain::MainNet + => ignore["resource mismatch"] + )] +#[test_case( + "0x026c17728b9cd08a061b1f17f08034eb70df58c1a96421e73ee6738ad258a94c", + 169928, // real block 169929 + RpcChain::MainNet + )] +#[test_case( + // review later + "0x0743092843086fa6d7f4a296a226ee23766b8acf16728aef7195ce5414dc4d84", + 186548, // real block 186549 + RpcChain::MainNet + => ignore["resource mismatch"] + )] +#[test_case( + // fails in blockifier + "0x00724fc4a84f489ed032ebccebfc9541eb8dc64b0e76b933ed6fc30cd6000bd1", + 186551, // real block 186552 + RpcChain::MainNet + )] +#[test_case( + "0x176a92e8df0128d47f24eebc17174363457a956fa233cc6a7f8561bfbd5023a", + 317092, // real block 317093 + RpcChain::MainNet +)] +#[test_case( + "0x04db9b88e07340d18d53b8b876f28f449f77526224afb372daaf1023c8b08036", + 398051, // real block 398052 + RpcChain::MainNet +)] +#[test_case( + "0x5a5de1f42f6005f3511ea6099daed9bcbcf9de334ee714e8563977e25f71601", + 281513, // real block 281514 + RpcChain::MainNet +)] +#[test_case( + "0x26be3e906db66973de1ca5eec1ddb4f30e3087dbdce9560778937071c3d3a83", + 351268, // real block 351269 + RpcChain::MainNet +)] +#[test_case( + "0x4f552c9430bd21ad300db56c8f4cae45d554a18fac20bf1703f180fac587d7e", + 351225, // real block 351226 + RpcChain::MainNet +)] +// DeployAccount for different account providers: + +// OpenZeppelin (v0.7.0) +#[test_case( + "0x04df8a364233d995c33c7f4666a776bf458631bec2633e932b433a783db410f8", + 422881, // real block 422882 + RpcChain::MainNet +)] +// Argent X (v5.7.0) +#[test_case( + "0x039683c034f8e67cfb4af6e3109cefb3c170ee15ceacf07ee2d926915c4620e5", + 475945, // real block 475946 + RpcChain::MainNet +)] +fn starknet_in_rust_test_case_tx(hash: &str, block_number: u64, chain: RpcChain) { + let (tx_info, trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)).unwrap(); + + let TransactionExecutionInfo { + call_info, + actual_fee, + .. + } = tx_info; + #[cfg_attr(feature = "cairo-native", allow(unused_variables))] + let CallInfo { + execution_resources, + internal_calls, + .. + } = call_info.unwrap(); + + // check Cairo VM execution resources + #[cfg(not(feature = "cairo-native"))] + assert_eq_sorted!( + execution_resources.as_ref(), + Some(&receipt.execution_resources), + "execution resources mismatch" + ); + + // check amount of internal calls + assert_eq!( + internal_calls.len(), + trace + .execute_invocation + .as_ref() + .unwrap() + .internal_calls + .len(), + "internal calls length mismatch" + ); + + // check actual fee calculation + if receipt.actual_fee.amount != actual_fee { + let diff = 100 * receipt.actual_fee.amount.abs_diff(actual_fee) / receipt.actual_fee.amount; + + if diff >= 35 { + assert_eq!( + actual_fee, receipt.actual_fee.amount, + "actual_fee mismatch differs from the baseline by more than 5% ({diff}%)", + ); + } + } +} + +#[test_case( + "0x05b4665a81d89d00e529d2e298fce6606750c4f67faf43aafc893c0fc0f9d425", + RpcChain::MainNet, + 222090, + 4 +)] +#[test_case( + "0x01e91fa12be4424264c8cad29f481a67d5d8e23f7abf94add734d64b91c90021", + RpcChain::MainNet, + 219797, + 7 +)] +#[test_case( + "0x03ec45f8369513b0f48db25f2cf18c70c50e7d3119505ab15e39ae4ca2eb06cf", + RpcChain::MainNet, + 219764, + 7 +)] +#[test_case( + "0x00164bfc80755f62de97ae7c98c9d67c1767259427bcf4ccfcc9683d44d54676", + RpcChain::MainNet, + 197000, + 3 +)] +fn test_sorted_events( + tx_hash: &str, + chain: RpcChain, + block_number: u64, + expected_amount_of_events: usize, +) { + let (tx_info, _trace, _receipt) = + execute_tx(tx_hash, chain, BlockNumber(block_number)).unwrap(); + + let events_len = tx_info.get_sorted_events().unwrap().len(); + + assert_eq!(expected_amount_of_events, events_len); +} + +#[test_case( + "0x00b6d59c19d5178886b4c939656167db0660fe325345138025a3cc4175b21897", + 200303, // real block 200304 + RpcChain::MainNet => ignore["Old tx"] +)] +#[test_case( + "0x02b28b4846a756e0cec6385d6d13f811e745a88c7e75a3ebc5fead5b4af152a3", + 200302, // real block 200304 + RpcChain::MainNet + => ignore["broken on both due to a cairo-vm error"] +)] +// Insufficient fee token balance +#[test_case( + "0x006978ae71587d4ab1048d7836c2d656222a16976c82c0dc24d3b44316d63cfe", + 440823, // real block 440824 + RpcChain::MainNet +)] +// Insufficient fee token balance +#[test_case( + "0x03e458ef06c17dd2601013746ae5622d8434348b246a335b20b6543f37aff0f8", + 440849, // real block 440850 + RpcChain::MainNet +)] +fn starknet_in_rust_test_case_reverted_tx(hash: &str, block_number: u64, chain: RpcChain) { + let (tx_info, trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)).unwrap(); + + assert_eq!( + tx_info.revert_error.is_some(), + trace.execute_invocation.unwrap().revert_reason.is_some() + ); + + let diff = + 100 * receipt.actual_fee.amount.abs_diff(tx_info.actual_fee) / receipt.actual_fee.amount; + + if diff >= 35 { + assert_eq!( + tx_info.actual_fee, receipt.actual_fee.amount, + "actual_fee mismatch differs from the baseline by more than 5% ({diff}%)", + ); + } +} + +#[test_case( + "0x038c307a0a324dc92778820f2c6317f40157c06b12a7e537f7a16b2c015f64e7", + 274333-1, + RpcChain::MainNet => ignore["Old tx"] +)] +fn test_validate_fee(hash: &str, block_number: u64, chain: RpcChain) { + let (tx_info, _trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)).unwrap(); + let (tx_info_without_fee, _trace, _receipt) = + execute_tx_without_validate(hash, chain, BlockNumber(block_number)).unwrap(); + + assert_eq!(tx_info.actual_fee, receipt.actual_fee.amount); + assert!(tx_info_without_fee.actual_fee < tx_info.actual_fee); +} + +#[test_case( + // Declare tx + "0x60506c49e65d84e2cdd0e9142dc43832a0a59cb6a9cbcce1ab4f57c20ba4afb", + 347899, // real block 347900 + RpcChain::MainNet +)] +#[test_case( + // Declare tx + "0x1088aa18785779e1e8eef406dc495654ad42a9729b57969ad0dbf2189c40bee", + 271887, // real block 271888 + RpcChain::MainNet +)] +fn starknet_in_rust_test_case_declare_tx(hash: &str, block_number: u64, chain: RpcChain) { + let (tx_info, _trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)).unwrap(); + let TransactionExecutionInfo { + call_info, + actual_fee, + .. + } = tx_info; + + assert!(call_info.is_none()); + + if receipt.actual_fee.amount != actual_fee { + let diff = 100 * receipt.actual_fee.amount.abs_diff(actual_fee) / receipt.actual_fee.amount; + + if diff >= 35 { + assert_eq!( + actual_fee, receipt.actual_fee.amount, + "actual_fee mismatch differs from the baseline by more than 5% ({diff}%)", + ); + } + } +} + +#[test_case( + "0x0200b493df8310215b188343f227dd1894c9edda597465cb336d25610172c701", + 470061, // real block 470062 + RpcChain::MainNet +)] +fn starknet_in_rust_test_case_tx_skip_nonce_check(hash: &str, block_number: u64, chain: RpcChain) { + let (tx_info, trace, receipt) = + execute_tx_configurable(hash, chain, BlockNumber(block_number), false, true).unwrap(); + + let TransactionExecutionInfo { + call_info, + actual_fee, + .. + } = tx_info; + let CallInfo { + execution_resources, + internal_calls, + .. + } = call_info.unwrap(); + + // check Cairo VM execution resources + assert_eq_sorted!( + execution_resources.as_ref(), + Some(&receipt.execution_resources), + "execution resources mismatch" + ); + + // check amount of internal calls + assert_eq!( + internal_calls.len(), + trace + .execute_invocation + .as_ref() + .unwrap() + .internal_calls + .len(), + "internal calls length mismatch" + ); + + // check actual fee calculation + if receipt.actual_fee.amount != actual_fee { + let diff = 100 * receipt.actual_fee.amount.abs_diff(actual_fee) / receipt.actual_fee.amount; + + if diff >= 35 { + assert_eq!( + actual_fee, receipt.actual_fee.amount, + "actual_fee mismatch differs from the baseline by more than 5% ({diff}%)", + ); + } + } +} + +#[test_case( + "0x05ee0cd7be18a4f8a2d6845a9960c0573318393122fe392c5d156eb460beff21", + 422346, // real block 422347 + RpcChain::MainNet +)] +fn starknet_in_rust_check_fee_and_retdata(hash: &str, block_number: u64, chain: RpcChain) { + let (tx_info, trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)).unwrap(); + + let TransactionExecutionInfo { + call_info, + actual_fee, + .. + } = tx_info; + let CallInfo { retdata, .. } = call_info.unwrap(); + + // check actual fee calculation + if receipt.actual_fee.amount != actual_fee { + let diff = 100 * receipt.actual_fee.amount.abs_diff(actual_fee) / receipt.actual_fee.amount; + + if diff >= 35 { + assert_eq!( + actual_fee, receipt.actual_fee.amount, + "actual_fee mismatch differs from the baseline by more than 5% ({diff}%)", + ); + } + } + + let rpc_retdata: Vec = trace + .execute_invocation + .unwrap() + .retdata + .unwrap() + .into_iter() + .map(|sf| Felt252::from_bytes_be_slice(sf.bytes())) + .collect(); + + assert_eq!(retdata, rpc_retdata); +} From c21024d069e2197347be22d6a71a28a4ed4af730 Mon Sep 17 00:00:00 2001 From: Pedro Fontana Date: Tue, 4 Jun 2024 17:58:46 -0300 Subject: [PATCH 2/6] Remove starknet_in_rust deps && implement blockifier_state_reader --- Cargo.lock | 1295 +---------------- rpc-state-reader/Cargo.toml | 7 - .../blockifier_state_reader.rs} | 458 +++--- rpc-state-reader/src/lib.rs | 30 +- rpc-state-reader/src/rpc_state.rs | 19 +- rpc-state-reader/src/sir_state_reader.rs | 299 ---- rpc-state-reader/tests/sir_tests.rs | 403 ----- 7 files changed, 261 insertions(+), 2250 deletions(-) rename rpc-state-reader/{tests/blockifier_tests.rs => src/blockifier_state_reader.rs} (65%) delete mode 100644 rpc-state-reader/src/sir_state_reader.rs delete mode 100644 rpc-state-reader/tests/sir_tests.rs diff --git a/Cargo.lock b/Cargo.lock index e600838..2dc8031 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,55 +81,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anstream" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" - -[[package]] -name = "anstyle-parse" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - [[package]] name = "anyhow" version = "1.0.86" @@ -328,12 +279,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - [[package]] name = "base64" version = "0.13.1" @@ -352,12 +297,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - [[package]] name = "bigdecimal" version = "0.3.1" @@ -370,15 +309,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - [[package]] name = "bincode" version = "2.0.0-rc.3" @@ -388,52 +318,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bindgen" -version = "0.66.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" -dependencies = [ - "bitflags 2.5.0", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "log", - "peeking_take_while", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.66", - "which", -] - -[[package]] -name = "bindgen" -version = "0.69.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" -dependencies = [ - "bitflags 2.5.0", - "cexpr", - "clang-sys", - "itertools 0.12.1", - "lazy_static", - "lazycell", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.66", - "which", -] - [[package]] name = "bit-set" version = "0.5.3" @@ -498,7 +382,7 @@ dependencies = [ "cairo-lang-runner", "cairo-lang-starknet", "cairo-lang-utils", - "cairo-vm 0.9.2", + "cairo-vm", "ctor", "derive_more", "indexmap 2.2.6", @@ -544,27 +428,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - [[package]] name = "cached" version = "0.44.0" @@ -820,7 +683,7 @@ dependencies = [ "cairo-lang-sierra-type-size", "cairo-lang-starknet", "cairo-lang-utils", - "cairo-vm 0.9.2", + "cairo-vm", "itertools 0.11.0", "keccak", "num-bigint", @@ -1030,33 +893,6 @@ dependencies = [ "xshell", ] -[[package]] -name = "cairo-lang-test-plugin" -version = "2.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5e416a932754f190de2de011f3b3eb20dcb8093fb073cad15a8e70be833c3d" -dependencies = [ - "anyhow", - "cairo-felt", - "cairo-lang-compiler", - "cairo-lang-debug", - "cairo-lang-defs", - "cairo-lang-diagnostics", - "cairo-lang-filesystem", - "cairo-lang-lowering", - "cairo-lang-semantic", - "cairo-lang-sierra", - "cairo-lang-sierra-generator", - "cairo-lang-starknet", - "cairo-lang-syntax", - "cairo-lang-utils", - "indoc", - "itertools 0.11.0", - "num-bigint", - "num-traits 0.2.19", - "serde", -] - [[package]] name = "cairo-lang-utils" version = "2.5.4" @@ -1072,63 +908,6 @@ dependencies = [ "serde", ] -[[package]] -name = "cairo-native" -version = "0.1.0" -source = "git+https://github.com/lambdaclass/cairo_native?rev=baf57d2dde0036ac4848fc40c672826fb7ffcde4#baf57d2dde0036ac4848fc40c672826fb7ffcde4" -dependencies = [ - "anyhow", - "bumpalo", - "cairo-felt", - "cairo-lang-compiler", - "cairo-lang-defs", - "cairo-lang-diagnostics", - "cairo-lang-filesystem", - "cairo-lang-lowering", - "cairo-lang-runner", - "cairo-lang-semantic", - "cairo-lang-sierra", - "cairo-lang-sierra-ap-change", - "cairo-lang-sierra-gas", - "cairo-lang-sierra-generator", - "cairo-lang-starknet", - "cairo-lang-test-plugin", - "cairo-lang-utils", - "cairo-native-runtime", - "cc", - "clap", - "colored", - "educe", - "id-arena", - "itertools 0.12.1", - "lazy_static", - "libc", - "libloading", - "llvm-sys", - "melior", - "mlir-sys", - "num-bigint", - "num-traits 0.2.19", - "starknet-types-core", - "tempfile", - "thiserror", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "cairo-native-runtime" -version = "0.1.0" -source = "git+https://github.com/lambdaclass/cairo_native?rev=baf57d2dde0036ac4848fc40c672826fb7ffcde4#baf57d2dde0036ac4848fc40c672826fb7ffcde4" -dependencies = [ - "cairo-lang-runner", - "lazy_static", - "libc", - "starknet-crypto 0.6.2", - "starknet-curve 0.4.2", - "starknet-types-core", -] - [[package]] name = "cairo-vm" version = "0.9.2" @@ -1136,7 +915,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd569684da80d747273613d5c809e4f81bf6f6b1b64d0301b12bac8f2fb8ffb1" dependencies = [ "anyhow", - "bincode 2.0.0-rc.3", + "bincode", "bitvec", "cairo-felt", "generic-array", @@ -1160,59 +939,11 @@ dependencies = [ "thiserror-no-std", ] -[[package]] -name = "cairo-vm" -version = "1.0.0-rc1" -source = "git+https://github.com/lambdaclass/cairo-vm?rev=3547089579dd74f815edbc2d1caa91e00fc8a2f7#3547089579dd74f815edbc2d1caa91e00fc8a2f7" -dependencies = [ - "anyhow", - "ark-ff", - "ark-std", - "bincode 2.0.0-rc.3", - "bitvec", - "cairo-lang-casm", - "cairo-lang-starknet", - "generic-array", - "hashbrown 0.14.5", - "hex", - "keccak", - "lazy_static", - "mimalloc", - "nom", - "num-bigint", - "num-integer", - "num-prime", - "num-traits 0.2.19", - "rand", - "serde", - "serde_json", - "sha2", - "sha3", - "starknet-crypto 0.6.2", - "starknet-types-core", - "thiserror-no-std", - "zip", -] - [[package]] name = "cc" version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" -dependencies = [ - "jobserver", - "libc", - "once_cell", -] - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] [[package]] name = "cfg-if" @@ -1243,64 +974,6 @@ dependencies = [ "inout", ] -[[package]] -name = "clang-sys" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "clap" -version = "4.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim 0.11.1", - "terminal_size", -] - -[[package]] -name = "clap_derive" -version = "4.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "clap_lex" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" - -[[package]] -name = "colorchoice" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" - [[package]] name = "colored" version = "2.1.0" @@ -1311,38 +984,12 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "comrak" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0436149c9f6a1935b13306206c739b1ba84fa81f551b5eb87fc2ca7a13700af" -dependencies = [ - "clap", - "derive_builder", - "entities", - "memchr", - "once_cell", - "regex", - "shell-words", - "slug", - "syntect", - "typed-arena", - "unicode_categories", - "xdg", -] - [[package]] name = "const-fnv1a-hash" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32b13ea120a812beba79e34316b3942a857c86ec1593cb34f27bb28272ce2cca" -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - [[package]] name = "const_format" version = "0.2.32" @@ -1363,12 +1010,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "convert_case" version = "0.4.0" @@ -1437,7 +1078,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", "subtle", "zeroize", ] @@ -1553,30 +1193,6 @@ dependencies = [ "ordered-float", ] -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core 0.9.10", -] - -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - [[package]] name = "deranged" version = "0.3.11" @@ -1598,37 +1214,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive_builder" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" -dependencies = [ - "darling 0.14.4", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_macro" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" -dependencies = [ - "derive_builder_core", - "syn 1.0.109", -] - [[package]] name = "derive_more" version = "0.99.17" @@ -1642,12 +1227,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "deunicode" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339544cc9e2c4dc3fc7149fd630c5f22263a4fdf18a98afd0075784968b5cf00" - [[package]] name = "diff" version = "0.1.13" @@ -1661,7 +1240,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", - "const-oid", "crypto-common", "subtle", ] @@ -1699,58 +1277,12 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" -[[package]] -name = "ecdsa" -version = "0.16.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" -dependencies = [ - "der", - "digest", - "elliptic-curve", - "rfc6979", - "signature", - "spki", -] - -[[package]] -name = "educe" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4bd92664bf78c4d3dba9b7cdafce6fa15b13ed3ed16175218196942e99168a8" -dependencies = [ - "enum-ordinalize", - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "either" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest", - "ff", - "generic-array", - "group", - "pem-rfc7468", - "pkcs8", - "rand_core", - "sec1", - "subtle", - "zeroize", -] - [[package]] name = "ena" version = "0.14.3" @@ -1769,48 +1301,12 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "entities" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca" - -[[package]] -name = "enum-ordinalize" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" -dependencies = [ - "enum-ordinalize-derive", -] - -[[package]] -name = "enum-ordinalize-derive" -version = "4.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "eth-keystore" version = "0.5.0" @@ -1860,32 +1356,6 @@ dependencies = [ "uint", ] -[[package]] -name = "fancy-regex" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" -dependencies = [ - "bit-set", - "regex", -] - -[[package]] -name = "fastrand" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" - -[[package]] -name = "ff" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" -dependencies = [ - "rand_core", - "subtle", -] - [[package]] name = "fixed-hash" version = "0.8.0" @@ -2026,7 +1496,6 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", - "zeroize", ] [[package]] @@ -2042,30 +1511,12 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "getset" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "gimli" version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - [[package]] name = "good_lp" version = "1.8.1" @@ -2076,17 +1527,6 @@ dependencies = [ "minilp", ] -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core", - "subtle", -] - [[package]] name = "h2" version = "0.3.26" @@ -2150,12 +1590,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - [[package]] name = "hex" version = "0.4.3" @@ -2171,15 +1605,6 @@ dependencies = [ "digest", ] -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "html-escape" version = "0.2.13" @@ -2402,12 +1827,6 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" -[[package]] -name = "is_terminal_polyfill" -version = "1.70.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" - [[package]] name = "itertools" version = "0.10.5" @@ -2426,30 +1845,12 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" -[[package]] -name = "jobserver" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" version = "0.3.69" @@ -2459,20 +1860,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "k256" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" -dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "once_cell", - "sha2", - "signature", -] - [[package]] name = "keccak" version = "0.1.5" @@ -2496,7 +1883,7 @@ dependencies = [ "petgraph", "pico-args", "regex", - "regex-syntax 0.8.3", + "regex-syntax", "string_cache", "term", "tiny-keccak", @@ -2510,29 +1897,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" dependencies = [ - "regex-automata 0.4.6", -] - -[[package]] -name = "lambdaworks-crypto" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d4c222d5b2fdc0faf702d3ab361d14589b097f40eac9dc550e27083483edc65" -dependencies = [ - "lambdaworks-math", - "serde", - "sha2", - "sha3", -] - -[[package]] -name = "lambdaworks-math" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ee7dcab3968c71896b8ee4dc829147acc918cffe897af6265b1894527fe3add" -dependencies = [ - "serde", - "serde_json", + "regex-automata", ] [[package]] @@ -2544,28 +1909,12 @@ dependencies = [ "spin 0.5.2", ] -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - [[package]] name = "libmimalloc-sys" version = "0.1.38" @@ -2586,38 +1935,6 @@ dependencies = [ "libc", ] -[[package]] -name = "line-wrap" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd1bc4d24ad230d21fb898d1116b1801d7adfc449d42026475862ab48b11e70e" - -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "llvm-sys" -version = "170.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed90f72df5504c0af2e3a08ee7762a4a3e42ec2605811fc19f64879de40c50a" -dependencies = [ - "anyhow", - "cc", - "lazy_static", - "libc", - "regex-lite", - "semver", -] - [[package]] name = "lock_api" version = "0.4.12" @@ -2652,15 +1969,6 @@ dependencies = [ "hashbrown 0.14.5", ] -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - [[package]] name = "matrixmultiply" version = "0.2.4" @@ -2670,35 +1978,6 @@ dependencies = [ "rawpointer", ] -[[package]] -name = "melior" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e76dd7ff903474595023aebb93f8287667a2fe95132c65e1c77efdb99c64a973" -dependencies = [ - "dashmap", - "melior-macro", - "mlir-sys", - "once_cell", -] - -[[package]] -name = "melior-macro" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fc9d57809ee6146f482b68555a605df4d5b018c5d5377d08a6aa99006f389" -dependencies = [ - "comrak", - "convert_case 0.6.0", - "once_cell", - "proc-macro2", - "quote", - "regex", - "syn 2.0.66", - "tblgen", - "unindent", -] - [[package]] name = "memchr" version = "2.7.2" @@ -2779,15 +2058,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "mlir-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1b5806a63bc959cd5c4e5db8cadd20e40045d41969d325132748db8af11b7f" -dependencies = [ - "bindgen 0.69.4", -] - [[package]] name = "ndarray" version = "0.13.1" @@ -2817,16 +2087,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - [[package]] name = "num-bigint" version = "0.4.5" @@ -2924,28 +2184,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "onig" -version = "6.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f" -dependencies = [ - "bitflags 1.3.2", - "libc", - "once_cell", - "onig_sys", -] - -[[package]] -name = "onig_sys" -version = "69.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b829e3d7e9cc74c7e315ee8edb185bf4190da5acde74afd7fc59c35b1f086e7" -dependencies = [ - "cc", - "pkg-config", -] - [[package]] name = "oorandom" version = "11.1.3" @@ -2961,24 +2199,6 @@ dependencies = [ "num-traits 0.2.19", ] -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "p256" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" -dependencies = [ - "ecdsa", - "elliptic-curve", - "primeorder", - "sha2", -] - [[package]] name = "parity-scale-codec" version = "3.6.5" @@ -3053,17 +2273,6 @@ dependencies = [ "windows-targets 0.52.5", ] -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core", - "subtle", -] - [[package]] name = "paste" version = "1.0.15" @@ -3083,24 +2292,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest", - "hmac", - "password-hash", - "sha2", -] - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - -[[package]] -name = "pem-rfc7468" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" -dependencies = [ - "base64ct", ] [[package]] @@ -3188,36 +2379,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - -[[package]] -name = "plist" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9d34169e64b3c7a80c8621a48adaf44e0cf62c78a9b25dd9dd35f1881a17cf9" -dependencies = [ - "base64 0.21.7", - "indexmap 2.2.6", - "line-wrap", - "quick-xml", - "serde", - "time", -] - [[package]] name = "powerfmt" version = "0.2.0" @@ -3256,25 +2417,6 @@ dependencies = [ "pretty_assertions", ] -[[package]] -name = "prettyplease" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" -dependencies = [ - "proc-macro2", - "syn 2.0.66", -] - -[[package]] -name = "primeorder" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" -dependencies = [ - "elliptic-curve", -] - [[package]] name = "primitive-types" version = "0.12.2" @@ -3298,46 +2440,13 @@ dependencies = [ "toml_edit 0.19.15", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quick-xml" -version = "0.31.0" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ - "memchr", + "unicode-ident", ] [[package]] @@ -3428,17 +2537,8 @@ checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", + "regex-automata", + "regex-syntax", ] [[package]] @@ -3449,21 +2549,9 @@ checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax", ] -[[package]] -name = "regex-lite" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b661b2f27137bdbc16f00eda72866a92bb28af1753ffbd56744fb6e2e9cd8e" - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - [[package]] name = "regex-syntax" version = "0.8.3" @@ -3563,8 +2651,7 @@ dependencies = [ "blockifier", "cairo-lang-starknet", "cairo-lang-utils", - "cairo-vm 0.9.2", - "cairo-vm 1.0.0-rc1", + "cairo-vm", "dotenv", "flate2", "pretty_assertions_sorted", @@ -3573,7 +2660,6 @@ dependencies = [ "serde_with 3.8.1", "starknet", "starknet_api", - "starknet_in_rust", "test-case", "thiserror", "ureq", @@ -3606,19 +2692,6 @@ dependencies = [ "semver", ] -[[package]] -name = "rustix" -version = "0.38.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags 2.5.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - [[package]] name = "rustls" version = "0.21.12" @@ -3793,20 +2866,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", -] - [[package]] name = "semver" version = "1.0.23" @@ -3945,17 +3004,6 @@ dependencies = [ "syn 2.0.66", ] -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sha2" version = "0.10.8" @@ -3977,37 +3025,6 @@ dependencies = [ "keccak", ] -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "shell-words" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest", - "rand_core", -] - [[package]] name = "siphasher" version = "0.3.11" @@ -4023,16 +3040,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "slug" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd94acec9c8da640005f8e135a39fc0372e74535e6b368b7a04b875f784c8c4" -dependencies = [ - "deunicode", - "wasm-bindgen", -] - [[package]] name = "smallvec" version = "1.13.2" @@ -4070,16 +3077,6 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - [[package]] name = "sprs" version = "0.7.1" @@ -4302,22 +3299,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "starknet-types-core" -version = "0.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d53160556d1f23425100f42b3230df747ea05763efee685a2cd939dfb640701" -dependencies = [ - "bitvec", - "lambdaworks-crypto", - "lambdaworks-math", - "lazy_static", - "num-bigint", - "num-integer", - "num-traits 0.2.19", - "serde", -] - [[package]] name = "starknet_api" version = "0.7.0-dev.0" @@ -4340,43 +3321,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "starknet_in_rust" -version = "0.4.0" -source = "git+https://github.com/lambdaclass/starknet_in_rust?rev=99c7b3b29a78cf8a27cc61bcdc029ed4255817ad#99c7b3b29a78cf8a27cc61bcdc029ed4255817ad" -dependencies = [ - "anyhow", - "base64 0.21.7", - "cairo-lang-casm", - "cairo-lang-sierra", - "cairo-lang-starknet", - "cairo-lang-utils", - "cairo-native", - "cairo-vm 1.0.0-rc1", - "flate2", - "getset", - "hex", - "k256", - "keccak", - "lazy_static", - "mimalloc", - "num-bigint", - "num-integer", - "num-traits 0.2.19", - "once_cell", - "p256", - "sec1", - "serde", - "serde_json", - "serde_json_pythonic", - "sha3", - "starknet", - "starknet-crypto 0.6.2", - "starknet_api", - "thiserror", - "tracing", -] - [[package]] name = "static_assertions" version = "1.1.0" @@ -4461,29 +3405,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" -[[package]] -name = "syntect" -version = "5.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1" -dependencies = [ - "bincode 1.3.3", - "bitflags 1.3.2", - "fancy-regex", - "flate2", - "fnv", - "once_cell", - "onig", - "plist", - "regex-syntax 0.8.3", - "serde", - "serde_derive", - "serde_json", - "thiserror", - "walkdir", - "yaml-rust", -] - [[package]] name = "system-configuration" version = "0.5.1" @@ -4511,30 +3432,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" -[[package]] -name = "tblgen" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d19c09266feb8b16718d1183044d14703a0b4b59e55ce8beb4d6e21dd066b1b" -dependencies = [ - "bindgen 0.66.1", - "cc", - "paste", - "thiserror", -] - -[[package]] -name = "tempfile" -version = "3.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" -dependencies = [ - "cfg-if", - "fastrand", - "rustix", - "windows-sys 0.52.0", -] - [[package]] name = "term" version = "0.7.0" @@ -4546,16 +3443,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "terminal_size" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" -dependencies = [ - "rustix", - "windows-sys 0.48.0", -] - [[package]] name = "test-case" version = "3.3.1" @@ -4629,16 +3516,6 @@ dependencies = [ "thiserror-impl-no-std", ] -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - [[package]] name = "time" version = "0.3.36" @@ -4803,21 +3680,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "pin-project-lite", - "tracing-attributes", "tracing-core", ] -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "tracing-core" version = "0.1.32" @@ -4825,36 +3690,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", ] [[package]] @@ -4863,12 +3698,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "typed-arena" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" - [[package]] name = "typenum" version = "1.17.0" @@ -4929,18 +3758,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "unicode_categories" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" - -[[package]] -name = "unindent" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" - [[package]] name = "untrusted" version = "0.9.0" @@ -4983,12 +3800,6 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" -[[package]] -name = "utf8parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - [[package]] name = "uuid" version = "0.8.2" @@ -4999,12 +3810,6 @@ dependencies = [ "serde", ] -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - [[package]] name = "version_check" version = "0.9.4" @@ -5127,18 +3932,6 @@ dependencies = [ "rustls-pki-types", ] -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - [[package]] name = "winapi" version = "0.3.9" @@ -5355,12 +4148,6 @@ dependencies = [ "tap", ] -[[package]] -name = "xdg" -version = "2.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546" - [[package]] name = "xshell" version = "0.2.6" @@ -5376,15 +4163,6 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d422e8e38ec76e2f06ee439ccc765e9c6a9638b9e7c9f2e8255e4d41e8bd852" -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "yansi" version = "0.5.1" @@ -5430,52 +4208,3 @@ dependencies = [ "quote", "syn 2.0.66", ] - -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "aes", - "byteorder", - "bzip2", - "constant_time_eq", - "crc32fast", - "crossbeam-utils", - "flate2", - "hmac", - "pbkdf2", - "sha1", - "time", - "zstd", -] - -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/rpc-state-reader/Cargo.toml b/rpc-state-reader/Cargo.toml index aff9ed1..20856f2 100644 --- a/rpc-state-reader/Cargo.toml +++ b/rpc-state-reader/Cargo.toml @@ -3,11 +3,6 @@ name = "rpc-state-reader" version = "0.1.0" edition = "2021" -[features] -default = ["starknet_in_rust"] -starknet_in_rust = [] -cairo-native = ["starknet_in_rust/cairo-native"] - [dependencies] ureq = { version = "2.7.1", features = ["json"] } serde = { version = "1.0", features = ["derive"] } @@ -23,10 +18,8 @@ thiserror = { workspace = true } flate2 = "1.0.25" serde_with = "3.0.0" dotenv = "0.15.0" -cairo-vm = { git = "https://github.com/lambdaclass/cairo-vm", rev = "3547089579dd74f815edbc2d1caa91e00fc8a2f7", features = ["cairo-1-hints"] } cairo-vm-blockifier = { package = "cairo-vm", version = "0.9.1" } blockifier = "=0.5.0-dev.0" -starknet_in_rust = {git = "https://github.com/lambdaclass/starknet_in_rust", rev = "99c7b3b29a78cf8a27cc61bcdc029ed4255817ad" } [dev-dependencies] pretty_assertions_sorted = "1.2.3" diff --git a/rpc-state-reader/tests/blockifier_tests.rs b/rpc-state-reader/src/blockifier_state_reader.rs similarity index 65% rename from rpc-state-reader/tests/blockifier_tests.rs rename to rpc-state-reader/src/blockifier_state_reader.rs index 30b86b8..6e395f3 100644 --- a/rpc-state-reader/tests/blockifier_tests.rs +++ b/rpc-state-reader/src/blockifier_state_reader.rs @@ -24,9 +24,6 @@ use cairo_lang_starknet::{ casm_contract_class::CasmContractClass, contract_class::ContractClass as SierraContractClass, }; use cairo_vm_blockifier::types::program::Program; -use pretty_assertions_sorted::assert_eq; -use rpc_state_reader::rpc_state::*; -use rpc_state_reader::utils; use starknet::core::types::ContractClass as SNContractClass; use starknet_api::{ block::BlockNumber, @@ -41,10 +38,20 @@ use starknet_api::{ transaction::{Transaction as SNTransaction, TransactionHash}, }; use std::{collections::HashMap, sync::Arc}; -use test_case::test_case; + +use crate::{ + rpc_state::{RpcBlockInfo, RpcChain, RpcState, RpcTransactionReceipt, TransactionTrace}, + utils, +}; pub struct RpcStateReader(RpcState); +impl RpcStateReader { + pub fn new(state: RpcState) -> Self { + Self(state) + } +} + impl StateReader for RpcStateReader { fn get_storage_at( &mut self, @@ -248,381 +255,376 @@ pub fn execute_tx( ) } -#[test] -fn test_get_gas_price() { - let block = BlockValue::Number(BlockNumber(169928)); - let rpc_state = RpcState::new_rpc(RpcChain::MainNet, block).unwrap(); +#[cfg(test)] +mod tests { - let price = rpc_state.get_gas_price(169928).unwrap(); - assert_eq!(price.eth_l1_gas_price, 22804578690); -} + use crate::rpc_state::BlockValue; -#[test] -#[ignore = "Current blockifier version is not currently in production, no recent tx available for testing"] -fn blockifier_test_recent_tx() { - let (tx_info, trace, receipt) = execute_tx( - "0x05d200ef175ba15d676a68b36f7a7b72c17c17604eda4c1efc2ed5e4973e2c91", - RpcChain::MainNet, - BlockNumber(169928), - ); + use super::*; + use test_case::test_case; + #[test] + fn test_get_gas_price() { + let block = BlockValue::Number(BlockNumber(169928)); + let rpc_state = RpcState::new_rpc(RpcChain::MainNet, block).unwrap(); - let TransactionExecutionInfo { - execute_call_info, - actual_fee, - .. - } = tx_info; + let price = rpc_state.get_gas_price(169928).unwrap(); + assert_eq!(price.eth_l1_gas_price, 22804578690); + } - let CallInfo { - vm_resources, - inner_calls, - .. - } = execute_call_info.unwrap(); - - assert_eq!(actual_fee.0, receipt.actual_fee.amount); - assert_eq!( - vm_resources.n_memory_holes, - receipt.execution_resources.n_memory_holes - ); - assert_eq!(vm_resources.n_steps, receipt.execution_resources.n_steps); - assert_eq!( - vm_resources.builtin_instance_counter, - receipt.execution_resources.builtin_instance_counter - ); - assert_eq!( - inner_calls.len(), - trace - .execute_invocation - .as_ref() - .unwrap() - .internal_calls - .len() - ); -} + #[test] + #[ignore = "Current blockifier version is not currently in production, no recent tx available for testing"] + fn blockifier_test_recent_tx() { + let (tx_info, trace, receipt) = execute_tx( + "0x05d200ef175ba15d676a68b36f7a7b72c17c17604eda4c1efc2ed5e4973e2c91", + RpcChain::MainNet, + BlockNumber(169928), + ); + + let TransactionExecutionInfo { + execute_call_info, + actual_fee, + .. + } = tx_info; + + let CallInfo { + vm_resources, + inner_calls, + .. + } = execute_call_info.unwrap(); + + assert_eq!(actual_fee.0, receipt.actual_fee.amount); + assert_eq!( + vm_resources.n_memory_holes, + receipt.execution_resources.n_memory_holes + ); + assert_eq!(vm_resources.n_steps, receipt.execution_resources.n_steps); + assert_eq!( + vm_resources.builtin_instance_counter, + receipt.execution_resources.builtin_instance_counter + ); + assert_eq!( + inner_calls.len(), + trace + .execute_invocation + .as_ref() + .unwrap() + .internal_calls + .len() + ); + } -#[test_case( + #[test_case( "0x014640564509873cf9d24a311e1207040c8b60efd38d96caef79855f0b0075d5", 90006, RpcChain::MainNet => ignore["old transaction, gas mismatch"] )] -#[test_case( - "0x025844447697eb7d5df4d8268b23aef6c11de4087936048278c2559fc35549eb", - 197000, - RpcChain::MainNet -)] -#[test_case( - "0x00164bfc80755f62de97ae7c98c9d67c1767259427bcf4ccfcc9683d44d54676", - 197000, - RpcChain::MainNet -)] -#[test_case( + #[test_case( + "0x025844447697eb7d5df4d8268b23aef6c11de4087936048278c2559fc35549eb", + 197000, + RpcChain::MainNet + )] + #[test_case( + "0x00164bfc80755f62de97ae7c98c9d67c1767259427bcf4ccfcc9683d44d54676", + 197000, + RpcChain::MainNet + )] + #[test_case( "0x05d200ef175ba15d676a68b36f7a7b72c17c17604eda4c1efc2ed5e4973e2c91", 169928, // real block 169929 RpcChain::MainNet )] -#[test_case( + #[test_case( "0x0528ec457cf8757f3eefdf3f0728ed09feeecc50fd97b1e4c5da94e27e9aa1d6", 169928, // real block 169929 RpcChain::MainNet )] -#[test_case( + #[test_case( "0x0737677385a30ec4cbf9f6d23e74479926975b74db3d55dc5e46f4f8efee41cf", 169928, // real block 169929 RpcChain::MainNet => ignore["resource mismatch"] )] -#[test_case( + #[test_case( "0x026c17728b9cd08a061b1f17f08034eb70df58c1a96421e73ee6738ad258a94c", 169928, // real block 169929 RpcChain::MainNet )] -#[test_case( + #[test_case( // review later "0x0743092843086fa6d7f4a296a226ee23766b8acf16728aef7195ce5414dc4d84", 186548, // real block 186549 RpcChain::MainNet => ignore["resource mismatch"] )] -#[test_case( + #[test_case( "0x00724fc4a84f489ed032ebccebfc9541eb8dc64b0e76b933ed6fc30cd6000bd1", 186551, // real block 186552 RpcChain::MainNet )] -#[test_case( + #[test_case( "0x04db9b88e07340d18d53b8b876f28f449f77526224afb372daaf1023c8b08036", 398051, // real block 398052 RpcChain::MainNet )] -#[test_case( + #[test_case( "0x5a5de1f42f6005f3511ea6099daed9bcbcf9de334ee714e8563977e25f71601", 281513, // real block 281514 RpcChain::MainNet )] -#[test_case( + #[test_case( "0x26be3e906db66973de1ca5eec1ddb4f30e3087dbdce9560778937071c3d3a83", 351268, // real block 351269 RpcChain::MainNet )] -#[test_case( + #[test_case( "0x4f552c9430bd21ad300db56c8f4cae45d554a18fac20bf1703f180fac587d7e", 351225, // real block 351226 RpcChain::MainNet )] -// DeployAccount for different account providers: + // DeployAccount for different account providers: -// OpenZeppelin (v0.7.0) -#[test_case( + // OpenZeppelin (v0.7.0) + #[test_case( "0x04df8a364233d995c33c7f4666a776bf458631bec2633e932b433a783db410f8", 422881, // real block 422882 RpcChain::MainNet )] -// Argent X (v5.7.0) -#[test_case( + // Argent X (v5.7.0) + #[test_case( "0x039683c034f8e67cfb4af6e3109cefb3c170ee15ceacf07ee2d926915c4620e5", 475945, // real block 475946 RpcChain::MainNet )] -fn blockifier_test_case_tx(hash: &str, block_number: u64, chain: RpcChain) { - let (tx_info, trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)); - let TransactionExecutionInfo { - execute_call_info, - actual_fee, - .. - } = tx_info; + fn blockifier_test_case_tx(hash: &str, block_number: u64, chain: RpcChain) { + let (tx_info, trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)); + let TransactionExecutionInfo { + execute_call_info, + actual_fee, + .. + } = tx_info; - let CallInfo { - vm_resources, - inner_calls, - .. - } = execute_call_info.unwrap(); + let CallInfo { + vm_resources, + inner_calls, + .. + } = execute_call_info.unwrap(); - let actual_fee = actual_fee.0; - if receipt.actual_fee.amount != actual_fee { - let diff = 100 * receipt.actual_fee.amount.abs_diff(actual_fee) / receipt.actual_fee.amount; + let actual_fee = actual_fee.0; + if receipt.actual_fee.amount != actual_fee { + let diff = + 100 * receipt.actual_fee.amount.abs_diff(actual_fee) / receipt.actual_fee.amount; - if diff >= 35 { - assert_eq!( - actual_fee, receipt.actual_fee.amount, - "actual_fee mismatch differs from the baseline by more than 35% ({diff}%)", - ); + if diff >= 35 { + assert_eq!( + actual_fee, receipt.actual_fee.amount, + "actual_fee mismatch differs from the baseline by more than 35% ({diff}%)", + ); + } } - } - assert_eq!( - vm_resources.n_memory_holes, - receipt.execution_resources.n_memory_holes - ); - assert_eq!(vm_resources.n_steps, receipt.execution_resources.n_steps); - assert_eq!( - vm_resources.builtin_instance_counter, - receipt.execution_resources.builtin_instance_counter - ); - - assert_eq!( - inner_calls.len(), - trace - .execute_invocation - .as_ref() - .unwrap() - .internal_calls - .len() - ); -} + assert_eq!( + vm_resources.n_memory_holes, + receipt.execution_resources.n_memory_holes + ); + assert_eq!(vm_resources.n_steps, receipt.execution_resources.n_steps); + assert_eq!( + vm_resources.builtin_instance_counter, + receipt.execution_resources.builtin_instance_counter + ); -#[test_case( + assert_eq!( + inner_calls.len(), + trace + .execute_invocation + .as_ref() + .unwrap() + .internal_calls + .len() + ); + } + + #[test_case( "0x00b6d59c19d5178886b4c939656167db0660fe325345138025a3cc4175b21897", 200303, // real block 200304 RpcChain::MainNet => ignore["Doesn't revert in newest blockifier version"] )] -#[test_case( + #[test_case( "0x02b28b4846a756e0cec6385d6d13f811e745a88c7e75a3ebc5fead5b4af152a3", 200302, // real block 200304 RpcChain::MainNet => ignore["broken on both due to a cairo-vm error"] )] -fn blockifier_test_case_reverted_tx(hash: &str, block_number: u64, chain: RpcChain) { - let (tx_info, trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)); - - assert_eq!( - tx_info.revert_error.is_some(), - trace.execute_invocation.unwrap().revert_reason.is_some() - ); + fn blockifier_test_case_reverted_tx(hash: &str, block_number: u64, chain: RpcChain) { + let (tx_info, trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)); - let diff = - 100 * receipt.actual_fee.amount.abs_diff(tx_info.actual_fee.0) / receipt.actual_fee.amount; - - if diff >= 5 { assert_eq!( - tx_info.actual_fee.0, receipt.actual_fee.amount, - "actual_fee mismatch differs from the baseline by more than 5% ({diff}%)", + tx_info.revert_error.is_some(), + trace.execute_invocation.unwrap().revert_reason.is_some() ); + + let diff = 100 * receipt.actual_fee.amount.abs_diff(tx_info.actual_fee.0) + / receipt.actual_fee.amount; + + if diff >= 5 { + assert_eq!( + tx_info.actual_fee.0, receipt.actual_fee.amount, + "actual_fee mismatch differs from the baseline by more than 5% ({diff}%)", + ); + } } -} -#[test_case( + #[test_case( // Declare tx "0x60506c49e65d84e2cdd0e9142dc43832a0a59cb6a9cbcce1ab4f57c20ba4afb", 347899, // real block 347900 RpcChain::MainNet )] -#[test_case( + #[test_case( // Declare tx "0x1088aa18785779e1e8eef406dc495654ad42a9729b57969ad0dbf2189c40bee", 271887, // real block 271888 RpcChain::MainNet )] -fn blockifier_test_case_declare_tx(hash: &str, block_number: u64, chain: RpcChain) { - let (tx_info, _trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)); - let TransactionExecutionInfo { - execute_call_info, - actual_fee, - .. - } = tx_info; + fn blockifier_test_case_declare_tx(hash: &str, block_number: u64, chain: RpcChain) { + let (tx_info, _trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)); + let TransactionExecutionInfo { + execute_call_info, + actual_fee, + .. + } = tx_info; - assert!(execute_call_info.is_none()); + assert!(execute_call_info.is_none()); - let actual_fee = actual_fee.0; - if receipt.actual_fee.amount != actual_fee { - let diff = 100 * receipt.actual_fee.amount.abs_diff(actual_fee) / receipt.actual_fee.amount; + let actual_fee = actual_fee.0; + if receipt.actual_fee.amount != actual_fee { + let diff = + 100 * receipt.actual_fee.amount.abs_diff(actual_fee) / receipt.actual_fee.amount; - if diff >= 35 { - assert_eq!( - actual_fee, receipt.actual_fee.amount, - "actual_fee mismatch differs from the baseline by more than 35% ({diff}%)", - ); + if diff >= 35 { + assert_eq!( + actual_fee, receipt.actual_fee.amount, + "actual_fee mismatch differs from the baseline by more than 35% ({diff}%)", + ); + } } } -} -// Tests comparing SIR vs Blockifier execution results -// As the blockifier version used can vary from tx to tx depending on when it was executed, we can not expect to get the same result as the network -// In order to have more exact tests we compare sir results to those obtained from the blockifier version sir is compatible with -#[test_case( - "0x014640564509873cf9d24a311e1207040c8b60efd38d96caef79855f0b0075d5", - 90006, - RpcChain::MainNet -)] -#[test_case( - "0x025844447697eb7d5df4d8268b23aef6c11de4087936048278c2559fc35549eb", - 197000, - RpcChain::MainNet -)] -#[test_case( - "0x00164bfc80755f62de97ae7c98c9d67c1767259427bcf4ccfcc9683d44d54676", - 197000, - RpcChain::MainNet -)] -#[test_case( + // Tests comparing SIR vs Blockifier execution results + // As the blockifier version used can vary from tx to tx depending on when it was executed, we can not expect to get the same result as the network + // In order to have more exact tests we compare sir results to those obtained from the blockifier version sir is compatible with + #[test_case( + "0x014640564509873cf9d24a311e1207040c8b60efd38d96caef79855f0b0075d5", + 90006, + RpcChain::MainNet + )] + #[test_case( + "0x025844447697eb7d5df4d8268b23aef6c11de4087936048278c2559fc35549eb", + 197000, + RpcChain::MainNet + )] + #[test_case( + "0x00164bfc80755f62de97ae7c98c9d67c1767259427bcf4ccfcc9683d44d54676", + 197000, + RpcChain::MainNet + )] + #[test_case( "0x05d200ef175ba15d676a68b36f7a7b72c17c17604eda4c1efc2ed5e4973e2c91", 169928, // real block 169929 RpcChain::MainNet )] -#[test_case( + #[test_case( "0x0528ec457cf8757f3eefdf3f0728ed09feeecc50fd97b1e4c5da94e27e9aa1d6", 169928, // real block 169929 RpcChain::MainNet )] -#[test_case( + #[test_case( "0x0737677385a30ec4cbf9f6d23e74479926975b74db3d55dc5e46f4f8efee41cf", 169928, // real block 169929 RpcChain::MainNet )] -#[test_case( + #[test_case( "0x026c17728b9cd08a061b1f17f08034eb70df58c1a96421e73ee6738ad258a94c", 169928, // real block 169929 RpcChain::MainNet )] -#[test_case( + #[test_case( // review later "0x0743092843086fa6d7f4a296a226ee23766b8acf16728aef7195ce5414dc4d84", 186548, // real block 186549 RpcChain::MainNet )] -#[test_case( + #[test_case( // fails in blockifier "0x00724fc4a84f489ed032ebccebfc9541eb8dc64b0e76b933ed6fc30cd6000bd1", 186551, // real block 186552 RpcChain::MainNet )] -#[test_case( + #[test_case( "0x176a92e8df0128d47f24eebc17174363457a956fa233cc6a7f8561bfbd5023a", 317092, // real block 317093 RpcChain::MainNet )] -#[test_case( + #[test_case( "0x04db9b88e07340d18d53b8b876f28f449f77526224afb372daaf1023c8b08036", 398051, // real block 398052 RpcChain::MainNet )] -#[test_case( + #[test_case( "0x5a5de1f42f6005f3511ea6099daed9bcbcf9de334ee714e8563977e25f71601", 281513, // real block 281514 RpcChain::MainNet )] -#[test_case( + #[test_case( "0x26be3e906db66973de1ca5eec1ddb4f30e3087dbdce9560778937071c3d3a83", 351268, // real block 351269 RpcChain::MainNet )] -#[test_case( + #[test_case( "0x4f552c9430bd21ad300db56c8f4cae45d554a18fac20bf1703f180fac587d7e", 351225, // real block 351226 RpcChain::MainNet )] -// DeployAccount for different account providers: + // DeployAccount for different account providers: -// OpenZeppelin (v0.7.0) -#[test_case( + // OpenZeppelin (v0.7.0) + #[test_case( "0x04df8a364233d995c33c7f4666a776bf458631bec2633e932b433a783db410f8", 422881, // real block 422882 RpcChain::MainNet )] -// Argent X (v5.7.0) -#[test_case( + // Argent X (v5.7.0) + #[test_case( "0x039683c034f8e67cfb4af6e3109cefb3c170ee15ceacf07ee2d926915c4620e5", 475945, // real block 475946 RpcChain::MainNet )] -#[cfg(not(feature = "cairo-native"))] -fn starknet_in_rust_vs_blockifier_tx(hash: &str, block_number: u64, chain: RpcChain) { - // Execute using sir - let (sir_tx_info, _, _) = - rpc_state_reader::execute_tx(hash, chain, BlockNumber(block_number)).unwrap(); - // Execute using blockifier - let (blockifier_tx_info, _, _) = execute_tx(hash, chain, BlockNumber(block_number)); - - let (sir_fee, sir_resources) = { - let starknet_in_rust::execution::TransactionExecutionInfo { - actual_fee, - call_info, - .. - } = sir_tx_info; - let starknet_in_rust::execution::CallInfo { - execution_resources, - .. - } = call_info.unwrap(); - (actual_fee, execution_resources.unwrap()) - }; - - let (blockifier_fee, blockifier_resources) = { - let TransactionExecutionInfo { - actual_fee, - execute_call_info, - .. - } = blockifier_tx_info; - let CallInfo { vm_resources, .. } = execute_call_info.unwrap(); - (actual_fee.0, vm_resources) - }; - - // Compare sir vs blockifier fee & resources - assert_eq!(sir_fee, blockifier_fee); - assert_eq!(sir_resources.n_steps, blockifier_resources.n_steps); - assert_eq!( - sir_resources.n_memory_holes, - blockifier_resources.n_memory_holes - ); - assert_eq!( - sir_resources.builtin_instance_counter, - blockifier_resources.builtin_instance_counter - ); + #[cfg(not(feature = "cairo-native"))] + // todo: check this tests + fn starknet_in_rust_vs_blockifier_tx(hash: &str, block_number: u64, chain: RpcChain) { + // Execute using blockifier + let (blockifier_tx_info, _, _) = execute_tx(hash, chain, BlockNumber(block_number)); + + let (blockifier_fee, blockifier_resources) = { + let TransactionExecutionInfo { + actual_fee, + execute_call_info, + .. + } = blockifier_tx_info; + let CallInfo { vm_resources, .. } = execute_call_info.unwrap(); + (actual_fee.0, vm_resources) + }; + + // // Compare sir vs blockifier fee & resources + // assert_eq!(sir_fee, blockifier_fee); + // assert_eq!(sir_resources.n_steps, blockifier_resources.n_steps); + // assert_eq!( + // sir_resources.n_memory_holes, + // blockifier_resources.n_memory_holes + // ); + // assert_eq!( + // sir_resources.builtin_instance_counter, + // blockifier_resources.builtin_instance_counter + // ); + } } diff --git a/rpc-state-reader/src/lib.rs b/rpc-state-reader/src/lib.rs index 6bf1c3e..331d5d5 100644 --- a/rpc-state-reader/src/lib.rs +++ b/rpc-state-reader/src/lib.rs @@ -2,19 +2,13 @@ pub mod rpc_state; pub mod rpc_state_errors; pub mod utils; -// only export the sir_state_reader module when the starknet_in_rust feature -// is enabled. -#[cfg(feature = "starknet_in_rust")] -mod sir_state_reader; -#[cfg(feature = "starknet_in_rust")] -pub use sir_state_reader::{ - execute_tx, execute_tx_configurable, execute_tx_configurable_with_state, - execute_tx_without_validate, get_transaction_hashes, RpcStateReader, -}; +mod blockifier_state_reader; #[cfg(test)] mod tests { - use cairo_vm::Felt252; + use blockifier::transaction::{ + account_transaction::AccountTransaction, transactions::InvokeTransaction, + }; use pretty_assertions_sorted::{assert_eq, assert_eq_sorted}; use starknet_api::{ class_hash, @@ -24,7 +18,6 @@ mod tests { state::StorageKey, transaction::{Transaction as SNTransaction, TransactionHash}, }; - use starknet_in_rust::transaction::InvokeFunction; use crate::rpc_state::*; @@ -110,13 +103,16 @@ mod tests { let tx = rpc_state.get_transaction(&tx_hash).unwrap(); match tx { - SNTransaction::Invoke(tx) => InvokeFunction::from_invoke_transaction( - tx, - Felt252::from_bytes_be_slice(tx_hash.0.bytes()), - ), + SNTransaction::Invoke(tx) => { + let invoke = InvokeTransaction { + tx, + tx_hash, + only_query: false, + }; + AccountTransaction::Invoke(invoke) + } _ => unreachable!(), - } - .unwrap(); + }; } #[test] diff --git a/rpc-state-reader/src/rpc_state.rs b/rpc-state-reader/src/rpc_state.rs index 30896cb..2e9b54f 100644 --- a/rpc-state-reader/src/rpc_state.rs +++ b/rpc-state-reader/src/rpc_state.rs @@ -1,4 +1,5 @@ -use cairo_vm::vm::runners::{ +use blockifier::block_context::GasPrices; +use cairo_vm_blockifier::vm::runners::{ builtin_runner::{ BITWISE_BUILTIN_NAME, EC_OP_BUILTIN_NAME, HASH_BUILTIN_NAME, KECCAK_BUILTIN_NAME, OUTPUT_BUILTIN_NAME, POSEIDON_BUILTIN_NAME, RANGE_CHECK_BUILTIN_NAME, @@ -18,7 +19,6 @@ use starknet_api::{ state::StorageKey, transaction::{Transaction as SNTransaction, TransactionHash}, }; -use starknet_in_rust::definitions::block_context::{GasPrices, StarknetChainId}; use std::{collections::HashMap, env, fmt::Display}; use crate::{rpc_state_errors::RpcStateError, utils}; @@ -31,16 +31,6 @@ pub enum RpcChain { TestNet2, } -impl From for StarknetChainId { - fn from(network: RpcChain) -> StarknetChainId { - match network { - RpcChain::MainNet => StarknetChainId::MainNet, - RpcChain::TestNet => StarknetChainId::TestNet, - RpcChain::TestNet2 => StarknetChainId::TestNet2, - } - } -} - impl fmt::Display for RpcChain { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { @@ -463,7 +453,10 @@ impl RpcState { ) .map_err(|_| RpcStateError::RpcResponseWrongType("gas_price".to_string()))?; - Ok(GasPrices::new(gas_price_eth, gas_price_strk)) + Ok(GasPrices { + eth_l1_gas_price: gas_price_eth, + strk_l1_gas_price: gas_price_strk, + }) } pub fn get_chain_name(&self) -> ChainId { diff --git a/rpc-state-reader/src/sir_state_reader.rs b/rpc-state-reader/src/sir_state_reader.rs deleted file mode 100644 index 415b019..0000000 --- a/rpc-state-reader/src/sir_state_reader.rs +++ /dev/null @@ -1,299 +0,0 @@ -use std::sync::Arc; - -use cairo_vm::Felt252; -use starknet_api::{ - block::BlockNumber, - core::{ClassHash as SNClassHash, ContractAddress, PatriciaKey}, - hash::{StarkFelt, StarkHash}, - state::StorageKey, - transaction::{Transaction as SNTransaction, TransactionHash}, -}; -use starknet_in_rust::{ - core::errors::state_errors::StateError, - definitions::{ - block_context::{BlockContext, FeeTokenAddresses, StarknetChainId, StarknetOsConfig}, - constants::{ - DEFAULT_CAIRO_RESOURCE_FEE_WEIGHTS, DEFAULT_CONTRACT_STORAGE_COMMITMENT_TREE_HEIGHT, - DEFAULT_GLOBAL_STATE_COMMITMENT_TREE_HEIGHT, DEFAULT_INVOKE_TX_MAX_N_STEPS, - DEFAULT_VALIDATE_MAX_N_STEPS, - }, - }, - execution::TransactionExecutionInfo, - services::api::contract_classes::compiled_class::CompiledClass, - state::{ - cached_state::CachedState, - contract_class_cache::{ContractClassCache, PermanentContractClassCache}, - state_api::StateReader, - state_cache::StorageEntry, - BlockInfo, - }, - transaction::{ - declare_tx_from_sn_api_transaction, error::TransactionError, Address, ClassHash, - DeployAccount, InvokeFunction, L1Handler, - }, -}; - -use crate::{ - rpc_state::{ - BlockValue, RpcBlockInfo, RpcChain, RpcState, RpcTransactionReceipt, TransactionTrace, - }, - rpc_state_errors::RpcStateError, -}; - -#[derive(Debug)] -pub struct RpcStateReader(pub RpcState); - -impl RpcStateReader { - pub fn new(state: RpcState) -> Self { - Self(state) - } -} - -impl StateReader for RpcStateReader { - fn get_contract_class(&self, class_hash: &ClassHash) -> Result { - let hash = SNClassHash(StarkHash::new(class_hash.0).unwrap()); - let contract_class = self - .0 - .get_contract_class(&hash) - .ok_or(StateError::MissingCasmClass(*class_hash))?; - Ok(CompiledClass::from(contract_class)) - } - - fn get_class_hash_at(&self, contract_address: &Address) -> Result { - let address = ContractAddress( - PatriciaKey::try_from( - StarkHash::new(contract_address.clone().0.to_bytes_be()).unwrap(), - ) - .unwrap(), - ); - let mut bytes = [0u8; 32]; - bytes.copy_from_slice(self.0.get_class_hash_at(&address).0.bytes()); - Ok(ClassHash(bytes)) - } - - fn get_nonce_at(&self, contract_address: &Address) -> Result { - let address = ContractAddress( - PatriciaKey::try_from( - StarkHash::new(contract_address.clone().0.to_bytes_be()).unwrap(), - ) - .unwrap(), - ); - let nonce = self.0.get_nonce_at(&address); - Ok(Felt252::from_bytes_be_slice(nonce.bytes())) - } - - fn get_storage_at(&self, storage_entry: &StorageEntry) -> Result { - let (contract_address, key) = storage_entry; - let address = ContractAddress( - PatriciaKey::try_from( - StarkHash::new(contract_address.clone().0.to_bytes_be()).unwrap(), - ) - .unwrap(), - ); - let key = StorageKey(PatriciaKey::try_from(StarkHash::new(*key).unwrap()).unwrap()); - let value = self.0.get_storage_at(&address, &key); - Ok(Felt252::from_bytes_be_slice(value.bytes())) - } - - fn get_compiled_class_hash(&self, class_hash: &ClassHash) -> Result { - Ok(*class_hash) - } -} - -pub fn execute_tx_configurable( - tx_hash: &str, - network: RpcChain, - block_number: BlockNumber, - skip_validate: bool, - skip_nonce_check: bool, -) -> Result< - ( - TransactionExecutionInfo, - TransactionTrace, - RpcTransactionReceipt, - ), - TransactionError, -> { - let rpc_reader = RpcStateReader(RpcState::new_rpc(network, block_number.into()).unwrap()); - let class_cache = PermanentContractClassCache::default(); - let mut state = CachedState::new(Arc::new(rpc_reader), Arc::new(class_cache)); - let tx_hash = - TransactionHash(StarkFelt::try_from(tx_hash.strip_prefix("0x").unwrap()).unwrap()); - let tx = state.state_reader.0.get_transaction(&tx_hash).unwrap(); - let gas_price = state.state_reader.0.get_gas_price(block_number.0).unwrap(); - let RpcBlockInfo { - block_timestamp, - sequencer_address, - .. - } = state.state_reader.0.get_block_info().unwrap(); - let sequencer_address = Address(Felt252::from_bytes_be_slice( - sequencer_address.0.key().bytes(), - )); - let block_info = BlockInfo { - block_number: block_number.0, - block_timestamp: block_timestamp.0, - gas_price, - sequencer_address, - }; - let sir_exec_info = execute_tx_configurable_with_state( - &tx_hash, - tx, - network, - block_info, - skip_validate, - skip_nonce_check, - &mut state, - )?; - let trace = state - .state_reader - .0 - .get_transaction_trace(&tx_hash) - .unwrap(); - let receipt = state - .state_reader - .0 - .get_transaction_receipt(&tx_hash) - .unwrap(); - Ok((sir_exec_info, trace, receipt)) -} - -pub fn execute_tx_configurable_with_state( - tx_hash: &TransactionHash, - tx: SNTransaction, - network: RpcChain, - block_info: BlockInfo, - skip_validate: bool, - skip_nonce_check: bool, - state: &mut CachedState, -) -> Result { - let fee_token_address = FeeTokenAddresses::new( - Address( - Felt252::from_hex("049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7") - .unwrap(), - ), - Address::default(), - ); - - // Get values for block context before giving ownership of the reader - let chain_id = match state.state_reader.0.chain { - RpcChain::MainNet => StarknetChainId::MainNet, - RpcChain::TestNet => StarknetChainId::TestNet, - RpcChain::TestNet2 => StarknetChainId::TestNet2, - }; - let starknet_os_config = StarknetOsConfig::new( - chain_id.to_felt(), - fee_token_address, - block_info.gas_price.clone(), - ); - - // Get transaction before giving ownership of the reader - let tx = match tx { - SNTransaction::Invoke(tx) => InvokeFunction::from_invoke_transaction( - tx, - Felt252::from_bytes_be_slice(tx_hash.0.bytes()), - ) - .unwrap() - .create_for_simulation(skip_validate, false, false, false, skip_nonce_check), - SNTransaction::DeployAccount(tx) => DeployAccount::from_sn_api_transaction( - tx, - Felt252::from_bytes_be_slice(tx_hash.0.bytes()), - ) - .unwrap() - .create_for_simulation(skip_validate, false, false, false, skip_nonce_check), - SNTransaction::Declare(tx) => { - // Try to fetch contract class from cache - let class_hash = ClassHash(tx.class_hash().0.bytes().try_into().unwrap()); - let contract_class = if let Ok(contract_class) = state.get_contract_class(&class_hash) { - contract_class - } else { - // Fetch the contract_class from the next block (as we don't have it in the previous one) - let next_block_state_reader = RpcStateReader( - RpcState::new_rpc(network, BlockNumber(block_info.block_number).next().into()) - .unwrap(), - ); - - let contract_class = next_block_state_reader - .get_contract_class(&class_hash) - .unwrap(); - - // Manually add the contract class to the cache so we don't need to fetch it when benchmarking (replay crate) - state - .contract_class_cache_mut() - .set_contract_class(class_hash, contract_class.clone()); - contract_class - }; - - let declare = declare_tx_from_sn_api_transaction( - tx, - Felt252::from_bytes_be_slice(tx_hash.0.bytes()), - contract_class, - )?; - declare.create_for_simulation(skip_validate, false, false, false, skip_nonce_check) - } - SNTransaction::L1Handler(tx) => L1Handler::from_sn_api_tx( - tx, - Felt252::from_bytes_be_slice(tx_hash.0.bytes()), - Some(Felt252::from(u128::MAX)), - ) - .unwrap() - .create_for_simulation(skip_validate, false), - SNTransaction::Deploy(_) => unimplemented!(), - }; - - let block_context = BlockContext::new( - starknet_os_config, - DEFAULT_CONTRACT_STORAGE_COMMITMENT_TREE_HEIGHT, - DEFAULT_GLOBAL_STATE_COMMITMENT_TREE_HEIGHT, - DEFAULT_CAIRO_RESOURCE_FEE_WEIGHTS.clone(), - DEFAULT_INVOKE_TX_MAX_N_STEPS, - DEFAULT_VALIDATE_MAX_N_STEPS, - block_info, - Default::default(), - true, - ); - - #[cfg(not(feature = "cairo-native"))] - let sir_execution = tx.execute(state, &block_context, u128::MAX)?; - #[cfg(feature = "cairo-native")] - let sir_execution = tx.execute(state, &block_context, u128::MAX, None)?; - - Ok(sir_execution) -} - -pub fn execute_tx( - tx_hash: &str, - network: RpcChain, - block_number: BlockNumber, -) -> Result< - ( - TransactionExecutionInfo, - TransactionTrace, - RpcTransactionReceipt, - ), - TransactionError, -> { - execute_tx_configurable(tx_hash, network, block_number, false, false) -} - -pub fn execute_tx_without_validate( - tx_hash: &str, - network: RpcChain, - block_number: BlockNumber, -) -> Result< - ( - TransactionExecutionInfo, - TransactionTrace, - RpcTransactionReceipt, - ), - TransactionError, -> { - execute_tx_configurable(tx_hash, network, block_number, true, true) -} - -pub fn get_transaction_hashes( - block_number: BlockNumber, - network: RpcChain, -) -> Result, RpcStateError> { - let rpc_state = RpcState::new_rpc(network, BlockValue::Number(block_number))?; - rpc_state.get_transaction_hashes() -} diff --git a/rpc-state-reader/tests/sir_tests.rs b/rpc-state-reader/tests/sir_tests.rs deleted file mode 100644 index b833900..0000000 --- a/rpc-state-reader/tests/sir_tests.rs +++ /dev/null @@ -1,403 +0,0 @@ -#![cfg(feature = "starknet_in_rust")] - -use cairo_vm::Felt252; -use pretty_assertions_sorted::{assert_eq, assert_eq_sorted}; -use rpc_state_reader::{ - execute_tx, execute_tx_configurable, execute_tx_without_validate, rpc_state::*, -}; -use starknet_api::{ - block::BlockNumber, - hash::StarkFelt, - stark_felt, - transaction::{Transaction as SNTransaction, TransactionHash}, -}; -use starknet_in_rust::{ - execution::{CallInfo, TransactionExecutionInfo}, - transaction::InvokeFunction, -}; -use test_case::test_case; - -#[test] -fn test_get_transaction_try_from() { - let rpc_state = RpcState::new_rpc(RpcChain::MainNet, BlockTag::Latest.into()).unwrap(); - let str_hash = stark_felt!("0x5d200ef175ba15d676a68b36f7a7b72c17c17604eda4c1efc2ed5e4973e2c91"); - let tx_hash = TransactionHash(str_hash); - - let sn_tx = rpc_state.get_transaction(&tx_hash).unwrap(); - match &sn_tx { - SNTransaction::Invoke(sn_tx) => { - let tx = InvokeFunction::from_invoke_transaction( - sn_tx.clone(), - Felt252::from_bytes_be_slice(tx_hash.0.bytes()), - ) - .unwrap(); - assert_eq!(tx.hash_value().to_bytes_be().as_slice(), str_hash.bytes()) - } - _ => unimplemented!(), - }; -} - -#[test] -fn test_get_gas_price() { - let block = BlockValue::Number(BlockNumber(169928)); - let rpc_state = RpcState::new_rpc(RpcChain::MainNet, block).unwrap(); - - let price = rpc_state.get_gas_price(169928).unwrap(); - assert_eq!(price.eth_l1_gas_price, 22804578690); -} - -#[test_case( - "0x014640564509873cf9d24a311e1207040c8b60efd38d96caef79855f0b0075d5", - 90006, - RpcChain::MainNet - => ignore["old transaction, gas mismatch"] -)] -#[test_case( - "0x025844447697eb7d5df4d8268b23aef6c11de4087936048278c2559fc35549eb", - 197000, - RpcChain::MainNet -)] -#[test_case( - "0x00164bfc80755f62de97ae7c98c9d67c1767259427bcf4ccfcc9683d44d54676", - 197000, - RpcChain::MainNet -)] -#[test_case( - "0x05d200ef175ba15d676a68b36f7a7b72c17c17604eda4c1efc2ed5e4973e2c91", - 169928, // real block 169929 - RpcChain::MainNet - )] -#[test_case( - "0x0528ec457cf8757f3eefdf3f0728ed09feeecc50fd97b1e4c5da94e27e9aa1d6", - 169928, // real block 169929 - RpcChain::MainNet - )] -#[test_case( - "0x0737677385a30ec4cbf9f6d23e74479926975b74db3d55dc5e46f4f8efee41cf", - 169928, // real block 169929 - RpcChain::MainNet - => ignore["resource mismatch"] - )] -#[test_case( - "0x026c17728b9cd08a061b1f17f08034eb70df58c1a96421e73ee6738ad258a94c", - 169928, // real block 169929 - RpcChain::MainNet - )] -#[test_case( - // review later - "0x0743092843086fa6d7f4a296a226ee23766b8acf16728aef7195ce5414dc4d84", - 186548, // real block 186549 - RpcChain::MainNet - => ignore["resource mismatch"] - )] -#[test_case( - // fails in blockifier - "0x00724fc4a84f489ed032ebccebfc9541eb8dc64b0e76b933ed6fc30cd6000bd1", - 186551, // real block 186552 - RpcChain::MainNet - )] -#[test_case( - "0x176a92e8df0128d47f24eebc17174363457a956fa233cc6a7f8561bfbd5023a", - 317092, // real block 317093 - RpcChain::MainNet -)] -#[test_case( - "0x04db9b88e07340d18d53b8b876f28f449f77526224afb372daaf1023c8b08036", - 398051, // real block 398052 - RpcChain::MainNet -)] -#[test_case( - "0x5a5de1f42f6005f3511ea6099daed9bcbcf9de334ee714e8563977e25f71601", - 281513, // real block 281514 - RpcChain::MainNet -)] -#[test_case( - "0x26be3e906db66973de1ca5eec1ddb4f30e3087dbdce9560778937071c3d3a83", - 351268, // real block 351269 - RpcChain::MainNet -)] -#[test_case( - "0x4f552c9430bd21ad300db56c8f4cae45d554a18fac20bf1703f180fac587d7e", - 351225, // real block 351226 - RpcChain::MainNet -)] -// DeployAccount for different account providers: - -// OpenZeppelin (v0.7.0) -#[test_case( - "0x04df8a364233d995c33c7f4666a776bf458631bec2633e932b433a783db410f8", - 422881, // real block 422882 - RpcChain::MainNet -)] -// Argent X (v5.7.0) -#[test_case( - "0x039683c034f8e67cfb4af6e3109cefb3c170ee15ceacf07ee2d926915c4620e5", - 475945, // real block 475946 - RpcChain::MainNet -)] -fn starknet_in_rust_test_case_tx(hash: &str, block_number: u64, chain: RpcChain) { - let (tx_info, trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)).unwrap(); - - let TransactionExecutionInfo { - call_info, - actual_fee, - .. - } = tx_info; - #[cfg_attr(feature = "cairo-native", allow(unused_variables))] - let CallInfo { - execution_resources, - internal_calls, - .. - } = call_info.unwrap(); - - // check Cairo VM execution resources - #[cfg(not(feature = "cairo-native"))] - assert_eq_sorted!( - execution_resources.as_ref(), - Some(&receipt.execution_resources), - "execution resources mismatch" - ); - - // check amount of internal calls - assert_eq!( - internal_calls.len(), - trace - .execute_invocation - .as_ref() - .unwrap() - .internal_calls - .len(), - "internal calls length mismatch" - ); - - // check actual fee calculation - if receipt.actual_fee.amount != actual_fee { - let diff = 100 * receipt.actual_fee.amount.abs_diff(actual_fee) / receipt.actual_fee.amount; - - if diff >= 35 { - assert_eq!( - actual_fee, receipt.actual_fee.amount, - "actual_fee mismatch differs from the baseline by more than 5% ({diff}%)", - ); - } - } -} - -#[test_case( - "0x05b4665a81d89d00e529d2e298fce6606750c4f67faf43aafc893c0fc0f9d425", - RpcChain::MainNet, - 222090, - 4 -)] -#[test_case( - "0x01e91fa12be4424264c8cad29f481a67d5d8e23f7abf94add734d64b91c90021", - RpcChain::MainNet, - 219797, - 7 -)] -#[test_case( - "0x03ec45f8369513b0f48db25f2cf18c70c50e7d3119505ab15e39ae4ca2eb06cf", - RpcChain::MainNet, - 219764, - 7 -)] -#[test_case( - "0x00164bfc80755f62de97ae7c98c9d67c1767259427bcf4ccfcc9683d44d54676", - RpcChain::MainNet, - 197000, - 3 -)] -fn test_sorted_events( - tx_hash: &str, - chain: RpcChain, - block_number: u64, - expected_amount_of_events: usize, -) { - let (tx_info, _trace, _receipt) = - execute_tx(tx_hash, chain, BlockNumber(block_number)).unwrap(); - - let events_len = tx_info.get_sorted_events().unwrap().len(); - - assert_eq!(expected_amount_of_events, events_len); -} - -#[test_case( - "0x00b6d59c19d5178886b4c939656167db0660fe325345138025a3cc4175b21897", - 200303, // real block 200304 - RpcChain::MainNet => ignore["Old tx"] -)] -#[test_case( - "0x02b28b4846a756e0cec6385d6d13f811e745a88c7e75a3ebc5fead5b4af152a3", - 200302, // real block 200304 - RpcChain::MainNet - => ignore["broken on both due to a cairo-vm error"] -)] -// Insufficient fee token balance -#[test_case( - "0x006978ae71587d4ab1048d7836c2d656222a16976c82c0dc24d3b44316d63cfe", - 440823, // real block 440824 - RpcChain::MainNet -)] -// Insufficient fee token balance -#[test_case( - "0x03e458ef06c17dd2601013746ae5622d8434348b246a335b20b6543f37aff0f8", - 440849, // real block 440850 - RpcChain::MainNet -)] -fn starknet_in_rust_test_case_reverted_tx(hash: &str, block_number: u64, chain: RpcChain) { - let (tx_info, trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)).unwrap(); - - assert_eq!( - tx_info.revert_error.is_some(), - trace.execute_invocation.unwrap().revert_reason.is_some() - ); - - let diff = - 100 * receipt.actual_fee.amount.abs_diff(tx_info.actual_fee) / receipt.actual_fee.amount; - - if diff >= 35 { - assert_eq!( - tx_info.actual_fee, receipt.actual_fee.amount, - "actual_fee mismatch differs from the baseline by more than 5% ({diff}%)", - ); - } -} - -#[test_case( - "0x038c307a0a324dc92778820f2c6317f40157c06b12a7e537f7a16b2c015f64e7", - 274333-1, - RpcChain::MainNet => ignore["Old tx"] -)] -fn test_validate_fee(hash: &str, block_number: u64, chain: RpcChain) { - let (tx_info, _trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)).unwrap(); - let (tx_info_without_fee, _trace, _receipt) = - execute_tx_without_validate(hash, chain, BlockNumber(block_number)).unwrap(); - - assert_eq!(tx_info.actual_fee, receipt.actual_fee.amount); - assert!(tx_info_without_fee.actual_fee < tx_info.actual_fee); -} - -#[test_case( - // Declare tx - "0x60506c49e65d84e2cdd0e9142dc43832a0a59cb6a9cbcce1ab4f57c20ba4afb", - 347899, // real block 347900 - RpcChain::MainNet -)] -#[test_case( - // Declare tx - "0x1088aa18785779e1e8eef406dc495654ad42a9729b57969ad0dbf2189c40bee", - 271887, // real block 271888 - RpcChain::MainNet -)] -fn starknet_in_rust_test_case_declare_tx(hash: &str, block_number: u64, chain: RpcChain) { - let (tx_info, _trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)).unwrap(); - let TransactionExecutionInfo { - call_info, - actual_fee, - .. - } = tx_info; - - assert!(call_info.is_none()); - - if receipt.actual_fee.amount != actual_fee { - let diff = 100 * receipt.actual_fee.amount.abs_diff(actual_fee) / receipt.actual_fee.amount; - - if diff >= 35 { - assert_eq!( - actual_fee, receipt.actual_fee.amount, - "actual_fee mismatch differs from the baseline by more than 5% ({diff}%)", - ); - } - } -} - -#[test_case( - "0x0200b493df8310215b188343f227dd1894c9edda597465cb336d25610172c701", - 470061, // real block 470062 - RpcChain::MainNet -)] -fn starknet_in_rust_test_case_tx_skip_nonce_check(hash: &str, block_number: u64, chain: RpcChain) { - let (tx_info, trace, receipt) = - execute_tx_configurable(hash, chain, BlockNumber(block_number), false, true).unwrap(); - - let TransactionExecutionInfo { - call_info, - actual_fee, - .. - } = tx_info; - let CallInfo { - execution_resources, - internal_calls, - .. - } = call_info.unwrap(); - - // check Cairo VM execution resources - assert_eq_sorted!( - execution_resources.as_ref(), - Some(&receipt.execution_resources), - "execution resources mismatch" - ); - - // check amount of internal calls - assert_eq!( - internal_calls.len(), - trace - .execute_invocation - .as_ref() - .unwrap() - .internal_calls - .len(), - "internal calls length mismatch" - ); - - // check actual fee calculation - if receipt.actual_fee.amount != actual_fee { - let diff = 100 * receipt.actual_fee.amount.abs_diff(actual_fee) / receipt.actual_fee.amount; - - if diff >= 35 { - assert_eq!( - actual_fee, receipt.actual_fee.amount, - "actual_fee mismatch differs from the baseline by more than 5% ({diff}%)", - ); - } - } -} - -#[test_case( - "0x05ee0cd7be18a4f8a2d6845a9960c0573318393122fe392c5d156eb460beff21", - 422346, // real block 422347 - RpcChain::MainNet -)] -fn starknet_in_rust_check_fee_and_retdata(hash: &str, block_number: u64, chain: RpcChain) { - let (tx_info, trace, receipt) = execute_tx(hash, chain, BlockNumber(block_number)).unwrap(); - - let TransactionExecutionInfo { - call_info, - actual_fee, - .. - } = tx_info; - let CallInfo { retdata, .. } = call_info.unwrap(); - - // check actual fee calculation - if receipt.actual_fee.amount != actual_fee { - let diff = 100 * receipt.actual_fee.amount.abs_diff(actual_fee) / receipt.actual_fee.amount; - - if diff >= 35 { - assert_eq!( - actual_fee, receipt.actual_fee.amount, - "actual_fee mismatch differs from the baseline by more than 5% ({diff}%)", - ); - } - } - - let rpc_retdata: Vec = trace - .execute_invocation - .unwrap() - .retdata - .unwrap() - .into_iter() - .map(|sf| Felt252::from_bytes_be_slice(sf.bytes())) - .collect(); - - assert_eq!(retdata, rpc_retdata); -} From c5ab31d00db91e949e51d49ba2011959a9ff510f Mon Sep 17 00:00:00 2001 From: Pedro Fontana Date: Wed, 5 Jun 2024 16:48:46 -0300 Subject: [PATCH 3/6] use update to blockifier nethermind version --- Cargo.lock | 1119 +++++++++++++++-- rpc-state-reader/Cargo.toml | 12 +- .../src/blockifier_state_reader.rs | 162 ++- rpc-state-reader/src/rpc_state.rs | 62 +- rpc-state-reader/src/utils.rs | 2 +- 5 files changed, 1168 insertions(+), 189 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2dc8031..9668dd4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,17 +28,6 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.11" @@ -81,6 +70,55 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" + +[[package]] +name = "anstyle-parse" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" version = "1.0.86" @@ -279,6 +317,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "base64" version = "0.13.1" @@ -297,6 +341,12 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + [[package]] name = "bigdecimal" version = "0.3.1" @@ -318,6 +368,29 @@ dependencies = [ "serde", ] +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools 0.11.0", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.66", + "which", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -368,10 +441,10 @@ dependencies = [ [[package]] name = "blockifier" -version = "0.5.0-dev.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b5acc7622f7b7af1e1df0c4065211d4665f29bbd0e658b8d21975f4a0ab6b8e" +version = "0.7.0-dev.1" +source = "git+https://github.com/NethermindEth/blockifier?rev=3844200855dab89ea24f80588c21edb065401123#3844200855dab89ea24f80588c21edb065401123" dependencies = [ + "anyhow", "ark-ec", "ark-ff", "ark-secp256k1", @@ -380,24 +453,28 @@ dependencies = [ "cairo-felt", "cairo-lang-casm", "cairo-lang-runner", + "cairo-lang-sierra", "cairo-lang-starknet", + "cairo-lang-starknet-classes", "cairo-lang-utils", + "cairo-native", "cairo-vm", - "ctor", "derive_more", "indexmap 2.2.6", "itertools 0.10.5", "keccak", "log", - "memoize", "num-bigint", "num-integer", + "num-rational", "num-traits 0.2.19", + "once_cell", "phf", "serde", "serde_json", "sha3", - "starknet-crypto 0.5.2", + "starknet-crypto 0.6.2", + "starknet-types-core 0.1.2", "starknet_api", "strum", "strum_macros", @@ -479,9 +556,9 @@ dependencies = [ [[package]] name = "cairo-lang-casm" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ceb71a4cbf5b474bd671c79b2c05e8168a97199bfea1c01ef63b1bdaac3db03" +checksum = "10d9c31baeb6b52586b5adc88f01e90f86389d63d94363c562de5c79352e545b" dependencies = [ "cairo-lang-utils", "indoc", @@ -493,9 +570,9 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95c1aab3213462c5b7c21508f1a4330bdf0766c90e6dd4ed79b0002c2b96a715" +checksum = "7148cb2d72a3db24a6d2ef2b2602102cc5099cb9f6b913e5047fb009cb3a22a1" dependencies = [ "anyhow", "cairo-lang-defs", @@ -510,23 +587,24 @@ dependencies = [ "cairo-lang-syntax", "cairo-lang-utils", "salsa", + "smol_str", "thiserror", ] [[package]] name = "cairo-lang-debug" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03623ba892200c6b3c55fab260d4aa0bff833d6bcecdb1fb022565ac00d5a683" +checksum = "5a761eb8e31ea65a2dd45f729c74f1770315f97124dad93d1f6853a10d460c6b" dependencies = [ "cairo-lang-utils", ] [[package]] name = "cairo-lang-defs" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09131755b08a485322656e061ad05602215a198dd4a2daf3897e64dc76e7544e" +checksum = "f6d60bc5d72fe7a95ba34e041dcbdf1cf3bfccb87008a515514b74913fa8ff05" dependencies = [ "cairo-lang-debug", "cairo-lang-diagnostics", @@ -541,9 +619,9 @@ dependencies = [ [[package]] name = "cairo-lang-diagnostics" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b8185cc9472c648ac9db970ce558595c71259eebd55d25a502fe569cb871448" +checksum = "356089e1b0a0ba9e115566191745613b3806a20259ad76764df82ab534d5412a" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -553,9 +631,9 @@ dependencies = [ [[package]] name = "cairo-lang-eq-solver" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae71750096b64d4dd54dd2c39ef50651bb4aff4bc829e3d07549a5035620e0a" +checksum = "fc43246cc2e5afd5a028bcdd63876ac3f8b1f4fb3ff785daaa0f0fbb51c9d906" dependencies = [ "cairo-lang-utils", "good_lp", @@ -563,9 +641,9 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1819ef5a5396df695dcec993500c46bc44c309590b503da26965c873dfe8a84a" +checksum = "6bcb9a4a40e53fa099774bd08bbcc3430f51213cc7fb1b50c2e9d01155731798" dependencies = [ "cairo-lang-debug", "cairo-lang-utils", @@ -577,9 +655,9 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0968f0da6117dca1a70d6ac7d2e252d8b1710f333458c54ce08dbef1c0323881" +checksum = "1ba60e1e2477aa0f610ccf29189097d580464607c94b51741e1c18e64d6cee5f" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -602,9 +680,9 @@ dependencies = [ [[package]] name = "cairo-lang-parser" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae556e49c0a90d30e52f068b0fb5ed4d419766661d3713a1644f3894a9255a5a" +checksum = "7f16ba1535e0cc5e79c2eff6592859bbdac03dc53d4dcdd26dbdbc04a77c3f5c" dependencies = [ "cairo-lang-diagnostics", "cairo-lang-filesystem", @@ -622,9 +700,9 @@ dependencies = [ [[package]] name = "cairo-lang-plugins" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d319f3e84ff679159f97e3baa1d918d369ba9e3ade5ad490e0a9e4eca19591" +checksum = "81c8cf6e0ee3d6b19429cc1663738b22f1ecea7d51bf7452e8e1086f08798baf" dependencies = [ "cairo-lang-defs", "cairo-lang-diagnostics", @@ -641,9 +719,9 @@ dependencies = [ [[package]] name = "cairo-lang-proc-macros" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fef002aac874d76492eb9577dab663f9a84fe4584b4215c7ebfda7d025fcadae" +checksum = "67f9da66325ce7ed6c002360f26106fe79deb9f8a2fca30abdbb8d388da7bb46" dependencies = [ "cairo-lang-debug", "quote", @@ -652,9 +730,9 @@ dependencies = [ [[package]] name = "cairo-lang-project" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f384c26e6907de9c94b44051e386498159e8c9e1567b9b1eae9c22e16ff17e5" +checksum = "e198af1ab3d05c7fb8b6a9a7a2e9bce245a6c855df5f770b751d29874a23b152" dependencies = [ "cairo-lang-filesystem", "cairo-lang-utils", @@ -666,9 +744,9 @@ dependencies = [ [[package]] name = "cairo-lang-runner" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ccd9dce6f931508a21ac4d29965dadcaf7c22bbf2a237239763128b8647a53" +checksum = "0bf211f5431e2a6f4802b1b6483bf8e998e506a3be5369ed54a8807aae6e4dbf" dependencies = [ "ark-ff", "ark-secp256k1", @@ -676,6 +754,7 @@ dependencies = [ "ark-std", "cairo-felt", "cairo-lang-casm", + "cairo-lang-lowering", "cairo-lang-sierra", "cairo-lang-sierra-ap-change", "cairo-lang-sierra-generator", @@ -696,9 +775,9 @@ dependencies = [ [[package]] name = "cairo-lang-semantic" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311434caae9542b7c442ac69a04e3c8eaa477654f215abe0bd7dfd3c0de70669" +checksum = "6d7df81521c2125e3e95b683cc99374db1aebd7ddb317c5ca3dd92a235a9eb13" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -721,9 +800,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52c00c34fcaf97bbc4111d1631af8c65838841a38b3502b5bbc04355b7d46982" +checksum = "07da3ca1434c62a7cc7cd77d2941ef47a1c23b37325781b59407b78d8c61d863" dependencies = [ "anyhow", "cairo-felt", @@ -747,9 +826,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99a0be021b359c51383cce4372cb1061f7d53438d80f208c56af2154583c98e" +checksum = "122c9055eb609a511178e3dce577de061819fd4c4c6b7452804557f76ca43bbf" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -762,9 +841,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f273d4de9d30e556e72ebe2751f9ed6bf3d84a70f6c76f52b178c24cddb12e43" +checksum = "cf049d9aea65c6e38da219a3700c72f78795d11449d9adcec28047ef8d63bd23" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -777,9 +856,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-generator" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "734f72e9e8b1ec7a96208aa8dfba87ca1614188e3646ae67c519afe707569490" +checksum = "3e1d75e0830279ca1bd0189e3326720d6e081225f7d81ed060bbd22c6b37e980" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -792,7 +871,7 @@ dependencies = [ "cairo-lang-syntax", "cairo-lang-utils", "itertools 0.11.0", - "num-bigint", + "num-traits 0.2.19", "once_cell", "salsa", "smol_str", @@ -800,9 +879,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "842ae37ee3f1cd06b926aceb480fd70b84300aae82e9606b876678d30c21649a" +checksum = "6a3c3be88c8562fbf93b0803c186e7282f6daad93576c07f61b04a591fde468f" dependencies = [ "assert_matches", "cairo-felt", @@ -821,9 +900,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-type-size" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f969cbaf81f3beb1dc693674fc792a815bf8fc13471227020a5faf309d5faf80" +checksum = "a38da6f98c6b16945c89d2ae351c82d636ed38d3e6eb02f7c8679e3e03a63988" dependencies = [ "cairo-lang-sierra", "cairo-lang-utils", @@ -831,13 +910,12 @@ dependencies = [ [[package]] name = "cairo-lang-starknet" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cd2d120f39369c7bd7d124dee638c250495054030d01d4e1d1b88f0063bd80" +checksum = "2c9ffa8b3b8c47138c36b1907cebb5047dfc4de29ec10ece5bd6d6853243ec50" dependencies = [ "anyhow", "cairo-felt", - "cairo-lang-casm", "cairo-lang-compiler", "cairo-lang-defs", "cairo-lang-diagnostics", @@ -847,14 +925,33 @@ dependencies = [ "cairo-lang-semantic", "cairo-lang-sierra", "cairo-lang-sierra-generator", - "cairo-lang-sierra-to-casm", + "cairo-lang-starknet-classes", "cairo-lang-syntax", "cairo-lang-utils", "const_format", - "convert_case 0.6.0", "indent", "indoc", "itertools 0.11.0", + "once_cell", + "serde", + "serde_json", + "smol_str", + "thiserror", +] + +[[package]] +name = "cairo-lang-starknet-classes" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c64ae2bb00173e3a88760128bf72de356fa80eb19fa47602479063648b4003" +dependencies = [ + "cairo-felt", + "cairo-lang-casm", + "cairo-lang-sierra", + "cairo-lang-sierra-to-casm", + "cairo-lang-utils", + "convert_case 0.6.0", + "itertools 0.11.0", "num-bigint", "num-integer", "num-traits 0.2.19", @@ -869,9 +966,9 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552d3438fec55832976bc7c7d7490100e8ce7385d3f3f1539f9a46fffa2197c6" +checksum = "8262c426a57e1e5ec297db24278464841500613445e2cb1c43d5f71ad91ee8d6" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -893,21 +990,113 @@ dependencies = [ "xshell", ] +[[package]] +name = "cairo-lang-test-plugin" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c2d77976328ac79509b9c33e4380d15aeff7c8ee07fbaea6b41dd469084738" +dependencies = [ + "anyhow", + "cairo-felt", + "cairo-lang-compiler", + "cairo-lang-debug", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-lowering", + "cairo-lang-semantic", + "cairo-lang-sierra", + "cairo-lang-sierra-generator", + "cairo-lang-starknet", + "cairo-lang-starknet-classes", + "cairo-lang-syntax", + "cairo-lang-utils", + "indoc", + "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", + "serde", +] + [[package]] name = "cairo-lang-utils" -version = "2.5.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12d0939f42d40fb1d975cae073d7d4f82d83de4ba2149293115525245425f909" +checksum = "bf733a7cdc4166d0baf0ed8a98d9ada827daee6653b37d9326e334e53481c6d3" dependencies = [ "hashbrown 0.14.5", "indexmap 2.2.6", "itertools 0.11.0", "num-bigint", "num-traits 0.2.19", + "parity-scale-codec", "schemars", "serde", ] +[[package]] +name = "cairo-native" +version = "0.1.0" +source = "git+https://github.com/lambdaclass/cairo_native?rev=cd75446#cd75446a486f2200a0af8c8a8a6f374636f21660" +dependencies = [ + "anyhow", + "bumpalo", + "cairo-felt", + "cairo-lang-compiler", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-lowering", + "cairo-lang-runner", + "cairo-lang-semantic", + "cairo-lang-sierra", + "cairo-lang-sierra-ap-change", + "cairo-lang-sierra-gas", + "cairo-lang-sierra-generator", + "cairo-lang-starknet", + "cairo-lang-starknet-classes", + "cairo-lang-test-plugin", + "cairo-lang-utils", + "cairo-native-runtime", + "cc", + "clap", + "colored", + "educe", + "id-arena", + "itertools 0.12.1", + "k256", + "keccak", + "lazy_static", + "libc", + "libloading", + "llvm-sys", + "melior", + "mlir-sys", + "num-bigint", + "num-traits 0.2.19", + "p256", + "sec1", + "starknet-types-core 0.1.2", + "tempfile", + "thiserror", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "cairo-native-runtime" +version = "0.1.0" +source = "git+https://github.com/lambdaclass/cairo_native?rev=cd75446#cd75446a486f2200a0af8c8a8a6f374636f21660" +dependencies = [ + "cairo-lang-runner", + "cairo-lang-sierra-gas", + "lazy_static", + "libc", + "starknet-crypto 0.6.2", + "starknet-curve 0.4.2", + "starknet-types-core 0.1.2", +] + [[package]] name = "cairo-vm" version = "0.9.2" @@ -945,6 +1134,15 @@ version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -974,6 +1172,63 @@ dependencies = [ "inout", ] +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "4.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim 0.11.1", +] + +[[package]] +name = "clap_derive" +version = "4.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "clap_lex" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" + +[[package]] +name = "colorchoice" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + [[package]] name = "colored" version = "2.1.0" @@ -984,12 +1239,34 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "comrak" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a972c8ec1be8065f7b597b5f7f5b3be535db780280644aebdcd1966decf58dc" +dependencies = [ + "derive_builder", + "entities", + "memchr", + "once_cell", + "regex", + "slug", + "typed-arena", + "unicode_categories", +] + [[package]] name = "const-fnv1a-hash" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32b13ea120a812beba79e34316b3942a857c86ec1593cb34f27bb28272ce2cca" +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "const_format" version = "0.2.32" @@ -1078,6 +1355,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", + "rand_core", "subtle", "zeroize", ] @@ -1092,16 +1370,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn 2.0.66", -] - [[package]] name = "ctr" version = "0.9.2" @@ -1193,6 +1461,30 @@ dependencies = [ "ordered-float", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core 0.9.10", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + [[package]] name = "deranged" version = "0.3.11" @@ -1214,6 +1506,37 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" +dependencies = [ + "darling 0.20.9", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" +dependencies = [ + "derive_builder_core", + "syn 2.0.66", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1227,6 +1550,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "deunicode" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339544cc9e2c4dc3fc7149fd630c5f22263a4fdf18a98afd0075784968b5cf00" + [[package]] name = "diff" version = "0.1.13" @@ -1240,6 +1569,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", + "const-oid", "crypto-common", "subtle", ] @@ -1277,12 +1607,58 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "educe" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4bd92664bf78c4d3dba9b7cdafce6fa15b13ed3ed16175218196942e99168a8" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "either" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "pem-rfc7468", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "ena" version = "0.14.3" @@ -1301,12 +1677,48 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "entities" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca" + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "eth-keystore" version = "0.5.0" @@ -1356,6 +1768,22 @@ dependencies = [ "uint", ] +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -1496,6 +1924,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -1517,6 +1946,12 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "good_lp" version = "1.8.1" @@ -1527,6 +1962,17 @@ dependencies = [ "minilp", ] +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "h2" version = "0.3.26" @@ -1551,9 +1997,6 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] [[package]] name = "hashbrown" @@ -1561,7 +2004,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.11", + "ahash", ] [[package]] @@ -1570,7 +2013,7 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.11", + "ahash", "allocator-api2", "serde", ] @@ -1590,6 +2033,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hex" version = "0.4.3" @@ -1605,6 +2054,15 @@ dependencies = [ "digest", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "html-escape" version = "0.2.13" @@ -1827,6 +2285,12 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.10.5" @@ -1845,6 +2309,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -1860,6 +2333,20 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", + "signature", +] + [[package]] name = "keccak" version = "0.1.5" @@ -1883,7 +2370,7 @@ dependencies = [ "petgraph", "pico-args", "regex", - "regex-syntax", + "regex-syntax 0.8.3", "string_cache", "term", "tiny-keccak", @@ -1897,9 +2384,37 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" dependencies = [ - "regex-automata", + "regex-automata 0.4.6", +] + +[[package]] +name = "lambdaworks-crypto" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "458fee521f12d0aa97a2e06eaf134398a5d2ae7b2074af77eb402b0d93138c47" +dependencies = [ + "lambdaworks-math 0.6.0", + "serde", + "sha2", + "sha3", +] + +[[package]] +name = "lambdaworks-math" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c74ce6f0d9cb672330b6ca59e85a6c3607a3329e0372ab0d3fe38c2d38e50f9" +dependencies = [ + "serde", + "serde_json", ] +[[package]] +name = "lambdaworks-math" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "358e172628e713b80a530a59654154bfc45783a6ed70ea284839800cebdf8f97" + [[package]] name = "lazy_static" version = "1.4.0" @@ -1909,12 +2424,28 @@ dependencies = [ "spin 0.5.2", ] +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "libc" version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +[[package]] +name = "libloading" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +dependencies = [ + "cfg-if", + "windows-targets 0.52.5", +] + [[package]] name = "libmimalloc-sys" version = "0.1.38" @@ -1935,6 +2466,26 @@ dependencies = [ "libc", ] +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "llvm-sys" +version = "180.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778fa5fa02e32728e718f11eec147e6f134137399ab02fd2c13d32476337affa" +dependencies = [ + "anyhow", + "cc", + "lazy_static", + "libc", + "regex-lite", + "semver", +] + [[package]] name = "lock_api" version = "0.4.12" @@ -1953,20 +2504,20 @@ checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lru" -version = "0.7.8" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "hashbrown 0.12.3", + "hashbrown 0.14.5", ] [[package]] -name = "lru" -version = "0.12.3" +name = "matchers" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "hashbrown 0.14.5", + "regex-automata 0.1.10", ] [[package]] @@ -1979,34 +2530,40 @@ dependencies = [ ] [[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "memoize" -version = "0.4.2" +name = "melior" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5df4051db13d0816cf23196d3baa216385ae099339f5d0645a8d9ff2305e82b8" +checksum = "5f904b36a8146f1c99548f6b38eca76595e346d2f59fcc4f75c07efe847bd8e1" dependencies = [ - "lazy_static", - "lru 0.7.8", - "memoize-inner", + "dashmap", + "melior-macro", + "mlir-sys", + "once_cell", ] [[package]] -name = "memoize-inner" -version = "0.4.3" +name = "melior-macro" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27bdece7e91f0d1e33df7b46ec187a93ea0d4e642113a1039ac8bfdd4a3273ac" +checksum = "3426487cfa27f472c09150149b972ef0c0dacb17cae00734c2c4862e98725bca" dependencies = [ - "lazy_static", + "comrak", + "convert_case 0.6.0", + "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "regex", + "syn 2.0.66", + "tblgen-alt", + "unindent", ] +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + [[package]] name = "mimalloc" version = "0.1.42" @@ -2058,6 +2615,15 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "mlir-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1b5806a63bc959cd5c4e5db8cadd20e40045d41969d325132748db8af11b7f" +dependencies = [ + "bindgen", +] + [[package]] name = "ndarray" version = "0.13.1" @@ -2087,6 +2653,16 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-bigint" version = "0.4.5" @@ -2143,7 +2719,7 @@ checksum = "e238432a7881ec7164503ccc516c014bf009be7984cde1ba56837862543bdec3" dependencies = [ "bitvec", "either", - "lru 0.12.3", + "lru", "num-bigint", "num-integer", "num-modular", @@ -2151,6 +2727,18 @@ dependencies = [ "rand", ] +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "serde", +] + [[package]] name = "num-traits" version = "0.1.43" @@ -2199,6 +2787,24 @@ dependencies = [ "num-traits 0.2.19", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + [[package]] name = "parity-scale-codec" version = "3.6.5" @@ -2294,6 +2900,15 @@ dependencies = [ "digest", ] +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -2379,6 +2994,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -2417,6 +3042,25 @@ dependencies = [ "pretty_assertions", ] +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2", + "syn 2.0.66", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "primitive-types" version = "0.12.2" @@ -2537,8 +3181,17 @@ checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", ] [[package]] @@ -2549,9 +3202,21 @@ checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.3", ] +[[package]] +name = "regex-lite" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b661b2f27137bdbc16f00eda72866a92bb28af1753ffbd56744fb6e2e9cd8e" + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.8.3" @@ -2650,6 +3315,7 @@ version = "0.1.0" dependencies = [ "blockifier", "cairo-lang-starknet", + "cairo-lang-starknet-classes", "cairo-lang-utils", "cairo-vm", "dotenv", @@ -2692,6 +3358,19 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + [[package]] name = "rustls" version = "0.21.12" @@ -2866,6 +3545,20 @@ dependencies = [ "untrusted", ] +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "1.0.23" @@ -3025,6 +3718,31 @@ dependencies = [ "keccak", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + [[package]] name = "siphasher" version = "0.3.11" @@ -3040,6 +3758,16 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slug" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bd94acec9c8da640005f8e135a39fc0372e74535e6b368b7a04b875f784c8c4" +dependencies = [ + "deunicode", + "wasm-bindgen", +] + [[package]] name = "smallvec" version = "1.13.2" @@ -3077,6 +3805,16 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "sprs" version = "0.7.1" @@ -3299,23 +4037,52 @@ dependencies = [ "thiserror", ] +[[package]] +name = "starknet-types-core" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e16522c1c9aa7fc149a46816cd18aa12a5fc2b2b75a018089022db473a9237" +dependencies = [ + "bitvec", + "lambdaworks-crypto", + "lambdaworks-math 0.6.0", + "lazy_static", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "serde", +] + +[[package]] +name = "starknet-types-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4098ac4ad57621cc7ec133b80fe72814d2cc4bee63ca8e7be4450ba6f42a07e8" +dependencies = [ + "lambdaworks-math 0.7.0", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "serde", +] + [[package]] name = "starknet_api" -version = "0.7.0-dev.0" +version = "0.12.0-dev.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88969610ab6ea9391e0e05a3e7c38acc49dc1cb49941b93ca52814075002b92f" +checksum = "4333a5d836f1018c87a0db36ffe673e8f79db4c40718dca65ad82430d9204b16" dependencies = [ - "cairo-lang-starknet", + "cairo-lang-starknet-classes", "derive_more", "hex", "indexmap 2.2.6", + "itertools 0.12.1", "once_cell", - "parity-scale-codec", - "parity-scale-codec-derive", "primitive-types", "serde", "serde_json", "starknet-crypto 0.5.2", + "starknet-types-core 0.0.11", "strum", "strum_macros", "thiserror", @@ -3432,6 +4199,30 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "tblgen-alt" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8128e684b18b518f32cd15779659c4a8dbb54ef6a36b532f7e3520f27dd01c95" +dependencies = [ + "bindgen", + "cc", + "paste", + "thiserror", +] + +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand", + "rustix", + "windows-sys 0.52.0", +] + [[package]] name = "term" version = "0.7.0" @@ -3516,6 +4307,16 @@ dependencies = [ "thiserror-impl-no-std", ] +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "time" version = "0.3.36" @@ -3680,9 +4481,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "tracing-core" version = "0.1.32" @@ -3690,6 +4503,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", ] [[package]] @@ -3698,6 +4541,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "typed-arena" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" + [[package]] name = "typenum" version = "1.17.0" @@ -3758,6 +4607,18 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + +[[package]] +name = "unindent" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" + [[package]] name = "untrusted" version = "0.9.0" @@ -3800,6 +4661,12 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" version = "0.8.2" @@ -3810,6 +4677,12 @@ dependencies = [ "serde", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "version_check" version = "0.9.4" @@ -3932,6 +4805,18 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "winapi" version = "0.3.9" diff --git a/rpc-state-reader/Cargo.toml b/rpc-state-reader/Cargo.toml index 20856f2..28f1ea9 100644 --- a/rpc-state-reader/Cargo.toml +++ b/rpc-state-reader/Cargo.toml @@ -10,16 +10,18 @@ serde_json = { version = "1.0", features = [ "arbitrary_precision", "raw_value", ] } -starknet_api = "0.7.0-dev.0" -cairo-lang-starknet = "=2.5.4" -cairo-lang-utils = "=2.5.4" +starknet_api = "=0.12.0-dev.1" +cairo-lang-starknet = "=2.6.3" +cairo-lang-starknet-classes = "=2.6.3" +cairo-lang-utils = "=2.6.3" starknet = "0.7.0" thiserror = { workspace = true } flate2 = "1.0.25" serde_with = "3.0.0" dotenv = "0.15.0" -cairo-vm-blockifier = { package = "cairo-vm", version = "0.9.1" } -blockifier = "=0.5.0-dev.0" +cairo-vm = "0.9.2" +blockifier = { git = "https://github.com/NethermindEth/blockifier", rev = "3844200855dab89ea24f80588c21edb065401123" } + [dev-dependencies] pretty_assertions_sorted = "1.2.3" diff --git a/rpc-state-reader/src/blockifier_state_reader.rs b/rpc-state-reader/src/blockifier_state_reader.rs index 6e395f3..b4c0f6d 100644 --- a/rpc-state-reader/src/blockifier_state_reader.rs +++ b/rpc-state-reader/src/blockifier_state_reader.rs @@ -1,14 +1,14 @@ use blockifier::{ - block_context::{BlockContext, FeeTokenAddresses, GasPrices}, - execution::{ - call_info::CallInfo, - contract_class::{ - ContractClass as BlockifierContractClass, ContractClassV0, ContractClassV0Inner, - }, + blockifier::block::BlockInfo, + context::{BlockContext, ChainInfo, FeeTokenAddresses}, + execution::contract_class::{ + ClassInfo, ContractClass, ContractClassV0, ContractClassV0Inner, SierraContractClassV1, + SierraContractClassV1Inner, }, state::{ - cached_state::{CachedState, GlobalContractCache}, + cached_state::CachedState, errors::StateError, + global_cache::GlobalContractCache, state_api::{StateReader, StateResult}, }, transaction::{ @@ -19,11 +19,10 @@ use blockifier::{ L1HandlerTransaction, }, }, + versioned_constants::VersionedConstants, }; -use cairo_lang_starknet::{ - casm_contract_class::CasmContractClass, contract_class::ContractClass as SierraContractClass, -}; -use cairo_vm_blockifier::types::program::Program; +use cairo_lang_starknet_classes::casm_contract_class::CasmContractClass; +use cairo_vm::types::program::Program; use starknet::core::types::ContractClass as SNContractClass; use starknet_api::{ block::BlockNumber, @@ -54,27 +53,27 @@ impl RpcStateReader { impl StateReader for RpcStateReader { fn get_storage_at( - &mut self, + &self, contract_address: starknet_api::core::ContractAddress, key: StorageKey, ) -> StateResult { Ok(self.0.get_storage_at(&contract_address, &key)) } - fn get_nonce_at(&mut self, contract_address: ContractAddress) -> StateResult { + fn get_nonce_at(&self, contract_address: ContractAddress) -> StateResult { Ok(Nonce(self.0.get_nonce_at(&contract_address))) } - fn get_class_hash_at(&mut self, contract_address: ContractAddress) -> StateResult { + fn get_class_hash_at(&self, contract_address: ContractAddress) -> StateResult { Ok(self.0.get_class_hash_at(&contract_address)) } /// Returns the contract class of the given class hash. fn get_compiled_contract_class( - &mut self, - class_hash: &ClassHash, - ) -> StateResult { - Ok(match self.0.get_contract_class(class_hash) { + &self, + class_hash: starknet_api::core::ClassHash, + ) -> StateResult { + Ok(match self.0.get_contract_class(&class_hash) { Some(SNContractClass::Legacy(compressed_legacy_cc)) => { let as_str = utils::decode_reader(compressed_legacy_cc.program).unwrap(); let program = Program::from_bytes(as_str.as_bytes(), None).unwrap(); @@ -85,29 +84,34 @@ impl StateReader for RpcStateReader { program, entry_points_by_type, }); - BlockifierContractClass::V0(ContractClassV0(inner)) + ContractClass::V0(ContractClassV0(inner)) } Some(SNContractClass::Sierra(flattened_sierra_cc)) => { let middle_sierra: utils::MiddleSierraContractClass = { let v = serde_json::to_value(flattened_sierra_cc).unwrap(); serde_json::from_value(v).unwrap() }; - let sierra_cc = SierraContractClass { + let sierra_cc = cairo_lang_starknet_classes::contract_class::ContractClass { sierra_program: middle_sierra.sierra_program, contract_class_version: middle_sierra.contract_class_version, entry_points_by_type: middle_sierra.entry_points_by_type, sierra_program_debug_info: None, abi: None, }; - let casm_cc = CasmContractClass::from_contract_class(sierra_cc, false).unwrap(); - BlockifierContractClass::V1(casm_cc.try_into().unwrap()) + let casm_cc = + CasmContractClass::from_contract_class(sierra_cc, false, usize::MAX).unwrap(); + ContractClass::V1(casm_cc.try_into().unwrap()) + } + None => { + return Err(StateError::UndeclaredClassHash( + starknet_api::core::ClassHash(*class_hash), + )) } - None => return Err(StateError::UndeclaredClassHash(*class_hash)), }) } /// Returns the compiled class hash of the given class hash. - fn get_compiled_class_hash(&mut self, class_hash: ClassHash) -> StateResult { + fn get_compiled_class_hash(&self, class_hash: ClassHash) -> StateResult { Ok(CompiledClassHash( self.0 .get_class_hash_at(&ContractAddress(class_hash.0.try_into().unwrap())) @@ -144,12 +148,12 @@ pub fn execute_tx( let tx_hash = TransactionHash(stark_felt!(tx_hash)); let sn_api_tx = rpc_reader.0.get_transaction(&tx_hash); + dbg!(&rpc_reader.0.get_transaction_trace(&tx_hash)); let trace = rpc_reader.0.get_transaction_trace(&tx_hash).unwrap(); let receipt = rpc_reader.0.get_transaction_receipt(&tx_hash).unwrap(); // Create state from RPC reader - let global_cache = GlobalContractCache::default(); - let mut state = CachedState::new(rpc_reader, global_cache); + let mut state = CachedState::new(rpc_reader); let fee_token_address = contract_address!("049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"); @@ -171,30 +175,48 @@ pub fn execute_tx( ("keccak_builtin".to_string(), N_STEPS_FEE_WEIGHT * 2048.0), // 2**11 ])); - let block_context = BlockContext { - chain_id, + let block_info = BlockInfo { block_number, block_timestamp, sequencer_address, - // TODO: Add strk token address when updated - fee_token_addresses: FeeTokenAddresses { - strk_fee_token_address: fee_token_address, - eth_fee_token_address: fee_token_address, - }, - vm_resource_fee_cost, - // TODO: Add strk l1 gas price when updated - gas_prices: GasPrices { - eth_l1_gas_price: gas_price.eth_l1_gas_price, - strk_l1_gas_price: gas_price.strk_l1_gas_price, - }, - invoke_tx_max_n_steps: 1_000_000, - validate_max_n_steps: 1_000_000, - max_recursion_depth: 500, + // TODO: Check gas_prices and use_kzg_da + gas_prices: gas_price, + use_kzg_da: false, }; + let chain_info = ChainInfo { + chain_id, + fee_token_addresses: FeeTokenAddresses::default(), + }; + + let block_context = + BlockContext::new_unchecked(&block_info, &chain_info, &VersionedConstants::default()); + // let block_context = BlockContext { + // chain_id, + // block_number, + // block_timestamp, + // sequencer_address, + // // TODO: Add strk token address when updated + // fee_token_addresses: FeeTokenAddresses { + // strk_fee_token_address: fee_token_address, + // eth_fee_token_address: fee_token_address, + // }, + // vm_resource_fee_cost, + // // TODO: Add strk l1 gas price when updated + // gas_prices: GasPrices { + // eth_l1_gas_price: gas_price.eth_l1_gas_price, + // strk_l1_gas_price: gas_price.strk_l1_gas_price, + // }, + // invoke_tx_max_n_steps: 1_000_000, + // validate_max_n_steps: 1_000_000, + // max_recursion_depth: 500, + // }; + // Map starknet_api transaction to blockifier's - let blockifier_tx = match sn_api_tx.unwrap() { + dbg!(&sn_api_tx); + let blockifier_tx: AccountTransaction = match sn_api_tx.unwrap() { SNTransaction::Invoke(tx) => { + dbg!(&tx); let invoke = InvokeTransaction { tx, tx_hash, @@ -219,13 +241,16 @@ pub fn execute_tx( } SNTransaction::Declare(tx) => { // Fetch the contract_class from the next block (as we don't have it in the previous one) - let mut next_block_state_reader = - RpcStateReader(RpcState::new_rpc(network, (block_number.next()).into()).unwrap()); + let mut next_block_state_reader = RpcStateReader( + RpcState::new_rpc(network, (block_number.next()).unwrap().into()).unwrap(), + ); let contract_class = next_block_state_reader - .get_compiled_contract_class(&tx.class_hash()) + .get_compiled_contract_class(tx.class_hash()) .unwrap(); - let declare = DeclareTransaction::new(tx, tx_hash, contract_class).unwrap(); + let class_info = calculate_class_info_for_testing(contract_class); + + let declare = DeclareTransaction::new(tx, tx_hash, class_info).unwrap(); AccountTransaction::Declare(declare) } SNTransaction::L1Handler(tx) => { @@ -255,9 +280,19 @@ pub fn execute_tx( ) } +fn calculate_class_info_for_testing(contract_class: ContractClass) -> ClassInfo { + let sierra_program_length = match contract_class { + ContractClass::V0(_) => 0, + ContractClass::V1(_) => 100, + ContractClass::V1Sierra(_) => todo!("should this also be 100?"), + }; + ClassInfo::new(&contract_class, sierra_program_length, 100).unwrap() +} #[cfg(test)] mod tests { + use std::num::NonZeroU128; + use crate::rpc_state::BlockValue; use super::*; @@ -268,7 +303,10 @@ mod tests { let rpc_state = RpcState::new_rpc(RpcChain::MainNet, block).unwrap(); let price = rpc_state.get_gas_price(169928).unwrap(); - assert_eq!(price.eth_l1_gas_price, 22804578690); + assert_eq!( + price.eth_l1_gas_price, + NonZeroU128::new(22804578690).unwrap() + ); } #[test] @@ -287,19 +325,19 @@ mod tests { } = tx_info; let CallInfo { - vm_resources, + resources, inner_calls, .. } = execute_call_info.unwrap(); assert_eq!(actual_fee.0, receipt.actual_fee.amount); assert_eq!( - vm_resources.n_memory_holes, + resources.n_memory_holes, receipt.execution_resources.n_memory_holes ); - assert_eq!(vm_resources.n_steps, receipt.execution_resources.n_steps); + assert_eq!(resources.n_steps, receipt.execution_resources.n_steps); assert_eq!( - vm_resources.builtin_instance_counter, + resources.builtin_instance_counter, receipt.execution_resources.builtin_instance_counter ); assert_eq!( @@ -392,7 +430,7 @@ mod tests { )] // Argent X (v5.7.0) #[test_case( - "0x039683c034f8e67cfb4af6e3109cefb3c170ee15ceacf07ee2d926915c4620e5", + "0x74820d4a1ac6e832a51a8938959e6f15a247f7d34daea2860d4880c27bc2dfd", 475945, // real block 475946 RpcChain::MainNet )] @@ -405,7 +443,7 @@ mod tests { } = tx_info; let CallInfo { - vm_resources, + resources, inner_calls, .. } = execute_call_info.unwrap(); @@ -424,12 +462,12 @@ mod tests { } assert_eq!( - vm_resources.n_memory_holes, + resources.n_memory_holes, receipt.execution_resources.n_memory_holes ); - assert_eq!(vm_resources.n_steps, receipt.execution_resources.n_steps); + assert_eq!(resources.n_steps, receipt.execution_resources.n_steps); assert_eq!( - vm_resources.builtin_instance_counter, + resources.builtin_instance_counter, receipt.execution_resources.builtin_instance_counter ); @@ -595,14 +633,16 @@ mod tests { )] // Argent X (v5.7.0) #[test_case( - "0x039683c034f8e67cfb4af6e3109cefb3c170ee15ceacf07ee2d926915c4620e5", - 475945, // real block 475946 + "0x41497e62fb6798ff66e4ad736121c0164cdb74005aa5dab025be3d90ad4ba06", + 638866, // real block 475946 RpcChain::MainNet )] #[cfg(not(feature = "cairo-native"))] // todo: check this tests fn starknet_in_rust_vs_blockifier_tx(hash: &str, block_number: u64, chain: RpcChain) { // Execute using blockifier + + use blockifier::execution::call_info::CallInfo; let (blockifier_tx_info, _, _) = execute_tx(hash, chain, BlockNumber(block_number)); let (blockifier_fee, blockifier_resources) = { @@ -611,8 +651,8 @@ mod tests { execute_call_info, .. } = blockifier_tx_info; - let CallInfo { vm_resources, .. } = execute_call_info.unwrap(); - (actual_fee.0, vm_resources) + let CallInfo { resources, .. } = execute_call_info.unwrap(); + (actual_fee.0, resources) }; // // Compare sir vs blockifier fee & resources diff --git a/rpc-state-reader/src/rpc_state.rs b/rpc-state-reader/src/rpc_state.rs index 2e9b54f..58a2c70 100644 --- a/rpc-state-reader/src/rpc_state.rs +++ b/rpc-state-reader/src/rpc_state.rs @@ -1,5 +1,5 @@ -use blockifier::block_context::GasPrices; -use cairo_vm_blockifier::vm::runners::{ +use blockifier::blockifier::block::GasPrices; +use cairo_vm::vm::runners::{ builtin_runner::{ BITWISE_BUILTIN_NAME, EC_OP_BUILTIN_NAME, HASH_BUILTIN_NAME, KECCAK_BUILTIN_NAME, OUTPUT_BUILTIN_NAME, POSEIDON_BUILTIN_NAME, RANGE_CHECK_BUILTIN_NAME, @@ -19,7 +19,7 @@ use starknet_api::{ state::StorageKey, transaction::{Transaction as SNTransaction, TransactionHash}, }; -use std::{collections::HashMap, env, fmt::Display}; +use std::{collections::HashMap, env, fmt::Display, num::NonZeroU128}; use crate::{rpc_state_errors::RpcStateError, utils}; @@ -397,6 +397,10 @@ impl RpcState { &self, hash: &TransactionHash, ) -> Result { + dbg!(&self.rpc_call::( + "starknet_traceTransaction", + &json!([hash.to_string()]) + )); let result = self .rpc_call::("starknet_traceTransaction", &json!([hash.to_string()]))? .get("result") @@ -415,11 +419,18 @@ impl RpcState { .get("result") .ok_or(RpcStateError::MissingRpcResponseField("result".into()))? .clone(); + + dbg!(&result); utils::deserialize_transaction_json(result).map_err(RpcStateError::SerdeJson) } /// Gets the gas price of a given block. pub fn get_gas_price(&self, block_number: u64) -> Result { + // dbg!(self + // .rpc_call::( + // "starknet_getBlockWithTxHashes", + // &json!({"block_id" : { "block_number": block_number }}), + // )?); let res = self .rpc_call::( "starknet_getBlockWithTxHashes", @@ -429,6 +440,8 @@ impl RpcState { .ok_or(RpcStateError::MissingRpcResponseField("result".into()))? .clone(); + dbg!(1); + let gas_price_eth = u128::from_str_radix( res.get("l1_gas_price") .and_then(|gp| gp.get("price_in_wei")) @@ -441,6 +454,8 @@ impl RpcState { ) .map_err(|_| RpcStateError::RpcResponseWrongType("gas_price".to_string()))?; + dbg!(2); + let gas_price_strk = u128::from_str_radix( res.get("l1_gas_price") .and_then(|gp| gp.get("price_in_fri")) @@ -453,9 +468,46 @@ impl RpcState { ) .map_err(|_| RpcStateError::RpcResponseWrongType("gas_price".to_string()))?; + dbg!(3); + + let l1_data_gas_price_strk = u128::from_str_radix( + res.get("l1_data_gas_price") + .and_then(|gp| gp.get("price_in_fri")) + .and_then(|gp| gp.as_str()) + .ok_or(RpcStateError::MissingRpcResponseField( + "l1_data_gas_price.price_in_fri".to_string(), + ))? + .trim_start_matches("0x"), + 16, + ) + .map_err(|_| RpcStateError::RpcResponseWrongType("l1_data_gas_price".to_string()))?; + + dbg!(4); + + let l1_data_gas_price_wei = u128::from_str_radix( + res.get("l1_data_gas_price") + .and_then(|gp| gp.get("price_in_wei")) + .and_then(|gp| gp.as_str()) + .ok_or(RpcStateError::MissingRpcResponseField( + "l1_data_gas_price.l1_data_gas_price_wei".to_string(), + ))? + .trim_start_matches("0x"), + 16, + ) + .map_err(|_| RpcStateError::RpcResponseWrongType("l1_data_gas_price".to_string()))?; + + dbg!(5); + + // TODO check 0 wei/strk Ok(GasPrices { - eth_l1_gas_price: gas_price_eth, - strk_l1_gas_price: gas_price_strk, + eth_l1_gas_price: NonZeroU128::new(gas_price_eth) + .unwrap_or(NonZeroU128::new(1).unwrap()), + strk_l1_gas_price: NonZeroU128::new(gas_price_strk) + .unwrap_or(NonZeroU128::new(1).unwrap()), + eth_l1_data_gas_price: NonZeroU128::new(l1_data_gas_price_wei) + .unwrap_or(NonZeroU128::new(1).unwrap()), + strk_l1_data_gas_price: NonZeroU128::new(l1_data_gas_price_strk) + .unwrap_or(NonZeroU128::new(1).unwrap()), }) } diff --git a/rpc-state-reader/src/utils.rs b/rpc-state-reader/src/utils.rs index ced0663..e2b654d 100644 --- a/rpc-state-reader/src/utils.rs +++ b/rpc-state-reader/src/utils.rs @@ -3,7 +3,7 @@ use std::{ io::{self, Read}, }; -use cairo_lang_starknet::contract_class::ContractEntryPoints; +use cairo_lang_starknet_classes::contract_class::ContractEntryPoints; use cairo_lang_utils::bigint::BigUintAsHex; use serde::Deserialize; use starknet::core::types::{LegacyContractEntryPoint, LegacyEntryPointsByType}; From c23847b2e1aae93f3d60c107f530551e6ae4d450 Mon Sep 17 00:00:00 2001 From: Pedro Fontana Date: Wed, 5 Jun 2024 16:53:50 -0300 Subject: [PATCH 4/6] fix test compilation --- .../src/blockifier_state_reader.rs | 6 +----- rpc-state-reader/src/rpc_state.rs | 20 ------------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/rpc-state-reader/src/blockifier_state_reader.rs b/rpc-state-reader/src/blockifier_state_reader.rs index b4c0f6d..b990a0c 100644 --- a/rpc-state-reader/src/blockifier_state_reader.rs +++ b/rpc-state-reader/src/blockifier_state_reader.rs @@ -148,7 +148,6 @@ pub fn execute_tx( let tx_hash = TransactionHash(stark_felt!(tx_hash)); let sn_api_tx = rpc_reader.0.get_transaction(&tx_hash); - dbg!(&rpc_reader.0.get_transaction_trace(&tx_hash)); let trace = rpc_reader.0.get_transaction_trace(&tx_hash).unwrap(); let receipt = rpc_reader.0.get_transaction_receipt(&tx_hash).unwrap(); @@ -213,10 +212,8 @@ pub fn execute_tx( // }; // Map starknet_api transaction to blockifier's - dbg!(&sn_api_tx); let blockifier_tx: AccountTransaction = match sn_api_tx.unwrap() { SNTransaction::Invoke(tx) => { - dbg!(&tx); let invoke = InvokeTransaction { tx, tx_hash, @@ -296,6 +293,7 @@ mod tests { use crate::rpc_state::BlockValue; use super::*; + use blockifier::execution::call_info::CallInfo; use test_case::test_case; #[test] fn test_get_gas_price() { @@ -641,8 +639,6 @@ mod tests { // todo: check this tests fn starknet_in_rust_vs_blockifier_tx(hash: &str, block_number: u64, chain: RpcChain) { // Execute using blockifier - - use blockifier::execution::call_info::CallInfo; let (blockifier_tx_info, _, _) = execute_tx(hash, chain, BlockNumber(block_number)); let (blockifier_fee, blockifier_resources) = { diff --git a/rpc-state-reader/src/rpc_state.rs b/rpc-state-reader/src/rpc_state.rs index 58a2c70..88f2757 100644 --- a/rpc-state-reader/src/rpc_state.rs +++ b/rpc-state-reader/src/rpc_state.rs @@ -397,10 +397,6 @@ impl RpcState { &self, hash: &TransactionHash, ) -> Result { - dbg!(&self.rpc_call::( - "starknet_traceTransaction", - &json!([hash.to_string()]) - )); let result = self .rpc_call::("starknet_traceTransaction", &json!([hash.to_string()]))? .get("result") @@ -420,17 +416,11 @@ impl RpcState { .ok_or(RpcStateError::MissingRpcResponseField("result".into()))? .clone(); - dbg!(&result); utils::deserialize_transaction_json(result).map_err(RpcStateError::SerdeJson) } /// Gets the gas price of a given block. pub fn get_gas_price(&self, block_number: u64) -> Result { - // dbg!(self - // .rpc_call::( - // "starknet_getBlockWithTxHashes", - // &json!({"block_id" : { "block_number": block_number }}), - // )?); let res = self .rpc_call::( "starknet_getBlockWithTxHashes", @@ -440,8 +430,6 @@ impl RpcState { .ok_or(RpcStateError::MissingRpcResponseField("result".into()))? .clone(); - dbg!(1); - let gas_price_eth = u128::from_str_radix( res.get("l1_gas_price") .and_then(|gp| gp.get("price_in_wei")) @@ -454,8 +442,6 @@ impl RpcState { ) .map_err(|_| RpcStateError::RpcResponseWrongType("gas_price".to_string()))?; - dbg!(2); - let gas_price_strk = u128::from_str_radix( res.get("l1_gas_price") .and_then(|gp| gp.get("price_in_fri")) @@ -468,8 +454,6 @@ impl RpcState { ) .map_err(|_| RpcStateError::RpcResponseWrongType("gas_price".to_string()))?; - dbg!(3); - let l1_data_gas_price_strk = u128::from_str_radix( res.get("l1_data_gas_price") .and_then(|gp| gp.get("price_in_fri")) @@ -482,8 +466,6 @@ impl RpcState { ) .map_err(|_| RpcStateError::RpcResponseWrongType("l1_data_gas_price".to_string()))?; - dbg!(4); - let l1_data_gas_price_wei = u128::from_str_radix( res.get("l1_data_gas_price") .and_then(|gp| gp.get("price_in_wei")) @@ -496,8 +478,6 @@ impl RpcState { ) .map_err(|_| RpcStateError::RpcResponseWrongType("l1_data_gas_price".to_string()))?; - dbg!(5); - // TODO check 0 wei/strk Ok(GasPrices { eth_l1_gas_price: NonZeroU128::new(gas_price_eth) From 203c0dd82ce4f2afea6610fd5f0d03b08f918128 Mon Sep 17 00:00:00 2001 From: Pedro Fontana Date: Fri, 7 Jun 2024 18:16:19 -0300 Subject: [PATCH 5/6] Remove gas_check && BlockContext::new_unchecked --- rpc-state-reader/src/blockifier_state_reader.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/rpc-state-reader/src/blockifier_state_reader.rs b/rpc-state-reader/src/blockifier_state_reader.rs index b990a0c..734bae0 100644 --- a/rpc-state-reader/src/blockifier_state_reader.rs +++ b/rpc-state-reader/src/blockifier_state_reader.rs @@ -188,8 +188,12 @@ pub fn execute_tx( fee_token_addresses: FeeTokenAddresses::default(), }; - let block_context = - BlockContext::new_unchecked(&block_info, &chain_info, &VersionedConstants::default()); + // TODO: Check BlockContext::new_unchecked + let block_context = BlockContext::new_unchecked( + &block_info, + &chain_info, + &VersionedConstants::latest_constants_with_overrides(u32::MAX, usize::MAX), + ); // let block_context = BlockContext { // chain_id, // block_number, @@ -269,8 +273,9 @@ pub fn execute_tx( }; ( + // Change charge_fee: true blockifier_tx - .execute(&mut state, &block_context, true, true) + .execute(&mut state, &block_context, false, true) .unwrap(), trace, receipt, @@ -634,6 +639,11 @@ mod tests { "0x41497e62fb6798ff66e4ad736121c0164cdb74005aa5dab025be3d90ad4ba06", 638866, // real block 475946 RpcChain::MainNet +)] + #[test_case( + "0x7805c2bf5abaf4fe0eb1db7b7be0486a14757b4bf96634c828d11c07e4a763c", + 641975, // real block 475946 + RpcChain::MainNet )] #[cfg(not(feature = "cairo-native"))] // todo: check this tests From 412e6fe07a90538d1109db20a63eaf7f25bcbb2b Mon Sep 17 00:00:00 2001 From: Pedro Fontana Date: Mon, 10 Jun 2024 16:08:04 -0300 Subject: [PATCH 6/6] Change l1_gas, l2_gas to L1_GAS, L2_GAS --- rpc-state-reader/src/blockifier_state_reader.rs | 4 ++-- rpc-state-reader/src/rpc_state.rs | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/rpc-state-reader/src/blockifier_state_reader.rs b/rpc-state-reader/src/blockifier_state_reader.rs index 734bae0..20aa593 100644 --- a/rpc-state-reader/src/blockifier_state_reader.rs +++ b/rpc-state-reader/src/blockifier_state_reader.rs @@ -273,9 +273,9 @@ pub fn execute_tx( }; ( - // Change charge_fee: true + // TODO Change charge_fee: true blockifier_tx - .execute(&mut state, &block_context, false, true) + .execute(&mut state, &block_context, true, true) .unwrap(), trace, receipt, diff --git a/rpc-state-reader/src/rpc_state.rs b/rpc-state-reader/src/rpc_state.rs index 88f2757..c3dfd63 100644 --- a/rpc-state-reader/src/rpc_state.rs +++ b/rpc-state-reader/src/rpc_state.rs @@ -10,7 +10,7 @@ use cairo_vm::vm::runners::{ use core::fmt; use dotenv::dotenv; use serde::{Deserialize, Deserializer}; -use serde_json::json; +use serde_json::{json, Value}; use starknet::core::types::ContractClass as SNContractClass; use starknet_api::{ block::{BlockNumber, BlockTimestamp}, @@ -407,7 +407,7 @@ impl RpcState { /// Requests the given transaction to the Feeder Gateway API. pub fn get_transaction(&self, hash: &TransactionHash) -> Result { - let result = self + let mut result = self .rpc_call::( "starknet_getTransactionByHash", &json!([hash.to_string()]), @@ -416,6 +416,17 @@ impl RpcState { .ok_or(RpcStateError::MissingRpcResponseField("result".into()))? .clone(); + if let Some(resource_bounds) = result.get_mut("resource_bounds") { + if let Some(l1_gas) = resource_bounds.get_mut("l1_gas") { + resource_bounds["L1_GAS"] = l1_gas.clone(); + resource_bounds.as_object_mut().unwrap().remove("l1_gas"); + } + if let Some(l2_gas) = resource_bounds.get_mut("l2_gas") { + resource_bounds["L2_GAS"] = l2_gas.clone(); + resource_bounds.as_object_mut().unwrap().remove("l2_gas"); + } + } + utils::deserialize_transaction_json(result).map_err(RpcStateError::SerdeJson) }