From 576657b7014e03cb49f1e23724e2274414a041c4 Mon Sep 17 00:00:00 2001 From: 0xevolve Date: Wed, 22 May 2024 15:19:27 +0100 Subject: [PATCH 1/2] feat: add katana-runner --- .github/workflows/rust.yml | 20 +- rust/Cargo.lock | 1674 +++++++++++++++++++++++++++- rust/Cargo.toml | 1 + rust/tests/contracts/strk/mod.rs | 2 +- rust/tests/contracts/strk/setup.rs | 13 +- rust/tests/contracts/strk/types.rs | 7 +- rust/tests/contracts/strk/utils.rs | 90 +- rust/tests/mailbox.rs | 17 +- rust/tests/validator.rs | 1 - 9 files changed, 1664 insertions(+), 161 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 265dd27..8aca59c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -38,24 +38,8 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 - - name: Run katana + - name: Run integration tests run: | - katana -b 1000 & - - - name: Run evm -> strk test - run: | - cd rust && cargo test -- test_mailbox_evm_to_strk - - - name: Kill katana - run: | - pkill katana - - - name: run katana - run: | - katana -b 1000 & - - - name: Run strk -> evm test - run: | - cd rust && cargo test -- test_mailbox_strk_to_evm + cd rust && cargo test \ No newline at end of file diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 788055c..8ae9bb7 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -65,6 +65,23 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "alloy-primitives" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8aa973e647ec336810a9356af8aea787249c9d00b1525359f3db29a68d231b" +dependencies = [ + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "hex-literal", + "itoa", + "ruint", + "serde", + "tiny-keccak", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -217,6 +234,21 @@ dependencies = [ "term", ] +[[package]] +name = "assert_fs" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cd762e110c8ed629b11b6cde59458cc1c71de78ebbcc30099fc8e0403a2a2ec" +dependencies = [ + "anstyle", + "doc-comment", + "globwalk", + "predicates", + "predicates-core", + "predicates-tree", + "tempfile", +] + [[package]] name = "assert_matches" version = "1.5.0" @@ -295,6 +327,12 @@ 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" @@ -319,6 +357,55 @@ 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.68.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.63", +] + +[[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.10.5", + "lazy_static", + "lazycell", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.63", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -377,6 +464,16 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "bstr" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "bumpalo" version = "3.16.0" @@ -389,6 +486,12 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" +[[package]] +name = "bytemuck" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" + [[package]] name = "byteorder" version = "1.5.0" @@ -439,7 +542,7 @@ dependencies = [ "camino", "clap", "clap_complete", - "convert_case", + "convert_case 0.6.0", "serde", "serde_json", "starknet", @@ -463,7 +566,7 @@ name = "cainome-parser" version = "0.1.0" source = "git+https://github.com/cartridge-gg/cainome?tag=v0.2.9#33f054dadad4df7e7cd16a73bb75a2f90620d5ea" dependencies = [ - "convert_case", + "convert_case 0.6.0", "quote", "serde_json", "starknet", @@ -533,6 +636,67 @@ dependencies = [ "serde", ] +[[package]] +name = "cairo-lang-compiler" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7148cb2d72a3db24a6d2ef2b2602102cc5099cb9f6b913e5047fb009cb3a22a1" +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", + "smol_str", + "thiserror", +] + +[[package]] +name = "cairo-lang-debug" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a761eb8e31ea65a2dd45f729c74f1770315f97124dad93d1f6853a10d460c6b" +dependencies = [ + "cairo-lang-utils", +] + +[[package]] +name = "cairo-lang-defs" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6d60bc5d72fe7a95ba34e041dcbdf1cf3bfccb87008a515514b74913fa8ff05" +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.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "356089e1b0a0ba9e115566191745613b3806a20259ad76764df82ab534d5412a" +dependencies = [ + "cairo-lang-debug", + "cairo-lang-filesystem", + "cairo-lang-utils", + "itertools 0.11.0", +] + [[package]] name = "cairo-lang-eq-solver" version = "2.6.3" @@ -543,6 +707,134 @@ dependencies = [ "good_lp", ] +[[package]] +name = "cairo-lang-filesystem" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bcb9a4a40e53fa099774bd08bbcc3430f51213cc7fb1b50c2e9d01155731798" +dependencies = [ + "cairo-lang-debug", + "cairo-lang-utils", + "path-clean", + "salsa", + "serde", + "smol_str", +] + +[[package]] +name = "cairo-lang-lowering" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba60e1e2477aa0f610ccf29189097d580464607c94b51741e1c18e64d6cee5f" +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.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f16ba1535e0cc5e79c2eff6592859bbdac03dc53d4dcdd26dbdbc04a77c3f5c" +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.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81c8cf6e0ee3d6b19429cc1663738b22f1ecea7d51bf7452e8e1086f08798baf" +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.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67f9da66325ce7ed6c002360f26106fe79deb9f8a2fca30abdbb8d388da7bb46" +dependencies = [ + "cairo-lang-debug", + "quote", + "syn 2.0.63", +] + +[[package]] +name = "cairo-lang-project" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e198af1ab3d05c7fb8b6a9a7a2e9bce245a6c855df5f770b751d29874a23b152" +dependencies = [ + "cairo-lang-filesystem", + "cairo-lang-utils", + "serde", + "smol_str", + "thiserror", + "toml", +] + +[[package]] +name = "cairo-lang-semantic" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7df81521c2125e3e95b683cc99374db1aebd7ddb317c5ca3dd92a235a9eb13" +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.6.3" @@ -553,7 +845,7 @@ dependencies = [ "cairo-felt", "cairo-lang-utils", "const-fnv1a-hash", - "convert_case", + "convert_case 0.6.0", "derivative", "itertools 0.11.0", "lalrpop", @@ -599,6 +891,29 @@ dependencies = [ "thiserror", ] +[[package]] +name = "cairo-lang-sierra-generator" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e1d75e0830279ca1bd0189e3326720d6e081225f7d81ed060bbd22c6b37e980" +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-traits 0.2.19", + "once_cell", + "salsa", + "smol_str", +] + [[package]] name = "cairo-lang-sierra-to-casm" version = "2.6.3" @@ -630,6 +945,37 @@ dependencies = [ "cairo-lang-utils", ] +[[package]] +name = "cairo-lang-starknet" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9ffa8b3b8c47138c36b1907cebb5047dfc4de29ec10ece5bd6d6853243ec50" +dependencies = [ + "anyhow", + "cairo-felt", + "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-starknet-classes", + "cairo-lang-syntax", + "cairo-lang-utils", + "const_format", + "indent", + "indoc", + "itertools 0.11.0", + "once_cell", + "serde", + "serde_json", + "smol_str", + "thiserror", +] + [[package]] name = "cairo-lang-starknet-classes" version = "2.6.3" @@ -641,7 +987,7 @@ dependencies = [ "cairo-lang-sierra", "cairo-lang-sierra-to-casm", "cairo-lang-utils", - "convert_case", + "convert_case 0.6.0", "itertools 0.11.0", "num-bigint", "num-integer", @@ -651,10 +997,36 @@ dependencies = [ "serde_json", "sha3", "smol_str", - "starknet-crypto", + "starknet-crypto 0.6.2", "thiserror", ] +[[package]] +name = "cairo-lang-syntax" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8262c426a57e1e5ec297db24278464841500613445e2cb1c43d5f71ad91ee8d6" +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-utils" version = "2.6.3" @@ -670,6 +1042,37 @@ dependencies = [ "serde", ] +[[package]] +name = "cairo-vm" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd569684da80d747273613d5c809e4f81bf6f6b1b64d0301b12bac8f2fb8ffb1" +dependencies = [ + "anyhow", + "bincode", + "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 = "camino" version = "1.1.7" @@ -713,6 +1116,15 @@ dependencies = [ "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" @@ -727,8 +1139,10 @@ checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", + "js-sys", "num-traits 0.2.19", "serde", + "wasm-bindgen", "windows-targets 0.52.5", ] @@ -742,6 +1156,17 @@ dependencies = [ "inout", ] +[[package]] +name = "clang-sys" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clap" version = "4.5.4" @@ -791,6 +1216,12 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + [[package]] name = "coins-bip32" version = "0.8.7" @@ -849,6 +1280,16 @@ 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 = "const-fnv1a-hash" version = "1.1.0" @@ -874,12 +1315,38 @@ 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" @@ -1063,11 +1530,19 @@ 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 = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + [[package]] name = "digest" version = "0.10.7" @@ -1122,6 +1597,31 @@ dependencies = [ "winapi", ] +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "dojo-metrics" +version = "0.7.0-alpha.3" +source = "git+https://github.com/dojoengine/dojo?branch=main#bec687bb2c22cfa8a22878c7b8b2a7e96e46ecd0" +dependencies = [ + "anyhow", + "hyper 0.14.28", + "jemalloc-ctl", + "jemallocator", + "metrics", + "metrics-exporter-prometheus", + "metrics-process", + "metrics-util", + "reth-metrics-derive", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "dunce" version = "1.0.4" @@ -1173,6 +1673,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + [[package]] name = "ena" version = "0.14.3" @@ -1191,6 +1697,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + [[package]] name = "enr" version = "0.10.0" @@ -1358,7 +1870,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "syn 2.0.63", @@ -1404,7 +1916,7 @@ dependencies = [ "rlp", "serde", "serde_json", - "strum", + "strum 0.26.2", "syn 2.0.63", "tempfile", "thiserror", @@ -1420,7 +1932,7 @@ checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" dependencies = [ "chrono", "ethers-core", - "reqwest", + "reqwest 0.11.27", "semver", "serde", "serde_json", @@ -1445,7 +1957,7 @@ dependencies = [ "futures-locks", "futures-util", "instant", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "thiserror", @@ -1472,12 +1984,12 @@ dependencies = [ "futures-timer", "futures-util", "hashers", - "http", + "http 0.2.12", "instant", "jsonwebtoken", "once_cell", "pin-project", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "thiserror", @@ -1746,6 +2258,28 @@ dependencies = [ "byteorder", ] +[[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.63", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1782,6 +2316,30 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +[[package]] +name = "globset" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", +] + +[[package]] +name = "globwalk" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf760ebf69878d9fd8f110c89703d90ce35095324d1f1edcb595c63945ee757" +dependencies = [ + "bitflags 2.5.0", + "ignore", + "walkdir", +] + [[package]] name = "gloo-timers" version = "0.2.6" @@ -1826,7 +2384,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.12", "indexmap 2.2.6", "slab", "tokio", @@ -1840,6 +2398,15 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ff8ae62cd3a9102e5637afc8452c55acf3844001bd5374e0b0bd7b6616c038" +dependencies = [ + "ahash", +] + [[package]] name = "hashbrown" version = "0.14.5" @@ -1892,6 +2459,15 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hmac" @@ -1922,6 +2498,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http-body" version = "0.4.6" @@ -1929,7 +2516,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +dependencies = [ + "bytes", + "futures-core", + "http 1.1.0", + "http-body 1.0.0", "pin-project-lite", ] @@ -1956,8 +2566,8 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -1969,6 +2579,25 @@ dependencies = [ "want", ] +[[package]] +name = "hyper" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + [[package]] name = "hyper-rustls" version = "0.24.2" @@ -1976,11 +2605,48 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http", - "hyper", - "rustls", + "http 0.2.12", + "hyper 0.14.28", + "rustls 0.21.12", + "tokio", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.3.1", + "hyper-util", + "rustls 0.22.4", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.25.0", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "hyper 1.3.1", + "pin-project-lite", + "socket2", "tokio", - "tokio-rustls", + "tower", + "tower-service", + "tracing", ] [[package]] @@ -1995,6 +2661,7 @@ dependencies = [ "eyre", "futures", "k256", + "katana-runner", "rstest", "serde", "serde_json", @@ -2027,6 +2694,12 @@ 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" @@ -2043,6 +2716,22 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "ignore" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata 0.4.6", + "same-file", + "walkdir", + "winapi-util", +] + [[package]] name = "impl-codec" version = "0.6.0" @@ -2081,6 +2770,12 @@ dependencies = [ "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 = "indenter" version = "0.3.3" @@ -2169,6 +2864,37 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jemalloc-ctl" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cffc705424a344c054e135d12ee591402f4539245e8bbd64e6c9eaa9458b63c" +dependencies = [ + "jemalloc-sys", + "libc", + "paste", +] + +[[package]] +name = "jemalloc-sys" +version = "0.5.4+5.3.0-patched" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac6c1946e1cea1788cbfde01c993b52a10e2da07f4bac608228d1bed20bfebf2" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "jemallocator" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0de374a9f8e63150e6f5e8a60cc14c668226d7a347d8aee1a45766e3c4dd3bc" +dependencies = [ + "jemalloc-sys", + "libc", +] + [[package]] name = "jobserver" version = "0.1.31" @@ -2215,6 +2941,158 @@ dependencies = [ "signature", ] +[[package]] +name = "katana-core" +version = "0.7.0-alpha.3" +source = "git+https://github.com/dojoengine/dojo?branch=main#bec687bb2c22cfa8a22878c7b8b2a7e96e46ecd0" +dependencies = [ + "alloy-primitives", + "anyhow", + "async-trait", + "cairo-lang-casm", + "cairo-lang-starknet", + "cairo-vm", + "convert_case 0.6.0", + "derive_more", + "dojo-metrics", + "flate2", + "futures", + "k256", + "katana-db", + "katana-executor", + "katana-primitives", + "katana-provider", + "katana-tasks", + "lazy_static", + "metrics", + "parking_lot 0.12.2", + "rand", + "reqwest 0.12.4", + "serde", + "serde_json", + "serde_with", + "starknet", + "starknet_api", + "thiserror", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "katana-db" +version = "0.7.0-alpha.3" +source = "git+https://github.com/dojoengine/dojo?branch=main#bec687bb2c22cfa8a22878c7b8b2a7e96e46ecd0" +dependencies = [ + "anyhow", + "cairo-vm", + "katana-primitives", + "page_size", + "parking_lot 0.12.2", + "postcard", + "reth-libmdbx", + "roaring", + "serde", + "serde_json", + "starknet_api", + "tempfile", + "thiserror", +] + +[[package]] +name = "katana-executor" +version = "0.7.0-alpha.3" +source = "git+https://github.com/dojoengine/dojo?branch=main#bec687bb2c22cfa8a22878c7b8b2a7e96e46ecd0" +dependencies = [ + "alloy-primitives", + "convert_case 0.6.0", + "futures", + "katana-primitives", + "katana-provider", + "parking_lot 0.12.2", + "serde_json", + "starknet", + "starknet_api", + "thiserror", + "tracing", +] + +[[package]] +name = "katana-primitives" +version = "0.7.0-alpha.3" +source = "git+https://github.com/dojoengine/dojo?branch=main#bec687bb2c22cfa8a22878c7b8b2a7e96e46ecd0" +dependencies = [ + "alloy-primitives", + "anyhow", + "base64 0.21.7", + "cairo-lang-sierra", + "cairo-lang-starknet", + "cairo-lang-starknet-classes", + "cairo-vm", + "derive_more", + "flate2", + "lazy_static", + "rand", + "rayon", + "serde", + "serde_json", + "serde_with", + "starknet", + "starknet-crypto 0.6.2", + "starknet_api", + "strum 0.25.0", + "strum_macros 0.25.3", + "thiserror", +] + +[[package]] +name = "katana-provider" +version = "0.7.0-alpha.3" +source = "git+https://github.com/dojoengine/dojo?branch=main#bec687bb2c22cfa8a22878c7b8b2a7e96e46ecd0" +dependencies = [ + "anyhow", + "auto_impl", + "futures", + "katana-db", + "katana-primitives", + "parking_lot 0.12.2", + "starknet", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "katana-runner" +version = "0.7.0-alpha.3" +source = "git+https://github.com/dojoengine/dojo?branch=main#bec687bb2c22cfa8a22878c7b8b2a7e96e46ecd0" +dependencies = [ + "anyhow", + "assert_fs", + "chrono", + "home", + "katana-core", + "katana-primitives", + "lazy_static", + "runner-macro", + "serde", + "serde_json", + "starknet", + "tokio", + "url", +] + +[[package]] +name = "katana-tasks" +version = "0.7.0-alpha.3" +source = "git+https://github.com/dojoengine/dojo?branch=main#bec687bb2c22cfa8a22878c7b8b2a7e96e46ecd0" +dependencies = [ + "futures", + "rayon", + "thiserror", + "tokio", +] + [[package]] name = "keccak" version = "0.1.5" @@ -2264,18 +3142,55 @@ 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.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +[[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.48.5", +] + [[package]] name = "libm" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[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 = "libproc" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae9ea4b75e1a81675429dafe43441df1caea70081e82246a8cccf514884a88bb" +dependencies = [ + "bindgen 0.69.4", + "errno", + "libc", +] + [[package]] name = "libredox" version = "0.1.3" @@ -2308,6 +3223,24 @@ version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +[[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 = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + [[package]] name = "matchers" version = "0.1.0" @@ -2342,6 +3275,89 @@ version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +[[package]] +name = "metrics" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fde3af1a009ed76a778cb84fdef9e7dbbdf5775ae3e4cc1f434a6a307f6f76c5" +dependencies = [ + "ahash", + "metrics-macros", + "portable-atomic", +] + +[[package]] +name = "metrics-exporter-prometheus" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d4fa7ce7c4862db464a37b0b31d89bca874562f034bd7993895572783d02950" +dependencies = [ + "base64 0.21.7", + "hyper 0.14.28", + "indexmap 1.9.3", + "ipnet", + "metrics", + "metrics-util", + "quanta", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "metrics-macros" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b4faf00617defe497754acde3024865bc143d44a86799b24e191ecff91354f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.63", +] + +[[package]] +name = "metrics-process" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aa2a67e2580fbeba4d5a96e659945981e700a383b4cea1432e0cfc18f58c5da" +dependencies = [ + "libproc", + "mach2", + "metrics", + "once_cell", + "procfs", + "rlimit", + "windows", +] + +[[package]] +name = "metrics-util" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4de2ed6e491ed114b40b732e4d1659a9d53992ebd87490c44a6ffe23739d973e" +dependencies = [ + "aho-corasick", + "crossbeam-epoch", + "crossbeam-utils", + "hashbrown 0.13.1", + "indexmap 1.9.3", + "metrics", + "num_cpus", + "ordered-float", + "quanta", + "radix_trie", + "sketches-ddsketch", +] + +[[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" @@ -2358,6 +3374,12 @@ dependencies = [ "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.2" @@ -2397,6 +3419,25 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[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" @@ -2415,6 +3456,7 @@ checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ "num-integer", "num-traits 0.2.19", + "rand", "serde", ] @@ -2443,6 +3485,33 @@ 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", + "num-bigint", + "num-integer", + "num-modular", + "num-traits 0.2.19", + "rand", +] + [[package]] name = "num-traits" version = "0.1.43" @@ -2545,12 +3614,31 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "ordered-float" +version = "3.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" +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 = "page_size" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "parity-scale-codec" version = "3.6.12" @@ -2642,6 +3730,12 @@ 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 = "path-slash" version = "0.2.1" @@ -2670,6 +3764,12 @@ dependencies = [ "hmac", ] +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + [[package]] name = "pem" version = "1.1.1" @@ -2810,6 +3910,23 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + +[[package]] +name = "postcard" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" +dependencies = [ + "cobs", + "embedded-io", + "serde", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -2828,6 +3945,33 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +[[package]] +name = "predicates" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b87bfd4605926cdfefc1c3b5f8fe560e3feca9d5552cf68c466d3d8236c7e8" +dependencies = [ + "anstyle", + "difflib", + "predicates-core", +] + +[[package]] +name = "predicates-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + +[[package]] +name = "predicates-tree" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +dependencies = [ + "predicates-core", + "termtree", +] + [[package]] name = "prettyplease" version = "0.2.20" @@ -2870,6 +4014,29 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "procfs" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" +dependencies = [ + "bitflags 2.5.0", + "hex", + "lazy_static", + "procfs-core", + "rustix", +] + +[[package]] +name = "procfs-core" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" +dependencies = [ + "bitflags 2.5.0", + "hex", +] + [[package]] name = "proptest" version = "1.4.0" @@ -2886,6 +4053,22 @@ dependencies = [ "unarray", ] +[[package]] +name = "quanta" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" +dependencies = [ + "crossbeam-utils", + "libc", + "mach2", + "once_cell", + "raw-cpuid", + "wasi", + "web-sys", + "winapi", +] + [[package]] name = "quote" version = "1.0.36" @@ -2901,6 +4084,16 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + [[package]] name = "rand" version = "0.8.5" @@ -2940,6 +4133,15 @@ dependencies = [ "rand_core", ] +[[package]] +name = "raw-cpuid" +version = "10.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "rawpointer" version = "0.2.1" @@ -3056,11 +4258,53 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", + "h2", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", + "hyper-rustls 0.24.2", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls 0.21.12", + "rustls-pemfile 1.0.4", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-rustls 0.24.1", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 0.25.4", + "winreg 0.50.0", +] + +[[package]] +name = "reqwest" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-rustls 0.26.0", + "hyper-util", "ipnet", "js-sys", "log", @@ -3068,22 +4312,59 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", - "rustls-pemfile", + "rustls 0.22.4", + "rustls-pemfile 2.1.2", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-rustls", + "tokio-rustls 0.25.0", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", - "winreg", + "webpki-roots 0.26.1", + "winreg 0.52.0", +] + +[[package]] +name = "reth-libmdbx" +version = "0.1.0-alpha.13" +source = "git+https://github.com/paradigmxyz/reth.git?rev=b34b0d3#b34b0d3c8de2598b2976f7ee2fc1a166c50b1b94" +dependencies = [ + "bitflags 2.5.0", + "byteorder", + "derive_more", + "indexmap 2.2.6", + "libc", + "parking_lot 0.12.2", + "reth-mdbx-sys", + "thiserror", +] + +[[package]] +name = "reth-mdbx-sys" +version = "0.1.0-alpha.13" +source = "git+https://github.com/paradigmxyz/reth.git?rev=b34b0d3#b34b0d3c8de2598b2976f7ee2fc1a166c50b1b94" +dependencies = [ + "bindgen 0.68.1", + "cc", + "libc", +] + +[[package]] +name = "reth-metrics-derive" +version = "0.2.0-beta.4" +source = "git+https://github.com/paradigmxyz/reth.git?tag=v0.2.0-beta.4#c04dbe6e9bd05be5da3a5d541adbf76166c14a08" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "regex", + "syn 2.0.63", ] [[package]] @@ -3135,6 +4416,15 @@ dependencies = [ "digest", ] +[[package]] +name = "rlimit" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3560f70f30a0f16d11d01ed078a07740fe6b489667abc7c7b029155d9f21c3d8" +dependencies = [ + "libc", +] + [[package]] name = "rlp" version = "0.5.2" @@ -3157,6 +4447,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "roaring" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b26f4c25a604fcb3a1bcd96dd6ba37c93840de95de8198d94c0d571a74a804d1" +dependencies = [ + "bytemuck", + "byteorder", + "serde", +] + [[package]] name = "rstest" version = "0.18.2" @@ -3186,6 +4487,35 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "ruint" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f308135fef9fc398342da5472ce7c484529df23743fb7c734e0f3d472971e62" +dependencies = [ + "proptest", + "rand", + "ruint-macro", + "serde", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" + +[[package]] +name = "runner-macro" +version = "0.7.0-alpha.3" +source = "git+https://github.com/dojoengine/dojo?branch=main#bec687bb2c22cfa8a22878c7b8b2a7e96e46ecd0" +dependencies = [ + "quote", + "syn 2.0.63", +] + [[package]] name = "rustc-demangle" version = "0.1.24" @@ -3234,10 +4564,24 @@ checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.8", - "rustls-webpki", + "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 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.4", + "subtle", + "zeroize", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -3247,6 +4591,22 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[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" @@ -3257,6 +4617,17 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.17" @@ -3571,6 +4942,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -3608,6 +4985,12 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "sketches-ddsketch" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85636c14b73d81f541e525f585c0a2109e6744e1565b5c1668e31c70c10ed65c" + [[package]] name = "slab" version = "0.4.9" @@ -3698,7 +5081,7 @@ dependencies = [ "starknet-accounts", "starknet-contract", "starknet-core", - "starknet-crypto", + "starknet-crypto 0.6.2", "starknet-ff", "starknet-macros", "starknet-providers", @@ -3748,8 +5131,28 @@ dependencies = [ "serde_json_pythonic", "serde_with", "sha3", - "starknet-crypto", + "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]] @@ -3767,7 +5170,7 @@ dependencies = [ "rfc6979", "sha2", "starknet-crypto-codegen", - "starknet-curve", + "starknet-curve 0.4.2", "starknet-ff", "zeroize", ] @@ -3778,11 +5181,20 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbc159a1934c7be9761c237333a57febe060ace2bc9e3b337a59a37af206d19f" dependencies = [ - "starknet-curve", + "starknet-curve 0.4.2", "starknet-ff", "syn 2.0.63", ] +[[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" @@ -3828,7 +5240,7 @@ dependencies = [ "ethereum-types", "flate2", "log", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "serde_with", @@ -3849,7 +5261,27 @@ dependencies = [ "eth-keystore", "rand", "starknet-core", - "starknet-crypto", + "starknet-crypto 0.6.2", + "thiserror", +] + +[[package]] +name = "starknet_api" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e6aeb260177f5ca6dde788e844825d8d83782905dbac1b24c0c620743284475" +dependencies = [ + "cairo-lang-starknet-classes", + "derive_more", + "hex", + "indexmap 2.2.6", + "once_cell", + "primitive-types", + "serde", + "serde_json", + "starknet-crypto 0.5.2", + "strum 0.24.1", + "strum_macros 0.24.3", "thiserror", ] @@ -3878,13 +5310,51 @@ 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" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" + [[package]] name = "strum" version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ - "strum_macros", + "strum_macros 0.26.2", +] + +[[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 = "strum_macros" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.63", ] [[package]] @@ -3916,7 +5386,7 @@ dependencies = [ "fs2", "hex", "once_cell", - "reqwest", + "reqwest 0.11.27", "semver", "serde", "serde_json", @@ -4004,6 +5474,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "termtree" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" + [[package]] name = "thiserror" version = "1.0.60" @@ -4024,6 +5500,26 @@ dependencies = [ "syn 2.0.63", ] +[[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" @@ -4125,7 +5621,18 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.12", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.4", + "rustls-pki-types", "tokio", ] @@ -4137,11 +5644,11 @@ checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls", + "rustls 0.21.12", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tungstenite", - "webpki-roots", + "webpki-roots 0.25.4", ] [[package]] @@ -4202,6 +5709,28 @@ dependencies = [ "winnow 0.6.8", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -4214,6 +5743,7 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -4307,11 +5837,11 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http", + "http 0.2.12", "httparse", "log", "rand", - "rustls", + "rustls 0.21.12", "sha1", "thiserror", "url", @@ -4342,6 +5872,15 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[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" @@ -4396,6 +5935,7 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] @@ -4539,6 +6079,15 @@ 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 = "winapi" version = "0.3.9" @@ -4570,6 +6119,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core", + "windows-targets 0.52.5", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -4746,6 +6305,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -4774,6 +6343,21 @@ dependencies = [ "tap", ] +[[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 = "yansi" version = "0.5.1" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index d0f7560..ba668d2 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -42,6 +42,7 @@ cainome = { git = "https://github.com/cartridge-gg/cainome", tag = "v0.2.9", fea ] } starknet = "0.10.0" cairo-lang-starknet-classes = "2.6.3" +katana-runner = { git = "https://github.com/dojoengine/dojo", branch = "main" } # eth ethers = "2.0.7" diff --git a/rust/tests/contracts/strk/mod.rs b/rust/tests/contracts/strk/mod.rs index 12456b7..a80b451 100644 --- a/rust/tests/contracts/strk/mod.rs +++ b/rust/tests/contracts/strk/mod.rs @@ -9,5 +9,5 @@ mod utils; pub use bind::*; pub use deploy::*; pub use setup::{setup_env, Env}; -pub use types::StarknetAccount; +pub use types::{StarknetAccount, StarknetProvider}; pub use utils::*; diff --git a/rust/tests/contracts/strk/setup.rs b/rust/tests/contracts/strk/setup.rs index cdafce3..7218dda 100644 --- a/rust/tests/contracts/strk/setup.rs +++ b/rust/tests/contracts/strk/setup.rs @@ -1,11 +1,12 @@ -use std::{collections::BTreeMap, path::PathBuf}; +use std::collections::BTreeMap; +use katana_runner::KatanaRunner; use starknet::core::types::FieldElement; use crate::validator::TestValidators; use super::{ - declare_all, deploy_core, get_dev_account, + declare_all, deploy_core, hook::Hook, ism::prepare_routing_ism, types::{Codes, CoreDeployments}, @@ -35,9 +36,11 @@ impl Env { } pub async fn setup_env(domain: u32, validators: &[TestValidators]) -> eyre::Result { - let owner = get_dev_account(0); - let deployer = get_dev_account(1); - let tester = get_dev_account(2); + let runner = KatanaRunner::new().expect("Fail to set runner"); + + let owner = runner.account(0); + let deployer = runner.account(1); + let tester = runner.account(2); let default_ism = prepare_routing_ism(validators.iter().map(|v| (v.domain, v.clone())).collect()); diff --git a/rust/tests/contracts/strk/types.rs b/rust/tests/contracts/strk/types.rs index d565c61..0bd71d8 100644 --- a/rust/tests/contracts/strk/types.rs +++ b/rust/tests/contracts/strk/types.rs @@ -1,11 +1,14 @@ use std::collections::BTreeMap; use starknet::{ - accounts::SingleOwnerAccount, core::types::FieldElement, providers::AnyProvider, + accounts::SingleOwnerAccount, + core::types::FieldElement, + providers::{jsonrpc::HttpTransport, JsonRpcClient}, signers::LocalWallet, }; -pub type StarknetAccount = SingleOwnerAccount; +pub type StarknetProvider = JsonRpcClient; +pub type StarknetAccount = SingleOwnerAccount; #[derive(serde::Serialize, serde::Deserialize)] pub struct CodesMap(pub BTreeMap); diff --git a/rust/tests/contracts/strk/utils.rs b/rust/tests/contracts/strk/utils.rs index 3f10319..5f9c7b3 100644 --- a/rust/tests/contracts/strk/utils.rs +++ b/rust/tests/contracts/strk/utils.rs @@ -2,7 +2,7 @@ use std::future::Future; use std::sync::Arc; use starknet::{ - accounts::{Account, ConnectedAccount, SingleOwnerAccount}, + accounts::{Account, ConnectedAccount}, contract::ContractFactory, core::types::{ contract::{CompiledClass, SierraClass}, @@ -10,33 +10,16 @@ use starknet::{ InvokeTransactionResult, MaybePendingTransactionReceipt, StarknetError, }, macros::felt, - providers::{jsonrpc::HttpTransport, AnyProvider, JsonRpcClient, Provider, ProviderError, Url}, - signers::{LocalWallet, SigningKey}, + providers::{Provider, ProviderError}, }; -use super::{types::Codes, StarknetAccount}; +use super::{ + types::{Codes, StarknetProvider}, + StarknetAccount, +}; const BUILD_PATH_PREFIX: &str = "../contracts/target/dev/hyperlane_starknet_"; -const KATANA_RPC_URL: &str = "http://localhost:5050"; - -const KATANA_PREFUNDED_ACCOUNTS: [(&str, &str); 3] = [ - ( - "0xb3ff441a68610b30fd5e2abbf3a1548eb6ba6f3559f2862bf2dc757e5828ca", - "0x2bbf4f9fd0bbb2e60b0316c1fe0b76cf7a4d0198bd493ced9b8df2a3a24d68a", - ), - ( - "0xe29882a1fcba1e7e10cad46212257fea5c752a4f9b1b1ec683c503a2cf5c8a", - "0x14d6672dcb4b77ca36a887e9a11cd9d637d5012468175829e9c6e770c61642", - ), - ( - "0x29873c310fbefde666dc32a1554fea6bb45eecc84f680f8a2b0a8fbb8cb89af", - "0xc5b2fcab997346f3ea1c00b002ecf6f382c5f9c9659a3894eb783c5320f912", - ), -]; - -const KATANA_CHAIN_ID: u64 = 82743958523457; - pub async fn assert_poll(f: F, polling_time_ms: u64, max_poll_count: u32) where F: Fn() -> Fut, @@ -56,7 +39,7 @@ where type TransactionReceiptResult = Result; pub async fn get_transaction_receipt( - rpc: &AnyProvider, + rpc: &StarknetProvider, transaction_hash: FieldElement, ) -> TransactionReceiptResult { // there is a delay between the transaction being available at the client @@ -71,65 +54,6 @@ pub async fn get_transaction_receipt( rpc.get_transaction_receipt(transaction_hash).await } -/// Returns a pre-funded account for a local katana chain. -pub fn get_dev_account(index: u32) -> StarknetAccount { - let (address, private_key) = *KATANA_PREFUNDED_ACCOUNTS - .get(index as usize) - .expect("Invalid index"); - - let signer = LocalWallet::from_signing_key(SigningKey::from_secret_scalar( - FieldElement::from_hex_be(&private_key).unwrap(), - )); - - let mut account = build_single_owner_account( - &Url::parse(KATANA_RPC_URL).expect("Invalid rpc url"), - signer, - &FieldElement::from_hex_be(address).unwrap(), - false, - KATANA_CHAIN_ID, - ); - - // `SingleOwnerAccount` defaults to checking nonce and estimating fees against the latest - // block. Optionally change the target block to pending with the following line: - account.set_block_id(BlockId::Tag(BlockTag::Pending)); - - account -} - -/// Creates a single owner account for a given signer and account address. -/// -/// # Arguments -/// -/// * `rpc_url` - The rpc url of the chain. -/// * `signer` - The signer of the account. -/// * `account_address` - The address of the account. -/// * `is_legacy` - Whether the account is legacy (Cairo 0) or not. -/// * `domain_id` - The hyperlane domain id of the chain. -pub fn build_single_owner_account( - rpc_url: &Url, - signer: LocalWallet, - account_address: &FieldElement, - is_legacy: bool, - chain_id: u64, -) -> StarknetAccount { - let rpc_client = - AnyProvider::JsonRpcHttp(JsonRpcClient::new(HttpTransport::new(rpc_url.clone()))); - - let execution_encoding = if is_legacy { - starknet::accounts::ExecutionEncoding::Legacy - } else { - starknet::accounts::ExecutionEncoding::New - }; - - SingleOwnerAccount::new( - rpc_client, - signer, - *account_address, - chain_id.into(), - execution_encoding, - ) -} - /// Get the contract artifact from the build directory. /// # Arguments /// * `path` - The path to the contract artifact. diff --git a/rust/tests/mailbox.rs b/rust/tests/mailbox.rs index 1743fd6..0b62db3 100644 --- a/rust/tests/mailbox.rs +++ b/rust/tests/mailbox.rs @@ -14,14 +14,19 @@ use ethers::{ }; use starknet::{ accounts::{Account, ConnectedAccount}, - core::types::{Event, FieldElement, MaybePendingTransactionReceipt}, - core::utils::get_selector_from_name, - providers::{AnyProvider, Provider}, + core::{ + types::{Event, FieldElement, MaybePendingTransactionReceipt}, + utils::get_selector_from_name, + }, + providers::{jsonrpc::HttpTransport, JsonRpcClient, Provider}, }; use crate::{ constants::{DOMAIN_EVM, DOMAIN_STRK}, - contracts::{eth, strk}, + contracts::{ + eth, + strk::{self, StarknetProvider}, + }, validator::TestValidators, }; @@ -146,7 +151,7 @@ where ) .send() .await?; - let strk_provider: &AnyProvider = from.acc_owner.provider(); + let strk_provider: &StarknetProvider = from.acc_owner.provider(); let dispatch_receipt = strk_provider .get_transaction_receipt(dispatch_res.transaction_hash) .await?; @@ -220,7 +225,7 @@ where .send() .await?; - let strk_provider: &AnyProvider = to.acc_owner.provider(); + let strk_provider: &StarknetProvider = to.acc_owner.provider(); let process_receipt = strk_provider .get_transaction_receipt(process_res.transaction_hash) .await?; diff --git a/rust/tests/validator.rs b/rust/tests/validator.rs index 0b68fa2..030f5e7 100644 --- a/rust/tests/validator.rs +++ b/rust/tests/validator.rs @@ -1,5 +1,4 @@ use cainome::cairo_serde::EthAddress; -use ethers::types::{Address, H160}; use ethers::utils::hex::FromHex; use k256::{ ecdsa::{RecoveryId, SigningKey, VerifyingKey}, From bf44838c83c4f81590e29b672e4ef928a2f6720d Mon Sep 17 00:00:00 2001 From: 0xevolve Date: Wed, 22 May 2024 15:37:01 +0100 Subject: [PATCH 2/2] fix: katana runner config --- rust/tests/contracts/strk/setup.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/rust/tests/contracts/strk/setup.rs b/rust/tests/contracts/strk/setup.rs index 7218dda..4d4c46f 100644 --- a/rust/tests/contracts/strk/setup.rs +++ b/rust/tests/contracts/strk/setup.rs @@ -1,6 +1,6 @@ use std::collections::BTreeMap; -use katana_runner::KatanaRunner; +use katana_runner::{KatanaRunner, KatanaRunnerConfig}; use starknet::core::types::FieldElement; use crate::validator::TestValidators; @@ -36,7 +36,17 @@ impl Env { } pub async fn setup_env(domain: u32, validators: &[TestValidators]) -> eyre::Result { - let runner = KatanaRunner::new().expect("Fail to set runner"); + let runner = KatanaRunner::new_with_config(KatanaRunnerConfig { + n_accounts: 3, + port: Some(5050), + ..Default::default() + }) + .expect("Fail to set runner"); + + println!( + "Runner started, logs can be found at: {:?}", + runner.log_file_path() + ); let owner = runner.account(0); let deployer = runner.account(1);