From e6791857ae85abb729371bc877079db2620f8321 Mon Sep 17 00:00:00 2001 From: pia <76558220+rkdud007@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:55:25 +0900 Subject: [PATCH] starknet tx, tx receipt support (#13) * wip * wip * wip * wipd * proof/verify abstract * cleaner * dependency to sn-trie * omg it works * update test cases * wip * abstract bitvec, clean up test, embed gateway * quick update with poseidon * feat: tx support done * wip clean up * ci: add sub rpc * folder structure change * sketch refactoring * image * alter dependency * receipt support * chore: minor * readme * sub rpc --- Cargo.lock | 1042 ++++++++++------- Cargo.toml | 33 +- README.md | 121 +- cli/Cargo.toml | 14 + src/bin/cli.rs => cli/src/main.rs | 0 crates/eth-trie-proofs/Cargo.toml | 22 + crates/eth-trie-proofs/README.md | 81 ++ .../eth-trie-proofs/src/error.rs | 6 - crates/eth-trie-proofs/src/lib.rs | 8 + {src => crates/eth-trie-proofs/src}/rpc.rs | 2 +- {src => crates/eth-trie-proofs/src}/tx.rs | 2 +- .../eth-trie-proofs/src}/tx_receipt.rs | 2 +- .../eth-trie-proofs/src}/tx_receipt_trie.rs | 6 +- .../eth-trie-proofs/src}/tx_trie.rs | 5 +- crates/sn-trie-proofs/Cargo.toml | 21 + crates/sn-trie-proofs/README.md | 73 ++ crates/sn-trie-proofs/src/error.rs | 21 + crates/sn-trie-proofs/src/lib.rs | 8 + crates/sn-trie-proofs/src/rpc.rs | 138 +++ crates/sn-trie-proofs/src/tx_hash.rs | 83 ++ crates/sn-trie-proofs/src/tx_receipt_hash.rs | 62 + crates/sn-trie-proofs/src/tx_receipt_trie.rs | 183 +++ crates/sn-trie-proofs/src/tx_trie.rs | 252 ++++ 23 files changed, 1630 insertions(+), 555 deletions(-) create mode 100644 cli/Cargo.toml rename src/bin/cli.rs => cli/src/main.rs (100%) create mode 100644 crates/eth-trie-proofs/Cargo.toml create mode 100644 crates/eth-trie-proofs/README.md rename src/lib.rs => crates/eth-trie-proofs/src/error.rs (95%) create mode 100644 crates/eth-trie-proofs/src/lib.rs rename {src => crates/eth-trie-proofs/src}/rpc.rs (98%) rename {src => crates/eth-trie-proofs/src}/tx.rs (99%) rename {src => crates/eth-trie-proofs/src}/tx_receipt.rs (99%) rename {src => crates/eth-trie-proofs/src}/tx_receipt_trie.rs (97%) rename {src => crates/eth-trie-proofs/src}/tx_trie.rs (98%) create mode 100644 crates/sn-trie-proofs/Cargo.toml create mode 100644 crates/sn-trie-proofs/README.md create mode 100644 crates/sn-trie-proofs/src/error.rs create mode 100644 crates/sn-trie-proofs/src/lib.rs create mode 100644 crates/sn-trie-proofs/src/rpc.rs create mode 100644 crates/sn-trie-proofs/src/tx_hash.rs create mode 100644 crates/sn-trie-proofs/src/tx_receipt_hash.rs create mode 100644 crates/sn-trie-proofs/src/tx_receipt_trie.rs create mode 100644 crates/sn-trie-proofs/src/tx_trie.rs diff --git a/Cargo.lock b/Cargo.lock index a1727b8..b907c5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "ahash" @@ -31,15 +31,15 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9134b68e24175eff6c3c4d2bffeefb0a1b7435462130862c88d1524ca376e7e5" +checksum = "0ba1c79677c9ce51c8d45e20845b05e6fb070ea2c863fba03ad6af2c778474bd" dependencies = [ "alloy-consensus", "alloy-core", @@ -52,14 +52,13 @@ dependencies = [ "alloy-serde", "alloy-transport", "alloy-transport-http", - "reqwest 0.12.5", ] [[package]] name = "alloy-chains" -version = "0.1.22" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e9a1892803b02f53e25bea3e414ddd0501f12d97456c9d5ade4edf88f9516f" +checksum = "2b4f201b0ac8f81315fbdc55269965a8ddadbc04ab47fa65a1a468f9a40f7a5f" dependencies = [ "num_enum", "strum", @@ -67,9 +66,9 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a016bfa21193744d4c38b3f3ab845462284d129e5e23c7cc0fafca7e92d9db37" +checksum = "da374e868f54c7f4ad2ad56829827badca388efd645f8cf5fccc61c2b5343504" dependencies = [ "alloy-eips", "alloy-primitives", @@ -81,9 +80,9 @@ dependencies = [ [[package]] name = "alloy-core" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5af3faff14c12c8b11037e0a093dd157c3702becb8435577a2408534d0758315" +checksum = "529fc6310dc1126c8de51c376cbc59c79c7f662bd742be7dc67055d5421a81b4" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -93,9 +92,9 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6e6436a9530f25010d13653e206fab4c9feddacf21a54de8d7311b275bc56b" +checksum = "413902aa18a97569e60f679c23f46a18db1656d87ab4d4e49d0e1e52042f66df" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -105,14 +104,14 @@ dependencies = [ "itoa", "serde", "serde_json", - "winnow 0.6.13", + "winnow", ] [[package]] name = "alloy-eips" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d6d8118b83b0489cfb7e6435106948add2b35217f4a5004ef895f613f60299" +checksum = "f76ecab54890cdea1e4808fc0891c7e6cfcf71fe1a9fe26810c7280ef768f4ed" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -125,9 +124,9 @@ dependencies = [ [[package]] name = "alloy-genesis" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894f33a7822abb018db56b10ab90398e63273ce1b5a33282afd186c132d764a6" +checksum = "bca15afde1b6d15e3fc1c97421262b1bbb37aee45752e3c8b6d6f13f776554ff" dependencies = [ "alloy-primitives", "alloy-serde", @@ -136,9 +135,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaeaccd50238126e3a0ff9387c7c568837726ad4f4e399b528ca88104d6c25ef" +checksum = "bc05b04ac331a9f07e3a4036ef7926e49a8bf84a99a1ccfc7e2ab55a5fcbb372" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -148,9 +147,9 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f0ae6e93b885cc70fe8dae449e7fd629751dbee8f59767eaaa7285333c5727" +checksum = "6d6f34930b7e3e2744bcc79056c217f00cb2abb33bc5d4ff88da7623c5bb078b" dependencies = [ "alloy-primitives", "serde", @@ -161,9 +160,9 @@ dependencies = [ [[package]] name = "alloy-network" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc122cbee2b8523854cc11d87bcd5773741602c553d2d2d106d82eeb9c16924a" +checksum = "25f6895fc31b48fa12306ef9b4f78b7764f8bd6d7d91cdb0a40e233704a0f23f" dependencies = [ "alloy-consensus", "alloy-eips", @@ -181,9 +180,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f783611babedbbe90db3478c120fb5f5daacceffc210b39adc0af4fe0da70bad" +checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" dependencies = [ "alloy-rlp", "bytes", @@ -203,9 +202,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d5af289798fe8783acd0c5f10644d9d26f54a12bc52a083e4f3b31718e9bf92" +checksum = "9c538bfa893d07e27cb4f3c1ab5f451592b7c526d511d62b576a2ce59e146e4a" dependencies = [ "alloy-chains", "alloy-consensus", @@ -225,7 +224,7 @@ dependencies = [ "futures-utils-wasm", "lru", "pin-project", - "reqwest 0.12.5", + "reqwest 0.12.7", "serde", "serde_json", "tokio", @@ -235,9 +234,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b155716bab55763c95ba212806cf43d05bcc70e5f35b02bad20cf5ec7fe11fed" +checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -246,27 +245,27 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" +checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "alloy-rpc-client" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40fcb53b2a9d0a78a4968b2eca8805a4b7011b9ee3fdfa2acaf137c5128f36b" +checksum = "5ba31bae67773fd5a60020bea900231f8396202b7feca4d0c70c6b59308ab4a8" dependencies = [ "alloy-json-rpc", "alloy-transport", "alloy-transport-http", "futures", "pin-project", - "reqwest 0.12.5", + "reqwest 0.12.7", "serde", "serde_json", "tokio", @@ -278,9 +277,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f2fbe956a3e0f0975c798f488dc6be96b669544df3737e18f4a325b42f4c86" +checksum = "184a7a42c7ba9141cc9e76368356168c282c3bc3d9e5d78f3556bdfe39343447" dependencies = [ "alloy-rpc-types-eth", "alloy-serde", @@ -288,9 +287,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "083f443a83b9313373817236a8f4bea09cca862618e9177d822aee579640a5d6" +checksum = "ab4123ee21f99ba4bd31bfa36ba89112a18a500f8b452f02b35708b1b951e2b9" dependencies = [ "alloy-consensus", "alloy-eips", @@ -306,9 +305,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94da1c0c4e27cc344b05626fe22a89dc6b8b531b9475f3b7691dbf6913e4109" +checksum = "9416c52959e66ead795a11f4a86c248410e9e368a0765710e57055b8a1774dd6" dependencies = [ "alloy-primitives", "serde", @@ -317,9 +316,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58d876be3afd8b78979540084ff63995292a26aa527ad0d44276405780aa0ffd" +checksum = "b33753c09fa1ad85e5b092b8dc2372f1e337a42e84b9b4cff9fede75ba4adb32" dependencies = [ "alloy-primitives", "async-trait", @@ -331,65 +330,66 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bad41a7c19498e3f6079f7744656328699f8ea3e783bdd10d85788cd439f572" +checksum = "2b40397ddcdcc266f59f959770f601ce1280e699a91fc1862f29cef91707cd09" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "alloy-sol-macro-expander" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9899da7d011b4fe4c406a524ed3e3f963797dbc93b45479d60341d3a27b252" +checksum = "867a5469d61480fea08c7333ffeca52d5b621f5ca2e44f271b117ec1fc9a0525" dependencies = [ "alloy-sol-macro-input", "const-hex", "heck", - "indexmap 2.2.6", + "indexmap 2.5.0", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32d595768fdc61331a132b6f65db41afae41b9b97d36c21eb1b955c422a7e60" +checksum = "2e482dc33a32b6fadbc0f599adea520bd3aaa585c141a80b404d0a3e3fa72528" dependencies = [ "const-hex", "dunce", "heck", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", "syn-solidity", ] [[package]] name = "alloy-sol-type-parser" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baa2fbd22d353d8685bd9fee11ba2d8b5c3b1d11e56adb3265fcf1f32bfdf404" +checksum = "cbcba3ca07cf7975f15d871b721fb18031eec8bce51103907f6dcce00b255d98" dependencies = [ - "winnow 0.6.13", + "serde", + "winnow", ] [[package]] name = "alloy-sol-types" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a49042c6d3b66a9fe6b2b5a8bf0d39fc2ae1ee0310a2a26ffedd79fb097878dd" +checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" dependencies = [ "alloy-primitives", "alloy-sol-macro", @@ -399,12 +399,12 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245af9541f0a0dbd5258669c80dfe3af118164cacec978a520041fc130550deb" +checksum = "01b51a291f949f755e6165c3ed562883175c97423703703355f4faa4b7d0a57c" dependencies = [ "alloy-json-rpc", - "base64 0.22.0", + "base64 0.22.1", "futures-util", "futures-utils-wasm", "serde", @@ -412,18 +412,19 @@ dependencies = [ "thiserror", "tokio", "tower", + "tracing", "url", ] [[package]] name = "alloy-transport-http" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5619c017e1fdaa1db87f9182f4f0ed97c53d674957f4902fba655e972d359c6c" +checksum = "86d65871f9f1cafe1ed25cde2f1303be83e6473e995a2d56c275ae4fcce6119c" dependencies = [ "alloy-json-rpc", "alloy-transport", - "reqwest 0.12.5", + "reqwest 0.12.7", "serde_json", "tower", "tracing", @@ -447,9 +448,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", @@ -462,38 +463,44 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", ] +[[package]] +name = "anyhow" +version = "1.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" + [[package]] name = "ark-ff" version = "0.3.0" @@ -528,7 +535,7 @@ dependencies = [ "num-bigint", "num-traits", "paste", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "zeroize", ] @@ -620,9 +627,9 @@ dependencies = [ [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-stream" @@ -643,18 +650,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "async-trait" -version = "0.1.79" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -665,28 +672,28 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -703,9 +710,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -736,9 +743,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitvec" @@ -763,9 +770,9 @@ dependencies = [ [[package]] name = "blst" -version = "0.3.12" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62dc83a094a71d43eeadd254b1ec2d24cb6a0bb6cadce00df51f0db594711a32" +checksum = "4378725facc195f1a538864863f6de233b500a8862747e7f165078a419d5e874" dependencies = [ "cc", "glob", @@ -775,9 +782,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-slice-cast" @@ -793,32 +800,36 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" dependencies = [ "serde", ] [[package]] name = "c-kzg" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf100c4cea8f207e883ff91ca886d621d8a166cb04971dfaa9bb8fd99ed95df" +checksum = "f0307f72feab3300336fb803a57134159f6e20139af1357f36c54cb90d8e8928" dependencies = [ "blst", "cc", "glob", "hex", "libc", + "once_cell", "serde", ] [[package]] name = "cc" -version = "1.0.91" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd97381a8cc6493395a5afc4c691c1084b3768db713b73aa215217aa245d153" +checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -828,22 +839,22 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] name = "clap" -version = "4.5.7" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" dependencies = [ "clap_builder", "clap_derive", @@ -851,45 +862,59 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.7" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.1", + "strsim", ] [[package]] name = "clap_derive" -version = "4.5.5" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + +[[package]] +name = "cli" +version = "0.1.0" +dependencies = [ + "alloy-primitives", + "clap", + "eth-trie-proofs", + "serde", + "serde_json", + "serde_with", + "tokio", + "url", +] [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "const-hex" -version = "1.11.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba00838774b4ab0233e355d26710fbfc8327a05c017f6dc4873f876d1f79f78" +checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" dependencies = [ "cfg-if", "cpufeatures", @@ -922,15 +947,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -965,9 +990,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ "darling_core", "darling_macro", @@ -975,27 +1000,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 2.0.58", + "strsim", + "syn 2.0.77", ] [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -1005,7 +1030,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", @@ -1044,15 +1069,15 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.4.0", - "syn 1.0.109", + "rustc_version 0.4.1", + "syn 2.0.77", ] [[package]] @@ -1078,9 +1103,9 @@ dependencies = [ [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "ecdsa" @@ -1098,9 +1123,9 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" @@ -1123,9 +1148,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -1138,9 +1163,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1153,13 +1178,9 @@ dependencies = [ "alloy", "alloy-primitives", "alloy-rlp", - "clap", "eth_trie", "ethereum-types", "reqwest 0.11.27", - "serde", - "serde_json", - "serde_with", "thiserror", "tokio", "url", @@ -1172,7 +1193,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3aeb0284b473041df2419a28e3cdf0c64a78d2b9511af4b6e40bad3964b172" dependencies = [ "ethereum-types", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "keccak-hash", "log", "parking_lot", @@ -1208,9 +1229,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fastrlp" @@ -1337,7 +1358,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -1389,9 +1410,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -1400,9 +1421,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "glob" @@ -1433,7 +1454,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.2.6", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -1448,9 +1469,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -1527,9 +1548,9 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http 1.1.0", @@ -1544,15 +1565,15 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -1562,9 +1583,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -1586,15 +1607,15 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "httparse", "itoa", "pin-project-lite", @@ -1610,7 +1631,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.28", + "hyper 0.14.30", "native-tls", "tokio", "tokio-native-tls", @@ -1624,7 +1645,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.1", "hyper-util", "native-tls", "tokio", @@ -1634,16 +1655,16 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.0", - "hyper 1.3.1", + "http-body 1.0.1", + "hyper 1.4.1", "pin-project-lite", "socket2", "tokio", @@ -1742,26 +1763,26 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "serde", ] [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -1789,9 +1810,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -1809,11 +1830,20 @@ dependencies = [ "sha2", ] +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + [[package]] name = "keccak-asm" -version = "0.1.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb8515fff80ed850aea4a1595f2e519c003e2a00a82fe168ebf5269196caf444" +checksum = "422fbc7ff2f2f5bdffeb07718e5a5324dca72b0c9293d50df4026652385e3314" dependencies = [ "digest 0.10.7", "sha3-asm", @@ -1829,17 +1859,39 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "lambdaworks-crypto" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fb5d4f22241504f7c7b8d2c3a7d7835d7c07117f10bff2a7d96a9ef6ef217c3" +dependencies = [ + "lambdaworks-math", + "serde", + "sha2", + "sha3", +] + +[[package]] +name = "lambdaworks-math" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "358e172628e713b80a530a59654154bfc45783a6ed70ea284839800cebdf8f97" +dependencies = [ + "serde", + "serde_json", +] + [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libm" @@ -1849,15 +1901,15 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1865,24 +1917,24 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mime" @@ -1892,31 +1944,31 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -1930,11 +1982,10 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -1956,9 +2007,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -1976,29 +2027,29 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "object" -version = "0.32.2" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -2011,11 +2062,11 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -2032,7 +2083,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -2043,9 +2094,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -2055,9 +2106,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ "arrayvec", "bitvec", @@ -2069,9 +2120,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2081,9 +2132,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -2091,22 +2142,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "percent-encoding" @@ -2116,9 +2167,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.9" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" +checksum = "9c73c26c01b8c87956cea613c907c9d6ecffd8d18a2a5908e5de0adfaa185cea" dependencies = [ "memchr", "thiserror", @@ -2142,7 +2193,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -2181,9 +2232,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "primitive-types" @@ -2200,11 +2254,10 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.2" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_datetime", "toml_edit", ] @@ -2234,22 +2287,22 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.5.0", + "bitflags 2.6.0", "lazy_static", "num-traits", "rand", @@ -2269,9 +2322,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -2323,18 +2376,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" @@ -2350,7 +2403,7 @@ dependencies = [ "h2", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.30", "hyper-tls 0.5.0", "ipnet", "js-sys", @@ -2373,23 +2426,23 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg 0.50.0", + "winreg", ] [[package]] name = "reqwest" -version = "0.12.5" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "bytes", "futures-core", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.1", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -2400,7 +2453,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile 2.1.2", + "rustls-pemfile 2.1.3", "serde", "serde_json", "serde_urlencoded", @@ -2412,7 +2465,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg 0.52.0", + "windows-registry", ] [[package]] @@ -2467,9 +2520,9 @@ checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hex" @@ -2488,20 +2541,20 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.22", + "semver 1.0.23", ] [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -2519,19 +2572,19 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustversion" @@ -2553,17 +2606,17 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2588,11 +2641,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -2601,9 +2654,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -2620,9 +2673,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "semver-parser" @@ -2635,31 +2688,32 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.197" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -2678,15 +2732,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.7.0" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" +checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.6", + "indexmap 2.5.0", "serde", "serde_derive", "serde_json", @@ -2696,14 +2750,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.7.0" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" +checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -2717,16 +2771,32 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + [[package]] name = "sha3-asm" -version = "0.1.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac61da6b35ad76b195eb4771210f947734321a8d81d7738e1580d953bc7a15e" +checksum = "57d79b758b7cb2085612b11a235055e485605a5103faccdd633f35bd7aee69dd" dependencies = [ "cc", "cfg-if", ] +[[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" @@ -2752,11 +2822,36 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "sn-merkle-trie" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a46c1daa6d9bef421896da0fd2d17c80c02c93a966ca832c8f607b106d443ae0" +dependencies = [ + "anyhow", + "bitvec", + "starknet-types-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sn-trie-proofs" +version = "0.1.0" +dependencies = [ + "bitflags 2.6.0", + "reqwest 0.11.27", + "serde_json", + "sn-merkle-trie", + "starknet-types-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-types-rpc", + "thiserror", + "tokio", +] + [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2773,16 +2868,46 @@ dependencies = [ ] [[package]] -name = "static_assertions" -version = "1.1.0" +name = "starknet-types-core" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "ce6bacf0ba19bc721e518bc4bf389ff13daa8a7c5db5fd320600473b8aa9fcbd" +dependencies = [ + "lambdaworks-crypto", + "lambdaworks-math", + "num-bigint", + "num-integer", + "num-traits", + "serde", +] [[package]] -name = "strsim" -version = "0.10.0" +name = "starknet-types-core" +version = "0.1.5" +source = "git+https://github.com/starknet-io/types-rs#ffcf7e65983df3cb53d7a228849a073034cba161" +dependencies = [ + "lambdaworks-crypto", + "lambdaworks-math", + "num-bigint", + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "starknet-types-rpc" +version = "0.7.1" +source = "git+https://github.com/starknet-io/types-rs#ffcf7e65983df3cb53d7a228849a073034cba161" +dependencies = [ + "serde", + "starknet-types-core 0.1.5 (git+https://github.com/starknet-io/types-rs)", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" @@ -2809,14 +2934,14 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -2831,9 +2956,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.58" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -2842,14 +2967,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d71e19bca02c807c9faa67b5a47673ff231b6e7449b251695188522f1dc44b2" +checksum = "c837dc8852cb7074e46b444afb81783140dab12c58867b49fb3898fbafedf7ea" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -2863,6 +2988,9 @@ name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "system-configuration" @@ -2893,34 +3021,35 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -2934,9 +3063,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -2955,9 +3084,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -2974,9 +3103,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -2989,30 +3118,29 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -3027,9 +3155,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -3039,33 +3167,32 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] name = "toml_edit" -version = "0.20.2" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "toml_datetime", - "winnow 0.5.40", + "winnow", ] [[package]] @@ -3086,15 +3213,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -3116,7 +3243,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -3187,9 +3314,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -3216,9 +3343,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wait-timeout" @@ -3246,34 +3373,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -3283,9 +3411,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3293,28 +3421,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -3326,7 +3454,37 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", ] [[package]] @@ -3344,7 +3502,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -3364,17 +3531,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -3385,9 +3553,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -3397,9 +3565,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -3409,9 +3577,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -3421,9 +3595,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -3433,9 +3607,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -3445,9 +3619,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -3457,24 +3631,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - -[[package]] -name = "winnow" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] @@ -3489,16 +3654,6 @@ 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 = "wyz" version = "0.5.1" @@ -3510,29 +3665,30 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -3545,5 +3701,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] diff --git a/Cargo.toml b/Cargo.toml index a1f5407..7f00d64 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,19 +1,11 @@ -[package] -name = "eth-trie-proofs" -version = "0.1.1" -edition = "2021" -description = "Ethereum Transaction Trie Proofs" -readme = "README.md" -license-file = "LICENSE" -repository = "https://github.com/HerodotusDev/eth-trie-proofs" -keywords = ["mpt", "trie", "ethereum"] -categories = ["cryptography", "data-structures", "blockchain"] -exclude = [".github"] +[workspace] +resolver = "2" +members = ["cli", "crates/eth-trie-proofs", "crates/sn-trie-proofs"] +[workspace.dependencies] +eth-trie-proofs = { path = "crates/eth-trie-proofs" } +sn-trie-proofs = { path = "crates/sn-trie-proofs" } -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] tokio = { version = "1.36.0", features = ["rt", "rt-multi-thread", "macros"] } alloy-primitives = { version = "0.7.6" } alloy = { version = "0.1.1", features = [ @@ -29,7 +21,7 @@ alloy = { version = "0.1.1", features = [ "k256", ] } url = "2.5.0" -reqwest = "0.11.26" +reqwest = { version = "0.11.26", features = ["json"] } alloy-rlp = { version = "0.3.5" } eth_trie = "0.4.0" ethereum-types = "0.14.1" @@ -38,7 +30,10 @@ serde = "1.0.197" serde_with = { version = "3.7.0", features = ["hex"] } serde_json = "1.0.114" thiserror = "1.0" - -[[bin]] -name = "etp-cli" -path = "src/bin/cli.rs" +starknet-types-core = { version = "0.1.0", default-features = false, features = [ + "serde", + "hash", +] } +starknet-types-rpc = { version = "0.7.1", git = "https://github.com/starknet-io/types-rs" } +sn-merkle-trie = { version = "0.1.0" } +bitflags = "2.6.0" diff --git a/README.md b/README.md index 3d0af21..2955079 100644 --- a/README.md +++ b/README.md @@ -1,114 +1,75 @@ -![](.github/readme.png) +# trie-proofs -# eth-trie-proofs +A comprehensive proofs handler for Ethereum and Starknet tries. This repository provides proof-building functionalities and includes a CLI tool. -A comprehensive proofs handler for Ethereum trie. Tested with various EIPs including Legacy, EIP-2930, EIP-1559, and EIP-4844. This repository exposes the proof building functionalities, and a CLI version. +## Supported Crates -## Features +- [x] [Ethereum Transaction/Receipt MPT Handler](./crates/eth-trie-proofs/README.md): Constructs transaction and receipt tries using a target block number or transaction hash, following Ethereum's Merkle Patricia Tree (MPT) specification. -- **Transaction Trie Handler** - - - [x] Build a trie with a target block number - - [x] Build a trie with a target transaction hash - - [x] Retrieve proof by transaction index - - [x] Verify proof - -- **Transaction Receipt Trie Handler** - - [x] Build a trie with a target block number - - [x] Build a trie with a target transaction hash - - [x] Retrieve proof by transaction index - - [x] Verify proof - -## CLI Tool -The CLI tool supports generating proofs for transactions and receipts. Use the following commands based on your requirements: - -Install with: `cargo install --path ./` +- [x] [Starknet Transaction/Receipt MPT Handler](./crates/sn-trie-proofs/README.md): Constructs transaction and receipt tries using a target block number, following Starknet's Merkle Patricia Tree (MPT) specification. -Or, run without installing: `cargo run --bin etp-cli` +## Trie Handler +- **Transaction Trie Handler** -**Generate a Proof via CLI** + - [x] Builds a trie with a target block number. + - [x] Builds a trie with a target transaction hash. + - [x] Retrieves proof by transaction index. + - [x] Verifies proof. -To generate a proof for a transaction, use the following command: +- **Transaction Receipt Trie Handler** -`etp-cli tx [RPC_URL]` + - [x] Builds a trie with a target block number. + - [x] Builds a trie with a target transaction hash. + - [x] Retrieves proof by transaction index. + - [x] Verifies proof. -To generate a receipt proof: +## CLI Tool -`etp-cli receipt [RPC_URL]` +_Currently only supports Ethereum MPT._ -As a default, `https://ethereum-rpc.publicnode.com` is used as an RPC provider. This will probably work for recent transactions, but it is advised to use a dedicated RPC. +The CLI tool supports generating proofs for transactions and receipts. Use the following commands based on your requirements. -## Installation +### Installation -Add dependency `eth-trie-proofs` to your project: +Install the CLI tool using Cargo: +```shell +cargo install --path ./ ``` -eth-trie-proofs = { git = "https://github.com/HerodotusDev/eth-trie-proofs.git", branch = "main" } -``` - -## Example -### Building a Transaction Trie with a Target Block Number or Target Transaction Hash +Or run it without installing: -```rust -let target_tx_hash = B256::from(hex!( - "1fcb1196d8a3bff0bcf13309d2d2bb1a23ae1ac13f5674c801be0ff9254d5ab5" -)); +```shell +cargo run --bin etp-cli +``` -let mut txs_mpt_handler = TxsMptHandler::new(MAINNET_RPC_URL)?; +### Generate a Proof via CLI -txs_mpt_handler - .build_tx_tree_from_block(4370000) - .await?; +To generate a proof for a transaction: -let tx_index = txs_mpt_handler.tx_hash_to_tx_index(target_tx_hash)?; -let proof = txs_mpt_handler.get_proof(tx_index)?; -txs_mpt_handler - .verify_proof(tx_index, proof.clone())?; +```shell +etp-cli tx [RPC_URL] +``` -// You can either build with target tx hash. Both roots match. -let mut txs_mpt_handler2 = TxsMptHandler::new(MAINNET_RPC_URL)?; -txs_mpt_handler2 - .build_tx_tree_from_tx_hash(target_tx_hash) - .await?; +To generate a receipt proof: -assert_eq!( - txs_mpt_handler.get_root().unwrap(), - txs_mpt_handler2.get_root().unwrap() -); +```shell +etp-cli receipt [RPC_URL] ``` -### Building a Transaction Receipts Trie with a Target Block Number - -```rust -// 4844 transaction -let target_tx_hash = B256::from(hex!( - "9c1fbda4f649ac806ab0faefbe94e1a60282eb374ead6aa01bac042f52b28a8c" -)); - -let mut tx_receipts_mpt_handler = TxReceiptsMptHandler::new(MAINNET_RPC_URL)?; -tx_receipts_mpt_handler - .build_tx_receipts_tree_from_block(19426589) - .await?; - -let tx_index = tx_receipts_mpt_handler - .tx_hash_to_tx_index(target_tx_hash) - .await?; -let proof = tx_receipts_mpt_handler.get_proof(tx_index)?; -tx_receipts_mpt_handler - .verify_proof(tx_index, proof.clone())?; -``` +By default, `https://ethereum-rpc.publicnode.com` is used as the RPC provider. While this may work for recent transactions, it is advisable to use a dedicated RPC provider for better reliability. -### Credit +## Contributing -For trie implementation, this project depends on the [eth_trie](https://crates.io/crates/eth_trie). -For transaction and transaction receipt types, heavily depends on the [alloy](https://github.com/alloy-rs/alloy). +Contributions are welcome! If you'd like to contribute to this project, please fork the repository and submit a pull request. For major changes, please open an issue first to discuss what you would like to change. ## License -`eth-trie-proofs` is licensed under the [GNU General Public License v3.0](./LICENSE). +`trie-proofs` is licensed under the [GNU General Public License v3.0](./LICENSE). --- Herodotus Dev Ltd - 2024 + +--- diff --git a/cli/Cargo.toml b/cli/Cargo.toml new file mode 100644 index 0000000..71da2a6 --- /dev/null +++ b/cli/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "cli" +version = "0.1.0" +edition = "2021" + +[dependencies] +eth-trie-proofs.workspace = true +tokio.workspace = true +clap.workspace = true +serde_with.workspace = true +serde.workspace = true +serde_json.workspace = true +alloy-primitives.workspace = true +url.workspace = true diff --git a/src/bin/cli.rs b/cli/src/main.rs similarity index 100% rename from src/bin/cli.rs rename to cli/src/main.rs diff --git a/crates/eth-trie-proofs/Cargo.toml b/crates/eth-trie-proofs/Cargo.toml new file mode 100644 index 0000000..e193f18 --- /dev/null +++ b/crates/eth-trie-proofs/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "eth-trie-proofs" +version = "0.1.1" +edition = "2021" +description = "Ethereum Transaction Trie Proofs" +readme = "README.md" +license-file = "LICENSE" +repository = "https://github.com/HerodotusDev/eth-trie-proofs" +keywords = ["mpt", "trie", "ethereum"] +categories = ["cryptography", "data-structures", "blockchain"] +exclude = [".github"] + +[dependencies] +tokio.workspace = true +alloy-primitives.workspace = true +alloy.workspace = true +url.workspace = true +reqwest.workspace = true +alloy-rlp.workspace = true +eth_trie.workspace = true +ethereum-types.workspace = true +thiserror.workspace = true diff --git a/crates/eth-trie-proofs/README.md b/crates/eth-trie-proofs/README.md new file mode 100644 index 0000000..82285f2 --- /dev/null +++ b/crates/eth-trie-proofs/README.md @@ -0,0 +1,81 @@ +# eth-trie-proofs + +![CI](https://img.shields.io/github/actions/workflow/status/HerodotusDev/eth-trie-proofs/ci.yml?style=flat-square&logo=githubactions&logoColor=white&label=CI) +[![Crates.io](https://img.shields.io/crates/v/eth-trie-proofs?style=flat-square&logo=lootcrate)](https://crates.io/crates/eth-trie-proofs) +[![Documentation](https://img.shields.io/docsrs/eth-trie-proofs)](https://docs.rs/eth-trie-proofs) + +![](.github/readme.png) + +A comprehensive transaction/receipt inclusion proofs handler for [Ethereum trie](https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/). Tested with various EIPs including Legacy, EIP-2930, EIP-1559, and EIP-4844. This library exposes various proof building functionalities, verification, trie construction etc. + +## Installation + +Add dependency `eth-trie-proofs` to your project: + +``` +eth-trie-proofs = { version= "0.1.1" } +``` + +## Usage + +- **Transaction Trie Handler** + +```rust + #[tokio::test] +async fn test_tx_mpt_frontier() { + let url = Url::parse(MAINNET_RPC_URL_SUB).unwrap(); + let target_tx_hash = B256::from(hex!( + "5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" + )); + let mut txs_mpt_handler = TxsMptHandler::new(url).unwrap(); + txs_mpt_handler + .build_tx_tree_from_block(46147) + .await + .unwrap(); + let tx_index = txs_mpt_handler.tx_hash_to_tx_index(target_tx_hash).unwrap(); + let proof = txs_mpt_handler.get_proof(tx_index).unwrap(); + txs_mpt_handler + .verify_proof(tx_index, proof.clone()) + .unwrap(); +} +``` + +- **Transaction Receipt Trie Handler** + +```rust +#[tokio::test] +async fn test_tx_receipt_1559() { + let url = Url::parse(MAINNET_RPC_URL).unwrap(); + let target_tx_hash = B256::from(hex!( + "2055b7e01304f87f9412cd44758cd248bc2da2dab95c97026064ffb084711735" + )); + + let mut tx_receipts_mpt_handler = TxReceiptsMptHandler::new(url).unwrap(); + tx_receipts_mpt_handler + .build_tx_receipts_tree_from_block(12965000) + .await + .unwrap(); + + let tx_index = tx_receipts_mpt_handler + .tx_hash_to_tx_index(target_tx_hash) + .await + .unwrap(); + let proof = tx_receipts_mpt_handler.get_proof(tx_index).unwrap(); + tx_receipts_mpt_handler + .verify_proof(tx_index, proof.clone()) + .unwrap(); +} +``` + +### Credit + +For trie implementation, this project depends on the [eth_trie](https://crates.io/crates/eth_trie). +For transaction and transaction receipt types, heavily depends on the [alloy](https://github.com/alloy-rs/alloy). + +## License + +`eth-trie-proofs` is licensed under the [GNU General Public License v3.0](../../LICENSE). + +--- + +Herodotus Dev Ltd - 2024 diff --git a/src/lib.rs b/crates/eth-trie-proofs/src/error.rs similarity index 95% rename from src/lib.rs rename to crates/eth-trie-proofs/src/error.rs index 2ffb385..5bc6cd1 100644 --- a/src/lib.rs +++ b/crates/eth-trie-proofs/src/error.rs @@ -4,12 +4,6 @@ use alloy::transports::{RpcError, TransportErrorKind}; use eth_trie::TrieError; use thiserror::Error; -mod rpc; -pub mod tx; -pub mod tx_receipt; -pub mod tx_receipt_trie; -pub mod tx_trie; - #[derive(Error, Debug)] pub enum EthTrieError { #[error("Trie error: {0}")] diff --git a/crates/eth-trie-proofs/src/lib.rs b/crates/eth-trie-proofs/src/lib.rs new file mode 100644 index 0000000..d65da06 --- /dev/null +++ b/crates/eth-trie-proofs/src/lib.rs @@ -0,0 +1,8 @@ +pub mod error; +mod rpc; +pub mod tx; +pub mod tx_receipt; +pub mod tx_receipt_trie; +pub mod tx_trie; + +pub use error::EthTrieError; diff --git a/src/rpc.rs b/crates/eth-trie-proofs/src/rpc.rs similarity index 98% rename from src/rpc.rs rename to crates/eth-trie-proofs/src/rpc.rs index d4ebdbb..e2211c9 100644 --- a/src/rpc.rs +++ b/crates/eth-trie-proofs/src/rpc.rs @@ -1,4 +1,4 @@ -use crate::EthTrieError; +use crate::error::EthTrieError; use alloy::network::Ethereum; use alloy::primitives::B256; use alloy::providers::{Provider, RootProvider}; diff --git a/src/tx.rs b/crates/eth-trie-proofs/src/tx.rs similarity index 99% rename from src/tx.rs rename to crates/eth-trie-proofs/src/tx.rs index 36a124a..ad0b737 100644 --- a/src/tx.rs +++ b/crates/eth-trie-proofs/src/tx.rs @@ -1,4 +1,4 @@ -use crate::{EthTrieError, Field}; +use crate::error::{EthTrieError, Field}; use alloy::consensus::{ SignableTransaction, TxEip1559, TxEip2930, TxEip4844, TxEnvelope, TxLegacy, TxType, }; diff --git a/src/tx_receipt.rs b/crates/eth-trie-proofs/src/tx_receipt.rs similarity index 99% rename from src/tx_receipt.rs rename to crates/eth-trie-proofs/src/tx_receipt.rs index 7e3e75c..7fc1612 100644 --- a/src/tx_receipt.rs +++ b/crates/eth-trie-proofs/src/tx_receipt.rs @@ -1,4 +1,4 @@ -use crate::EthTrieError; +use crate::error::EthTrieError; use alloy::consensus::{Eip658Value, Receipt, ReceiptWithBloom, TxReceipt}; use alloy::consensus::{ReceiptEnvelope, TxType}; use alloy::eips::eip2718::Decodable2718; diff --git a/src/tx_receipt_trie.rs b/crates/eth-trie-proofs/src/tx_receipt_trie.rs similarity index 97% rename from src/tx_receipt_trie.rs rename to crates/eth-trie-proofs/src/tx_receipt_trie.rs index 98547c1..0f428ab 100644 --- a/src/tx_receipt_trie.rs +++ b/crates/eth-trie-proofs/src/tx_receipt_trie.rs @@ -7,9 +7,9 @@ use ethereum_types::H256; use url::Url; use crate::{ + error::EthTrieError, rpc::RpcProvider, tx_receipt::{ConsensusTxReceipt, RpcTxReceipt}, - EthTrieError, }; /// Represents a handler for transactions Merkle Patricia Trie (MPT) operations, @@ -169,6 +169,8 @@ mod tests { use alloy::primitives::B256; const MAINNET_RPC_URL: &str = "https://mainnet.infura.io/v3/720000a7936b45c79d0868f70478e2e9"; + const MAINNET_RPC_URL2: &str = + "https://eth-mainnet.g.alchemy.com/v2/FZEXaYqCaVKtHHr0B6uPaTavacl9uDAX"; // Test cases // Byzantium: 4370000 @@ -224,7 +226,7 @@ mod tests { #[tokio::test] async fn test_tx_receipt_1559() { - let url = Url::parse(MAINNET_RPC_URL).unwrap(); + let url = Url::parse(MAINNET_RPC_URL2).unwrap(); let target_tx_hash = B256::from(hex!( "2055b7e01304f87f9412cd44758cd248bc2da2dab95c97026064ffb084711735" )); diff --git a/src/tx_trie.rs b/crates/eth-trie-proofs/src/tx_trie.rs similarity index 98% rename from src/tx_trie.rs rename to crates/eth-trie-proofs/src/tx_trie.rs index f1f74b2..f17e9e2 100644 --- a/src/tx_trie.rs +++ b/crates/eth-trie-proofs/src/tx_trie.rs @@ -7,9 +7,9 @@ use ethereum_types::H256; use url::Url; use crate::{ + error::EthTrieError, rpc::RpcProvider, tx::{ConsensusTx, RpcTx}, - EthTrieError, }; /// Represents a handler for transactions Merkle Patricia Trie (MPT) operations, @@ -168,6 +168,7 @@ mod tests { use alloy::primitives::B256; const MAINNET_RPC_URL: &str = "https://mainnet.infura.io/v3/720000a7936b45c79d0868f70478e2e9"; + const MAINNET_RPC_URL_SUB: &str = "https://ethereum-rpc.publicnode.com"; // Test cases // Frontier: 46147 @@ -178,7 +179,7 @@ mod tests { #[tokio::test] async fn test_tx_mpt_frontier() { - let url = Url::parse(MAINNET_RPC_URL).unwrap(); + let url = Url::parse(MAINNET_RPC_URL_SUB).unwrap(); let target_tx_hash = B256::from(hex!( "5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060" )); diff --git a/crates/sn-trie-proofs/Cargo.toml b/crates/sn-trie-proofs/Cargo.toml new file mode 100644 index 0000000..7fd534f --- /dev/null +++ b/crates/sn-trie-proofs/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "sn-trie-proofs" +version = "0.1.0" +edition = "2021" +description = "Starknet Transaction Trie Proofs" +readme = "README.md" +license-file = "LICENSE" +repository = "https://github.com/HerodotusDev/eth-trie-proofs" +keywords = ["mpt", "trie", "starknet"] +categories = ["cryptography", "data-structures", "blockchain"] +exclude = [".github"] + +[dependencies] +starknet-types-core.workspace = true +starknet-types-rpc.workspace = true +sn-merkle-trie.workspace = true +bitflags.workspace = true +thiserror.workspace = true +serde_json.workspace = true +tokio.workspace = true +reqwest.workspace = true diff --git a/crates/sn-trie-proofs/README.md b/crates/sn-trie-proofs/README.md new file mode 100644 index 0000000..bcd9c31 --- /dev/null +++ b/crates/sn-trie-proofs/README.md @@ -0,0 +1,73 @@ +# sn-trie-proofs + +![CI](https://img.shields.io/github/actions/workflow/status/HerodotusDev/eth-trie-proofs/ci.yml?style=flat-square&logo=githubactions&logoColor=white&label=CI) +[![Crates.io](https://img.shields.io/crates/v/eth-trie-proofs?style=flat-square&logo=lootcrate)](https://crates.io/crates/sn-trie-proofs) +[![Documentation](https://img.shields.io/docsrs/sn-trie-proofs)](https://docs.rs/sn-trie-proofs) + +A comprehensive transaction/receipt inclusion proofs handler for [Starknet trie](https://docs.starknet.io/architecture-and-concepts/network-architecture/starknet-state/#merkle_patricia_trie). Tested with various versions including v0.12.3 ~ v 0.13.2. This library exposes various proof building functionalities, verification, trie construction etc. + +## Installation + +Add dependency `sn-trie-proofs` to your project: + +``` +sn-trie-proofs = { git = "https://github.com/HerodotusDev/trie-proofs.git" } +``` + +## Usage + +- **Transaction Trie Handler** + +```rust + #[tokio::test] +async fn test_build_tx_tree_from_block_3() { + let mut handler = TxsMptHandler::new(PATHFINDER_URL).unwrap(); + // # 0.13.1.1 + let block_number = 70015; + handler + .build_tx_tree_from_block(block_number) + .await + .unwrap(); + + let proof = handler.get_proof(0).unwrap(); + let membership: Membership = handler.verify_proof(0, proof).unwrap(); + + assert!(membership.is_member()); +} +``` + +- **Transaction Receipt Trie Handler** + +Currently we only supporting receipt trie after 0.13.2 version. + +```rust +#[tokio::test] +async fn test_build_tx_tree_from_block_4() { + let mut handler = TxReceiptsMptHandler::new(PATHFINDER_URL).unwrap(); + // # 0.13.2 + let block_number = 99708; + handler + .build_tx_receipts_tree_from_block(block_number) + .await + .unwrap(); + + let proof = handler.get_proof(0).unwrap(); + let membership: Membership = handler.verify_proof(0, proof).unwrap(); + + assert!(membership.is_member()); +} +``` + +### Credit + +For trie implementation, this project depends on the [sn-merkle-trie](https://github.com/rkdud007/sn-merkle-trie), code is mostly from [pathfinder's merkle tree implementation](https://github.com/eqlabs/pathfinder/tree/9e0ceec2c56a88ed58b6e49ee7ca6bccd703af33/crates/merkle-tree). + +For transaction and transaction receipt types, using [types-rs](https://github.com/starknet-io/types-rs). + +## License + +`sn-trie-proofs` is licensed under the [GNU General Public License v3.0](../../LICENSE). + +--- + +Herodotus Dev Ltd - 2024 diff --git a/crates/sn-trie-proofs/src/error.rs b/crates/sn-trie-proofs/src/error.rs new file mode 100644 index 0000000..c9ccf27 --- /dev/null +++ b/crates/sn-trie-proofs/src/error.rs @@ -0,0 +1,21 @@ +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum SnTrieError { + #[error("Starknet error: {0}")] + GatewayError(u16), + #[error("Trie not found")] + TrieNotFound, + + #[error("Invalid transaction index")] + InvalidTxIndex, + + #[error("Invalid commit")] + InvalidCommitment, + + #[error("Verification error")] + VerificationError, + + #[error("Unsupported protocol")] + UnsupportedProtocol, +} diff --git a/crates/sn-trie-proofs/src/lib.rs b/crates/sn-trie-proofs/src/lib.rs new file mode 100644 index 0000000..e3a0911 --- /dev/null +++ b/crates/sn-trie-proofs/src/lib.rs @@ -0,0 +1,8 @@ +pub mod error; +pub mod rpc; +pub mod tx_hash; +pub mod tx_receipt_hash; +pub mod tx_receipt_trie; +pub mod tx_trie; + +pub use error::SnTrieError; diff --git a/crates/sn-trie-proofs/src/rpc.rs b/crates/sn-trie-proofs/src/rpc.rs new file mode 100644 index 0000000..08df5ba --- /dev/null +++ b/crates/sn-trie-proofs/src/rpc.rs @@ -0,0 +1,138 @@ +use serde_json::{json, Value}; +use starknet_types_core::felt::Felt; +use starknet_types_rpc::{BlockWithReceipts, BlockWithTxs}; + +use crate::error::SnTrieError; + +pub struct RpcProvider<'a> { + url: &'a str, + gateway_url: &'a str, +} + +impl<'a> RpcProvider<'a> { + pub(crate) fn new(rpc_url: &'a str, gateway_url: &'a str) -> Self { + Self { + url: rpc_url, + gateway_url, + } + } + + pub(crate) async fn get_block_transactions( + &self, + block_number: u64, + ) -> Result<(BlockWithTxs, String), SnTrieError> { + let request = json!({ + "jsonrpc": "2.0", + "id": "0", + "method": "starknet_getBlockWithTxs", + "params": { + "block_id": {"block_number": block_number}, + } + }); + + let url = self.url; + let provider = reqwest::Client::new(); + let response = provider.post(url).json(&request).send().await.unwrap(); + let response_json = + serde_json::from_str::(&response.text().await.unwrap()).unwrap() + ["result"] + .clone(); + + let get_proof_output: BlockWithTxs = serde_json::from_value(response_json).unwrap(); + let gateway = GatewayProvider::new(self.gateway_url); + let transaction_commitment = gateway.get_tx_commit(block_number).await.unwrap(); + + Ok((get_proof_output, transaction_commitment)) + } + + pub(crate) async fn get_block_transactions_receipts( + &self, + block_number: u64, + ) -> Result<(BlockWithReceipts, Vec, String), SnTrieError> { + let request = json!({ + "jsonrpc": "2.0", + "id": "0", + "method": "starknet_getBlockWithReceipts", + "params": { + "block_id": {"block_number": block_number}, + } + }); + + let url = self.url; + let provider = reqwest::Client::new(); + let response = provider.post(url).json(&request).send().await.unwrap(); + let response_json = + serde_json::from_str::(&response.text().await.unwrap()).unwrap() + ["result"] + .clone(); + + let get_proof_output: BlockWithReceipts = + serde_json::from_value(response_json).unwrap(); + let gateway = GatewayProvider::new(self.gateway_url); + let (l1_gas_vec, receipt_commitment) = gateway.get_l1_gas(block_number).await.unwrap(); + + Ok((get_proof_output, l1_gas_vec, receipt_commitment)) + } +} + +pub const GATEWAY_URL: &str = "https://alpha-sepolia.starknet.io"; + +pub struct GatewayProvider { + base_url: String, +} + +impl GatewayProvider { + pub fn new(base_url: impl AsRef) -> Self { + Self { + base_url: base_url.as_ref().to_string(), + } + } + + async fn get_tx_commit(&self, block_number: u64) -> Result { + let url = format!( + "{}/feeder_gateway/get_block?blockNumber={}", + self.base_url, block_number + ); + + let client = reqwest::Client::new(); + let response = client.get(&url).send().await.unwrap(); + + if response.status().is_success() { + let block_data: Value = response.json().await.unwrap(); + let block_data: &Value = &block_data["transaction_commitment"]; + Ok(block_data.to_string()) + } else { + Err(SnTrieError::GatewayError(response.status().as_u16())) + } + } + + /// Note: This method is only available after 0.13.2 + async fn get_l1_gas(&self, block_number: u64) -> Result<(Vec, String), SnTrieError> { + let url = format!( + "{}/feeder_gateway/get_block?blockNumber={}", + self.base_url, block_number + ); + + let client = reqwest::Client::new(); + let response = client.get(&url).send().await.unwrap(); + + if response.status().is_success() { + let block_data: Value = response.json().await.unwrap(); + + println!("{:?}", block_data); + let receipt_commitment = block_data["receipt_commitment"].to_string(); + let transaction_receipts = block_data["transaction_receipts"].as_array().unwrap(); + + let gas_consumed: Vec = transaction_receipts + .iter() + .filter_map(|receipt| { + receipt["execution_resources"]["total_gas_consumed"]["l1_gas"].as_u64() + }) + .collect(); + + Ok((gas_consumed, receipt_commitment)) + } else { + Err(SnTrieError::GatewayError(response.status().as_u16())) + } + } +} diff --git a/crates/sn-trie-proofs/src/tx_hash.rs b/crates/sn-trie-proofs/src/tx_hash.rs new file mode 100644 index 0000000..4af2902 --- /dev/null +++ b/crates/sn-trie-proofs/src/tx_hash.rs @@ -0,0 +1,83 @@ +use starknet_types_core::hash::{Pedersen, Poseidon}; +use starknet_types_core::{felt::Felt, hash::StarkHash}; +use starknet_types_rpc::{Txn, TxnWithHash}; + +pub fn calculate_transaction_hash(tx: &TxnWithHash, protocol_version: &str) -> Felt { + if protocol_version >= "0.13.2" { + let mut hash_chains = vec![tx.transaction_hash]; + + match &tx.transaction { + Txn::Deploy(_) | Txn::L1Handler(_) => { + hash_chains.push(Felt::ZERO); + } + tx_type => { + let signatures = match &tx_type { + Txn::Invoke(invoke_tx) => match invoke_tx { + starknet_types_rpc::InvokeTxn::V0(tx) => &tx.signature, + starknet_types_rpc::InvokeTxn::V1(tx) => &tx.signature, + starknet_types_rpc::InvokeTxn::V3(tx) => &tx.signature, + }, + Txn::Declare(declare_tx) => match declare_tx { + starknet_types_rpc::DeclareTxn::V0(tx) => &tx.signature, + starknet_types_rpc::DeclareTxn::V1(tx) => &tx.signature, + starknet_types_rpc::DeclareTxn::V2(tx) => &tx.signature, + starknet_types_rpc::DeclareTxn::V3(tx) => &tx.signature, + }, + Txn::DeployAccount(deploy_account_tx) => match deploy_account_tx { + starknet_types_rpc::DeployAccountTxn::V1(tx) => &tx.signature, + starknet_types_rpc::DeployAccountTxn::V3(tx) => &tx.signature, + }, + _ => unreachable!(), + }; + for sig in signatures { + hash_chains.push(*sig); + } + } + } + + Poseidon::hash_array(&hash_chains) + } else if protocol_version < "0.11.1" { + let (transaction_hash, signature_hash) = match &tx.transaction { + Txn::Invoke(invoke_tx) => { + let signatures = match invoke_tx { + starknet_types_rpc::InvokeTxn::V0(tx) => &tx.signature, + starknet_types_rpc::InvokeTxn::V1(tx) => &tx.signature, + starknet_types_rpc::InvokeTxn::V3(tx) => &tx.signature, + }; + (tx.transaction_hash, Pedersen::hash_array(signatures)) + } + _ => (tx.transaction_hash, Pedersen::hash_array(&[])), + }; + + Pedersen::hash(&transaction_hash, &signature_hash) + } else if protocol_version < "0.13.2" { + let (transaction_hash, signature_hash) = match &tx.transaction { + Txn::Deploy(_) | Txn::L1Handler(_) => (tx.transaction_hash, Pedersen::hash_array(&[])), + _ => { + let signatures = match &tx.transaction { + Txn::Invoke(invoke_tx) => match invoke_tx { + starknet_types_rpc::InvokeTxn::V0(tx) => &tx.signature, + starknet_types_rpc::InvokeTxn::V1(tx) => &tx.signature, + starknet_types_rpc::InvokeTxn::V3(tx) => &tx.signature, + }, + Txn::Declare(declare_tx) => match declare_tx { + starknet_types_rpc::DeclareTxn::V0(tx) => &tx.signature, + starknet_types_rpc::DeclareTxn::V1(tx) => &tx.signature, + starknet_types_rpc::DeclareTxn::V2(tx) => &tx.signature, + starknet_types_rpc::DeclareTxn::V3(tx) => &tx.signature, + }, + Txn::DeployAccount(deploy_account_tx) => match deploy_account_tx { + starknet_types_rpc::DeployAccountTxn::V1(tx) => &tx.signature, + starknet_types_rpc::DeployAccountTxn::V3(tx) => &tx.signature, + }, + _ => unreachable!(), + }; + (tx.transaction_hash, Pedersen::hash_array(signatures)) + } + }; + + Pedersen::hash(&transaction_hash, &signature_hash) + } else { + panic!("Invalid protocol version") + } +} diff --git a/crates/sn-trie-proofs/src/tx_receipt_hash.rs b/crates/sn-trie-proofs/src/tx_receipt_hash.rs new file mode 100644 index 0000000..b7fa52f --- /dev/null +++ b/crates/sn-trie-proofs/src/tx_receipt_hash.rs @@ -0,0 +1,62 @@ +use starknet_types_core::{ + felt::Felt, + hash::{Poseidon, StarkHash}, +}; +use starknet_types_rpc::{MsgToL1, TransactionAndReceipt}; + +pub fn calculate_receipt_hash(receipt: &TransactionAndReceipt, l1_gas: u64) -> Felt { + let mut hash_chains = vec![]; + let common_properties = match &receipt.receipt { + starknet_types_rpc::TxnReceipt::Declare(tx_receipt) => { + &tx_receipt.common_receipt_properties + } + starknet_types_rpc::TxnReceipt::Deploy(tx_receipt) => &tx_receipt.common_receipt_properties, + starknet_types_rpc::TxnReceipt::DeployAccount(tx_receipt) => { + &tx_receipt.common_receipt_properties + } + starknet_types_rpc::TxnReceipt::Invoke(tx_receipt) => &tx_receipt.common_receipt_properties, + starknet_types_rpc::TxnReceipt::L1Handler(tx_receipt) => { + &tx_receipt.common_receipt_properties + } + }; + + hash_chains.push(common_properties.transaction_hash); + hash_chains.push(common_properties.actual_fee.amount); + hash_chains.push(calculate_messages_sent_hash( + &common_properties.messages_sent, + )); + // TODO: calculate_revert_reason_hash + hash_chains.push(Felt::ZERO); + + // chain_gas_consumed + hash_chains.push(Felt::ZERO); + hash_chains.push(l1_gas.into()); + hash_chains.push( + common_properties + .execution_resources + .data_availability + .l1_data_gas + .into(), + ); + + Poseidon::hash_array(&hash_chains) +} + +pub fn calculate_messages_sent_hash(messages: &Vec>) -> Felt { + let mut hash_chains = vec![]; + hash_chains.push(Felt::from(messages.len() as u64)); + for message in messages { + hash_chains.push(message.from_address); + hash_chains.push(message.to_address); + hash_chains.push(Felt::from(message.payload.len())); + for p in message.payload.clone() { + hash_chains.push(p); + } + } + Poseidon::hash_array(&hash_chains) +} + +// Returns starknet-keccak of the revert reason ASCII string, or 0 if the transaction succeeded. +// pub fn calculate_revert_reason_hash(execution_status: String, revert_reason: String) -> Felt { + +// } diff --git a/crates/sn-trie-proofs/src/tx_receipt_trie.rs b/crates/sn-trie-proofs/src/tx_receipt_trie.rs new file mode 100644 index 0000000..93fbff7 --- /dev/null +++ b/crates/sn-trie-proofs/src/tx_receipt_trie.rs @@ -0,0 +1,183 @@ +use crate::error::SnTrieError; +use crate::tx_receipt_hash::calculate_receipt_hash; +use sn_merkle_trie::conversion::from_u64_to_bits; +use sn_merkle_trie::node::TrieNode; +use sn_merkle_trie::transaction::TransactionMerkleTree; +use sn_merkle_trie::{Membership, MerkleTree}; +use starknet_types_core::hash::{Poseidon, StarkHash}; +use starknet_types_core::{felt::Felt, hash::Pedersen}; + +use super::rpc::RpcProvider; +use super::rpc::GATEWAY_URL; + +/// Note: only implemented after 0.13.2 version +pub struct TxReceiptsMptHandler<'a> { + provider: RpcProvider<'a>, + trie: Option, +} + +pub struct TxReceiptsMpt { + pub trie: TransactionMerkleTree, + pub elements: Vec, + root: Felt, + root_idx: u64, +} + +impl<'a> TxReceiptsMptHandler<'a> { + pub fn new(rpc_url: &'a str) -> Result { + let provider = RpcProvider::new(rpc_url, GATEWAY_URL); + Ok(Self { + provider, + trie: None, + }) + } + + /// Build + pub async fn build_tx_receipts_tree_from_block( + &mut self, + block_number: u64, + ) -> Result<(), SnTrieError> { + let (txs, vec_l1_gas, expected_commit) = self + .provider + .get_block_transactions_receipts(block_number) + .await + .expect("rpc fetch failed"); + let protocol = txs.block_header.starknet_version; + + if protocol.as_str() < "0.13.2" { + return Err(SnTrieError::UnsupportedProtocol); + } + + let tx_final_hashes: Vec = txs + .transactions + .iter() + .zip(vec_l1_gas.iter()) + .map(|(t, &l1_gas)| calculate_receipt_hash(t, l1_gas)) + .collect(); + + self.build_trie(tx_final_hashes, &expected_commit, &protocol)?; + Ok(()) + } + + pub fn build_trie( + &mut self, + txs: Vec, + expected_commit: &str, + protocol: &str, + ) -> Result<(), SnTrieError> { + let trie = if protocol >= "0.13.2" { + self.build_trie_generic::(txs, expected_commit)? + } else { + self.build_trie_generic::(txs, expected_commit)? + }; + + self.trie = Some(trie); + Ok(()) + } + + fn build_trie_generic( + &self, + txs: Vec, + expected_commit: &str, + ) -> Result { + let mut tree = if std::any::TypeId::of::() == std::any::TypeId::of::() { + TransactionMerkleTree::Poseidon(MerkleTree::default()) + } else { + TransactionMerkleTree::Pedersen(MerkleTree::default()) + }; + + for (idx, hash) in txs.clone().into_iter().enumerate() { + let idx: u64 = idx.try_into().unwrap(); + let key = from_u64_to_bits(idx); + tree.set(key, hash).expect("set failed"); + } + + let (root, root_idx) = tree.commit().expect("commit failed"); + + let cleaned_expected_commit = expected_commit.trim_matches('"').to_string(); + assert_eq!(cleaned_expected_commit, root.to_hex_string()); + if cleaned_expected_commit != root.to_hex_string() { + return Err(SnTrieError::InvalidCommitment); + } + + Ok(TxReceiptsMpt { + trie: tree, + elements: txs, + root, + root_idx, + }) + } + + pub fn get_proof(&self, tx_index: u64) -> Result, SnTrieError> { + let trie = self.trie.as_ref().ok_or(SnTrieError::TrieNotFound)?; + let root_idx = trie.root_idx; + let proof = trie + .trie + .get_proof(root_idx, from_u64_to_bits(tx_index)) + .unwrap() + .ok_or(SnTrieError::TrieNotFound)?; + Ok(proof) + } + + pub fn verify_proof( + &self, + tx_index: u64, + proof: Vec, + ) -> Result { + let trie = self.trie.as_ref().ok_or(SnTrieError::TrieNotFound)?; + let value = trie + .elements + .get(tx_index as usize) + .ok_or(SnTrieError::InvalidTxIndex)?; + + let result = trie + .trie + .verify_proof(trie.root, &from_u64_to_bits(tx_index), *value, &proof) + .ok_or(SnTrieError::VerificationError)?; + Ok(result) + } + + pub fn get_root_idx(&self) -> Result { + let trie = self.trie.as_ref().ok_or(SnTrieError::TrieNotFound)?; + let root_idx = trie.root_idx; + Ok(root_idx) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + const PATHFINDER_URL: &str = "https://pathfinder.sepolia.iosis.tech/"; + + #[tokio::test] + async fn test_build_tx_tree_from_block_4() { + let mut handler = TxReceiptsMptHandler::new(PATHFINDER_URL).unwrap(); + // # 0.13.2 + let block_number = 99708; + handler + .build_tx_receipts_tree_from_block(block_number) + .await + .unwrap(); + + let proof = handler.get_proof(0).unwrap(); + let membership: Membership = handler.verify_proof(0, proof).unwrap(); + + assert!(membership.is_member()); + + let proof = handler.get_proof(1).unwrap(); + let membership: Membership = handler.verify_proof(1, proof).unwrap(); + + assert!(membership.is_member()); + + let proof = handler.get_proof(2).unwrap(); + let membership: Membership = handler.verify_proof(2, proof).unwrap(); + + assert!(membership.is_member()); + + let proof = handler.get_proof(3).unwrap(); + let membership: Membership = handler.verify_proof(3, proof).unwrap(); + + assert!(membership.is_member()); + } +} diff --git a/crates/sn-trie-proofs/src/tx_trie.rs b/crates/sn-trie-proofs/src/tx_trie.rs new file mode 100644 index 0000000..69b3f22 --- /dev/null +++ b/crates/sn-trie-proofs/src/tx_trie.rs @@ -0,0 +1,252 @@ +use crate::error::SnTrieError; +use sn_merkle_trie::conversion::from_u64_to_bits; +use sn_merkle_trie::node::TrieNode; +use sn_merkle_trie::transaction::TransactionMerkleTree; +use sn_merkle_trie::{Membership, MerkleTree}; +use starknet_types_core::hash::{Poseidon, StarkHash}; +use starknet_types_core::{felt::Felt, hash::Pedersen}; + +use super::rpc::GATEWAY_URL; +use super::{rpc::RpcProvider, tx_hash::calculate_transaction_hash}; + +pub struct TxsMptHandler<'a> { + provider: RpcProvider<'a>, + trie: Option, +} + +pub struct TxsMpt { + pub trie: TransactionMerkleTree, + pub elements: Vec, + root: Felt, + root_idx: u64, +} + +impl<'a> TxsMptHandler<'a> { + pub fn new(rpc_url: &'a str) -> Result { + let provider = RpcProvider::new(rpc_url, GATEWAY_URL); + Ok(Self { + provider, + trie: None, + }) + } + + pub async fn build_tx_tree_from_block(&mut self, block_number: u64) -> Result<(), SnTrieError> { + let (txs, expected_commit) = self + .provider + .get_block_transactions(block_number) + .await + .expect("rpc fetch failed"); + let protocol = txs.block_header.starknet_version; + let tx_final_hashes: Vec = txs + .transactions + .iter() + .map(|t| calculate_transaction_hash(t, &protocol)) + .collect(); + self.build_trie(tx_final_hashes, &expected_commit, &protocol)?; + Ok(()) + } + + pub fn build_trie( + &mut self, + txs: Vec, + expected_commit: &str, + protocol: &str, + ) -> Result<(), SnTrieError> { + let trie = if protocol >= "0.13.2" { + self.build_trie_generic::(txs, expected_commit)? + } else { + self.build_trie_generic::(txs, expected_commit)? + }; + + self.trie = Some(trie); + Ok(()) + } + + fn build_trie_generic( + &self, + txs: Vec, + expected_commit: &str, + ) -> Result { + let mut tree = if std::any::TypeId::of::() == std::any::TypeId::of::() { + TransactionMerkleTree::Poseidon(MerkleTree::default()) + } else { + TransactionMerkleTree::Pedersen(MerkleTree::default()) + }; + + for (idx, hash) in txs.clone().into_iter().enumerate() { + let idx: u64 = idx.try_into().unwrap(); + let key = from_u64_to_bits(idx); + tree.set(key, hash).expect("set failed"); + } + + let (root, root_idx) = tree.commit().expect("commit failed"); + + let cleaned_expected_commit = expected_commit.trim_matches('"').to_string(); + assert_eq!(cleaned_expected_commit, root.to_hex_string()); + if cleaned_expected_commit != root.to_hex_string() { + return Err(SnTrieError::InvalidCommitment); + } + + Ok(TxsMpt { + trie: tree, + elements: txs, + root, + root_idx, + }) + } + + pub fn get_proof(&self, tx_index: u64) -> Result, SnTrieError> { + let trie = self.trie.as_ref().ok_or(SnTrieError::TrieNotFound)?; + let root_idx = trie.root_idx; + let proof = trie + .trie + .get_proof(root_idx, from_u64_to_bits(tx_index)) + .unwrap() + .ok_or(SnTrieError::TrieNotFound)?; + Ok(proof) + } + + pub fn verify_proof( + &self, + tx_index: u64, + proof: Vec, + ) -> Result { + let trie = self.trie.as_ref().ok_or(SnTrieError::TrieNotFound)?; + let value = trie + .elements + .get(tx_index as usize) + .ok_or(SnTrieError::InvalidTxIndex)?; + + let result = trie + .trie + .verify_proof(trie.root, &from_u64_to_bits(tx_index), *value, &proof) + .ok_or(SnTrieError::VerificationError)?; + Ok(result) + } + + pub fn get_root_idx(&self) -> Result { + let trie = self.trie.as_ref().ok_or(SnTrieError::TrieNotFound)?; + let root_idx = trie.root_idx; + Ok(root_idx) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + const PATHFINDER_URL: &str = "https://pathfinder.sepolia.iosis.tech/"; + + #[tokio::test] + async fn test_build_tx_tree_from_block_0() { + let mut handler = TxsMptHandler::new(PATHFINDER_URL).unwrap(); + // # 0.12.3 + let block_number = 7; + handler + .build_tx_tree_from_block(block_number) + .await + .unwrap(); + let proof = handler.get_proof(0).unwrap(); + let membership: Membership = handler.verify_proof(0, proof).unwrap(); + + assert!(membership.is_member()); + + let proof = handler.get_proof(1).unwrap(); + let membership: Membership = handler.verify_proof(1, proof).unwrap(); + + assert!(membership.is_member()); + } + + #[tokio::test] + async fn test_build_tx_tree_from_block_1() { + let mut handler = TxsMptHandler::new(PATHFINDER_URL).unwrap(); + // # 0.13.0 + let block_number = 35000; + handler + .build_tx_tree_from_block(block_number) + .await + .unwrap(); + + let proof = handler.get_proof(0).unwrap(); + let membership: Membership = handler.verify_proof(0, proof).unwrap(); + + assert!(membership.is_member()); + + let proof = handler.get_proof(1).unwrap(); + let membership: Membership = handler.verify_proof(1, proof).unwrap(); + + assert!(membership.is_member()); + } + + #[tokio::test] + async fn test_build_tx_tree_from_block_2() { + let mut handler = TxsMptHandler::new(PATHFINDER_URL).unwrap(); + // # 0.13.1 + let block_number = 51190; + handler + .build_tx_tree_from_block(block_number) + .await + .unwrap(); + let proof = handler.get_proof(0).unwrap(); + let membership: Membership = handler.verify_proof(0, proof).unwrap(); + + assert!(membership.is_member()); + + let proof = handler.get_proof(1).unwrap(); + let membership: Membership = handler.verify_proof(1, proof).unwrap(); + + assert!(membership.is_member()); + } + + #[tokio::test] + async fn test_build_tx_tree_from_block_3() { + let mut handler = TxsMptHandler::new(PATHFINDER_URL).unwrap(); + // # 0.13.1.1 + let block_number = 70015; + handler + .build_tx_tree_from_block(block_number) + .await + .unwrap(); + + let proof = handler.get_proof(0).unwrap(); + let membership: Membership = handler.verify_proof(0, proof).unwrap(); + + assert!(membership.is_member()); + + let proof = handler.get_proof(1).unwrap(); + let membership: Membership = handler.verify_proof(1, proof).unwrap(); + + assert!(membership.is_member()); + } + + #[tokio::test] + async fn test_build_tx_tree_from_block_4() { + let mut handler = TxsMptHandler::new(PATHFINDER_URL).unwrap(); + // # 0.13.2 + let block_number = 99708; + handler + .build_tx_tree_from_block(block_number) + .await + .unwrap(); + + let proof = handler.get_proof(0).unwrap(); + let membership: Membership = handler.verify_proof(0, proof).unwrap(); + + assert!(membership.is_member()); + + let proof = handler.get_proof(1).unwrap(); + let membership: Membership = handler.verify_proof(1, proof).unwrap(); + + assert!(membership.is_member()); + + let proof = handler.get_proof(2).unwrap(); + let membership: Membership = handler.verify_proof(2, proof).unwrap(); + + assert!(membership.is_member()); + + let proof = handler.get_proof(3).unwrap(); + let membership: Membership = handler.verify_proof(3, proof).unwrap(); + + assert!(membership.is_member()); + } +}