From 04759dd5f1ffdc1697c2a047bdda0038a1e85d94 Mon Sep 17 00:00:00 2001 From: PJColombo Date: Wed, 6 Nov 2024 12:51:35 +0100 Subject: [PATCH] chore: migrate from `ethers-rs` to `alloy` --- Cargo.lock | 2998 ++++++++++++++--- Cargo.toml | 5 +- src/clients/beacon/types.rs | 16 +- src/clients/blobscan/types.rs | 172 +- src/context.rs | 105 +- .../event_handlers/finalized_checkpoint.rs | 9 +- src/indexer/event_handlers/head.rs | 1125 +++---- src/indexer/mod.rs | 4 +- src/slots_processor/error.rs | 2 +- src/slots_processor/helpers.rs | 32 +- src/slots_processor/mod.rs | 19 +- src/synchronizer/mod.rs | 13 +- src/utils/web3.rs | 49 +- 13 files changed, 3241 insertions(+), 1308 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a8389a..17eaaf4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -38,6 +38,19 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -47,6 +60,471 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "alloy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea8ebf106e84a1c37f86244df7da0c7587e697b71a0d565cce079449b85ac6f8" +dependencies = [ + "alloy-consensus", + "alloy-core", + "alloy-eips", + "alloy-genesis", + "alloy-network", + "alloy-provider", + "alloy-rpc-client", + "alloy-rpc-types", + "alloy-serde", + "alloy-transport", + "alloy-transport-http", +] + +[[package]] +name = "alloy-chains" +version = "0.1.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18c5c520273946ecf715c0010b4e3503d7eba9893cd9ce6b7fff5654c4a3c470" +dependencies = [ + "alloy-primitives", + "num_enum", + "strum", +] + +[[package]] +name = "alloy-consensus" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed961a48297c732a5d97ee321aa8bb5009ecadbcb077d8bec90cb54e651629" +dependencies = [ + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "auto_impl", + "c-kzg", + "derive_more", + "serde", +] + +[[package]] +name = "alloy-core" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47ef9e96462d0b9fee9008c53c1f3d017b9498fcdef3ad8d728db98afef47955" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-primitives", + "alloy-rlp", + "alloy-sol-types", +] + +[[package]] +name = "alloy-dyn-abi" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85132f2698b520fab3f54beed55a44389f7006a7b557a0261e1e69439dcc1572" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-type-parser", + "alloy-sol-types", + "const-hex", + "itoa", + "serde", + "serde_json", + "winnow", +] + +[[package]] +name = "alloy-eip2930" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "serde", +] + +[[package]] +name = "alloy-eip7702" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ffc577390ce50234e02d841214b3dc0bea6aaaae8e04bbf3cb82e9a45da9eb" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "derive_more", + "serde", +] + +[[package]] +name = "alloy-eips" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b69e06cf9c37be824b9d26d6d101114fdde6af0c87de2828b414c05c4b3daa71" +dependencies = [ + "alloy-eip2930", + "alloy-eip7702", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "c-kzg", + "derive_more", + "once_cell", + "serde", + "sha2", +] + +[[package]] +name = "alloy-genesis" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde15e14944a88bd6a57d325e9a49b75558746fe16aaccc79713ae50a6a9574c" +dependencies = [ + "alloy-primitives", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-json-abi" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded610181f3dad5810f6ff12d1a99994cf9b42d2fcb7709029352398a5da5ae6" +dependencies = [ + "alloy-primitives", + "alloy-sol-type-parser", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-json-rpc" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af5979e0d5a7bf9c7eb79749121e8256e59021af611322aee56e77e20776b4b3" +dependencies = [ + "alloy-primitives", + "alloy-sol-types", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "alloy-network" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "204237129086ce5dc17a58025e93739b01b45313841f98fa339eb1d780511e57" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-json-rpc", + "alloy-network-primitives", + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde", + "alloy-signer", + "alloy-sol-types", + "async-trait", + "auto_impl", + "futures-utils-wasm", + "thiserror", +] + +[[package]] +name = "alloy-network-primitives" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514f70ee2a953db21631cd817b13a1571474ec77ddc03d47616d5e8203489fde" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-primitives" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd58d377699e6cfeab52c4a9d28bdc4ef37e2bd235ff2db525071fe37a2e9af5" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "foldhash", + "hashbrown 0.15.1", + "hex-literal", + "indexmap", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand", + "ruint", + "rustc-hash", + "serde", + "sha3", + "tiny-keccak", +] + +[[package]] +name = "alloy-provider" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4814d141ede360bb6cd1b4b064f1aab9de391e7c4d0d4d50ac89ea4bc1e25fbd" +dependencies = [ + "alloy-chains", + "alloy-consensus", + "alloy-eips", + "alloy-json-rpc", + "alloy-network", + "alloy-network-primitives", + "alloy-primitives", + "alloy-rpc-client", + "alloy-rpc-types-eth", + "alloy-transport", + "alloy-transport-http", + "async-stream", + "async-trait", + "auto_impl", + "dashmap", + "futures", + "futures-utils-wasm", + "lru", + "parking_lot", + "pin-project", + "reqwest 0.12.9", + "schnellru", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "url", + "wasmtimer", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0822426598f95e45dd1ea32a738dac057529a709ee645fcc516ffa4cbde08f" +dependencies = [ + "alloy-rlp-derive", + "arrayvec", + "bytes", +] + +[[package]] +name = "alloy-rlp-derive" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b09cae092c27b6f1bde952653a22708691802e57bfef4a2973b80bea21efd3f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "alloy-rpc-client" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc2bd1e7403463a5f2c61e955bcc9d3072b63aa177442b0f9aa6a6d22a941e3" +dependencies = [ + "alloy-json-rpc", + "alloy-primitives", + "alloy-transport", + "alloy-transport-http", + "futures", + "pin-project", + "reqwest 0.12.9", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower", + "tracing", + "url", + "wasmtimer", +] + +[[package]] +name = "alloy-rpc-types" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eea9bf1abdd506f985a53533f5ac01296bcd6102c5e139bbc5d40bc468d2c916" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-rpc-types-eth" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b034779a4850b4b03f5be5ea674a1cf7d746b2da762b34d1860ab45e48ca27" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-network-primitives", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "alloy-sol-types", + "derive_more", + "itertools 0.13.0", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-serde" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "028e72eaa9703e4882344983cfe7636ce06d8cce104a78ea62fd19b46659efc4" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-signer" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "592c185d7100258c041afac51877660c7bf6213447999787197db4842f0e938e" +dependencies = [ + "alloy-primitives", + "async-trait", + "auto_impl", + "elliptic-curve", + "k256", + "thiserror", +] + +[[package]] +name = "alloy-sol-macro" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a1b42ac8f45e2f49f4bcdd72cbfde0bb148f5481d403774ffa546e48b83efc1" +dependencies = [ + "alloy-sol-macro-expander", + "alloy-sol-macro-input", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06318f1778e57f36333e850aa71bd1bb5e560c10279e236622faae0470c50412" +dependencies = [ + "alloy-sol-macro-input", + "const-hex", + "heck", + "indexmap", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.87", + "syn-solidity", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaebb9b0ad61a41345a22c9279975c0cdd231b97947b10d7aad1cf0a7181e4a5" +dependencies = [ + "const-hex", + "dunce", + "heck", + "proc-macro2", + "quote", + "syn 2.0.87", + "syn-solidity", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12c71028bfbfec210e24106a542aad3def7caf1a70e2c05710e92a98481980d3" +dependencies = [ + "serde", + "winnow", +] + +[[package]] +name = "alloy-sol-types" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d7fb042d68ddfe79ccb23359de3007f6d4d53c13f703b64fb0db422132111" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-macro", + "const-hex", + "serde", +] + +[[package]] +name = "alloy-transport" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be77579633ebbc1266ae6fd7694f75c408beb1aeb6865d0b18f22893c265a061" +dependencies = [ + "alloy-json-rpc", + "base64 0.22.1", + "futures-util", + "futures-utils-wasm", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "tracing", + "url", + "wasmtimer", +] + +[[package]] +name = "alloy-transport-http" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91fd1a5d0827939847983b46f2f79510361f901dc82f8e3c38ac7397af142c6e" +dependencies = [ + "alloy-json-rpc", + "alloy-transport", + "reqwest 0.12.9", + "serde_json", + "tower", + "tracing", + "url", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -64,9 +542,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -79,53 +557,208 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "74f37166d7d48a0284b99dd824694c26119c700b53bf0d1540cdb147dbdaaf13" dependencies = [ "backtrace", ] +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.1", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + [[package]] name = "arrayvec" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "ascii-canvas" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +dependencies = [ + "term", +] + +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "async-trait" version = "0.1.83" @@ -134,7 +767,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -145,19 +778,7 @@ checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" dependencies = [ "futures", "pharos", - "rustc_version", -] - -[[package]] -name = "auto_impl" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", + "rustc_version 0.4.1", ] [[package]] @@ -168,7 +789,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -193,46 +814,24 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets 0.52.6", -] - -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - -[[package]] -name = "base58" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" - -[[package]] -name = "base58check" -version = "0.1.0" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee2fe4c9a0c84515f136aaae2466744a721af6d63339c18689d9e995d74d99b" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "base58", - "sha2 0.8.2", + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] -name = "base64" -version = "0.12.3" +name = "base16ct" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" @@ -260,19 +859,25 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bech32" -version = "0.7.3" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dabbe35f96fb9507f7330793dc490461b2962659ac5d427181e451a623751d1" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" [[package]] -name = "bincode" -version = "1.3.3" +name = "bit-set" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" dependencies = [ - "serde", + "bit-vec", ] +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bitflags" version = "1.3.2" @@ -285,16 +890,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" -[[package]] -name = "bitvec" -version = "0.17.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41262f11d771fd4a61aa3ce019fca363b4b6c282fca9da2a31186d3965a47a5c" -dependencies = [ - "either", - "radium 0.3.0", -] - [[package]] name = "bitvec" version = "1.0.1" @@ -302,24 +897,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", - "radium 0.7.0", + "radium", "tap", "wyz", ] -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest 0.10.7", -] - [[package]] name = "blob-indexer" version = "0.1.0" dependencies = [ + "alloy", "anyhow", "async-trait", "backoff", @@ -333,12 +920,13 @@ dependencies = [ "hex", "jsonwebtoken", "mockall", - "reqwest", + "reqwest 0.11.27", "reqwest-eventsource", "sentry", "sentry-tracing", "serde", "serde_json", + "sha2", "thiserror", "tokio", "tracing", @@ -347,41 +935,36 @@ dependencies = [ "url", ] -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - [[package]] name = "block-buffer" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.7", + "generic-array", ] [[package]] -name = "block-padding" -version = "0.1.5" +name = "blst" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +checksum = "4378725facc195f1a538864863f6de233b500a8862747e7f165078a419d5e874" dependencies = [ - "byte-tools", + "cc", + "glob", + "threadpool", + "zeroize", ] [[package]] name = "bs58" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "sha2", + "tinyvec", +] [[package]] name = "bumpalo" @@ -395,12 +978,6 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - [[package]] name = "byteorder" version = "1.5.0" @@ -409,10 +986,46 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +dependencies = [ + "serde", +] + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "c-kzg" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "f0307f72feab3300336fb803a57134159f6e20139af1357f36c54cb90d8e8928" dependencies = [ + "blst", + "cc", + "glob", + "hex", + "libc", + "once_cell", "serde", ] @@ -436,13 +1049,13 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.15.4" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -450,10 +1063,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.28" +version = "1.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "0f57c4b4da2a9d619dd035f27316d7a426305b75be93d09e92f2b9229c34feaf" dependencies = [ + "jobserver", + "libc", "shlex", ] @@ -489,9 +1104,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -499,9 +1114,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -515,10 +1130,10 @@ version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -529,66 +1144,74 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "coins-bip32" -version = "0.7.0" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634c509653de24b439672164bbf56f5f582a2ab0e313d3b0f6af0b7345cf2560" +checksum = "3b6be4a5df2098cd811f3194f64ddb96c267606bffd9689ac7b0160097b01ad3" dependencies = [ - "bincode", "bs58", "coins-core", "digest 0.10.7", - "getrandom", "hmac", "k256", - "lazy_static", "serde", - "sha2 0.10.8", + "sha2", "thiserror", ] [[package]] name = "coins-bip39" -version = "0.7.0" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a11892bcac83b4c6e95ab84b5b06c76d9d70ad73548dd07418269c5c7977171" +checksum = "3db8fba409ce3dc04f7d804074039eb68b960b0829161f8e06c95fea3f122528" dependencies = [ - "bitvec 0.17.4", + "bitvec", "coins-bip32", - "getrandom", - "hex", "hmac", - "pbkdf2", + "once_cell", + "pbkdf2 0.12.2", "rand", - "sha2 0.10.8", + "sha2", "thiserror", ] [[package]] name = "coins-core" -version = "0.7.0" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c94090a6663f224feae66ab01e41a2555a8296ee07b5f20dab8888bdefc9f617" +checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" dependencies = [ - "base58check", - "base64 0.12.3", + "base64 0.21.7", "bech32", - "blake2", + "bs58", "digest 0.10.7", - "generic-array 0.14.7", + "generic-array", "hex", "ripemd", "serde", "serde_derive", - "sha2 0.10.8", + "sha2", "sha3", "thiserror", ] [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" + +[[package]] +name = "const-hex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0121754e84117e65f9d90648ee6aa4882a6e63110307ab73967a4c5e7e69e586" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", +] [[package]] name = "const-oid" @@ -597,13 +1220,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] -name = "convert_case" -version = "0.6.0" +name = "constant_time_eq" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "core-foundation" @@ -630,6 +1250,40 @@ dependencies = [ "libc", ] +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + [[package]] name = "crunchy" version = "0.2.2" @@ -638,11 +1292,11 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.4.9" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "generic-array 0.14.7", + "generic-array", "rand_core", "subtle", "zeroize", @@ -654,7 +1308,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.7", + "generic-array", "typenum", ] @@ -667,6 +1321,26 @@ dependencies = [ "cipher", ] +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "data-encoding" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" + [[package]] name = "debugid" version = "0.8.0" @@ -674,14 +1348,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ "serde", - "uuid 1.10.0", + "uuid 1.11.0", ] [[package]] name = "der" -version = "0.6.1" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", @@ -696,24 +1370,45 @@ dependencies = [ "powerfmt", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_more" -version = "0.99.18" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", + "unicode-xid", ] [[package]] name = "digest" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.12.4", + "generic-array", ] [[package]] @@ -722,11 +1417,65 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", + "block-buffer", + "const-oid", "crypto-common", "subtle", ] +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "dotenv" version = "0.15.0" @@ -753,14 +1502,16 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecdsa" -version = "0.14.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", + "digest 0.10.7", "elliptic-curve", "rfc6979", "signature", + "spki", ] [[package]] @@ -771,16 +1522,15 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" -version = "0.12.3" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "der", "digest 0.10.7", "ff", - "generic-array 0.14.7", + "generic-array", "group", "pkcs8", "rand_core", @@ -789,15 +1539,42 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ena" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" +dependencies = [ + "log", +] + [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] +[[package]] +name = "enr" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" +dependencies = [ + "base64 0.21.7", + "bytes", + "hex", + "k256", + "log", + "rand", + "rlp", + "serde", + "sha3", + "zeroize", +] + [[package]] name = "envy" version = "0.4.2" @@ -834,12 +1611,12 @@ dependencies = [ "digest 0.10.7", "hex", "hmac", - "pbkdf2", + "pbkdf2 0.11.0", "rand", "scrypt", "serde", "serde_json", - "sha2 0.10.8", + "sha2", "sha3", "thiserror", "uuid 0.8.2", @@ -895,9 +1672,9 @@ dependencies = [ [[package]] name = "ethers" -version = "1.0.2" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11f26f9d8d80da18ca72aca51804c65eb2153093af3bec74fd5ce32aa0c1f665" +checksum = "816841ea989f0c69e459af1cf23a6b0033b19a55424a1ea3a30099becdb8dec0" dependencies = [ "ethers-addressbook", "ethers-contract", @@ -906,13 +1683,14 @@ dependencies = [ "ethers-middleware", "ethers-providers", "ethers-signers", + "ethers-solc", ] [[package]] name = "ethers-addressbook" -version = "1.0.2" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4be54dd2260945d784e06ccdeb5ad573e8f1541838cee13a1ab885485eaa0b" +checksum = "5495afd16b4faa556c3bba1f21b98b4983e53c1755022377051a975c3b021759" dependencies = [ "ethers-core", "once_cell", @@ -922,16 +1700,16 @@ dependencies = [ [[package]] name = "ethers-contract" -version = "1.0.2" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9c3c3e119a89f0a9a1e539e7faecea815f74ddcf7c90d0b00d1f524db2fdc9c" +checksum = "6fceafa3578c836eeb874af87abacfb041f92b4da0a78a5edd042564b8ecdaaa" dependencies = [ + "const-hex", "ethers-contract-abigen", "ethers-contract-derive", "ethers-core", "ethers-providers", "futures-util", - "hex", "once_cell", "pin-project", "serde", @@ -941,70 +1719,69 @@ dependencies = [ [[package]] name = "ethers-contract-abigen" -version = "1.0.2" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d4e5ad46aede34901f71afdb7bb555710ed9613d88d644245c657dc371aa228" +checksum = "04ba01fbc2331a38c429eb95d4a570166781f14290ef9fdb144278a90b5a739b" dependencies = [ "Inflector", - "cfg-if", + "const-hex", "dunce", "ethers-core", + "ethers-etherscan", "eyre", - "getrandom", - "hex", + "prettyplease", "proc-macro2", "quote", "regex", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", - "syn 1.0.109", + "syn 2.0.87", "toml", - "url", "walkdir", ] [[package]] name = "ethers-contract-derive" -version = "1.0.2" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f192e8e4cf2b038318aae01e94e7644e0659a76219e94bcd3203df744341d61f" +checksum = "87689dcabc0051cde10caaade298f9e9093d65f6125c14575db3fd8c669a168f" dependencies = [ + "Inflector", + "const-hex", "ethers-contract-abigen", "ethers-core", - "hex", "proc-macro2", "quote", "serde_json", - "syn 1.0.109", + "syn 2.0.87", ] [[package]] name = "ethers-core" -version = "1.0.2" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade3e9c97727343984e1ceada4fdab11142d2ee3472d2c67027d56b1251d4f15" +checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" dependencies = [ "arrayvec", "bytes", "cargo_metadata", "chrono", - "convert_case", + "const-hex", "elliptic-curve", "ethabi", - "generic-array 0.14.7", - "hex", + "generic-array", "k256", + "num_enum", "once_cell", "open-fastrlp", - "proc-macro2", "rand", "rlp", - "rlp-derive", "serde", "serde_json", "strum", - "syn 1.0.109", + "syn 2.0.87", + "tempfile", "thiserror", "tiny-keccak", "unicode-xid", @@ -1012,16 +1789,15 @@ dependencies = [ [[package]] name = "ethers-etherscan" -version = "1.0.2" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9713f525348e5dde025d09b0a4217429f8074e8ff22c886263cc191e87d8216" +checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" dependencies = [ + "chrono", "ethers-core", - "getrandom", - "reqwest", - "semver", + "reqwest 0.11.27", + "semver 1.0.23", "serde", - "serde-aux", "serde_json", "thiserror", "tracing", @@ -1029,21 +1805,22 @@ dependencies = [ [[package]] name = "ethers-middleware" -version = "1.0.2" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e71df7391b0a9a51208ffb5c7f2d068900e99d6b3128d3a4849d138f194778b7" +checksum = "48f9fdf09aec667c099909d91908d5eaf9be1bd0e2500ba4172c1d28bfaa43de" dependencies = [ "async-trait", - "auto_impl 0.5.0", + "auto_impl", "ethers-contract", "ethers-core", "ethers-etherscan", "ethers-providers", "ethers-signers", + "futures-channel", "futures-locks", "futures-util", "instant", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "thiserror", @@ -1055,55 +1832,90 @@ dependencies = [ [[package]] name = "ethers-providers" -version = "1.0.2" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a9e0597aa6b2fdc810ff58bc95e4eeaa2c219b3e615ed025106ecb027407d8" +checksum = "6434c9a33891f1effc9c75472e12666db2fa5a0fec4b29af6221680a6fe83ab2" dependencies = [ "async-trait", - "auto_impl 1.2.0", - "base64 0.13.1", + "auto_impl", + "base64 0.21.7", + "bytes", + "const-hex", + "enr", "ethers-core", "futures-core", "futures-timer", "futures-util", - "getrandom", "hashers", - "hex", - "http", + "http 0.2.12", + "instant", + "jsonwebtoken", "once_cell", - "parking_lot 0.11.2", "pin-project", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "thiserror", "tokio", + "tokio-tungstenite", "tracing", "tracing-futures", "url", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-timer", "web-sys", "ws_stream_wasm", ] [[package]] name = "ethers-signers" -version = "1.0.2" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f41ced186867f64773db2e55ffdd92959e094072a1d09a5e5e831d443204f98" +checksum = "228875491c782ad851773b652dd8ecac62cda8571d3bc32a5853644dd26766c2" dependencies = [ "async-trait", "coins-bip32", "coins-bip39", + "const-hex", "elliptic-curve", "eth-keystore", "ethers-core", - "hex", "rand", - "sha2 0.10.8", + "sha2", + "thiserror", + "tracing", +] + +[[package]] +name = "ethers-solc" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66244a771d9163282646dbeffe0e6eca4dda4146b6498644e678ac6089b11edd" +dependencies = [ + "cfg-if", + "const-hex", + "dirs", + "dunce", + "ethers-core", + "glob", + "home", + "md-5", + "num_cpus", + "once_cell", + "path-slash", + "rayon", + "regex", + "semver 1.0.23", + "serde", + "serde_json", + "solang-parser", + "svm-rs", "thiserror", + "tiny-keccak", + "tokio", + "tracing", + "walkdir", + "yansi", ] [[package]] @@ -1127,23 +1939,28 @@ dependencies = [ "once_cell", ] -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - [[package]] name = "fastrand" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + [[package]] name = "ff" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core", "subtle", @@ -1173,12 +1990,34 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -1209,6 +2048,16 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "funty" version = "2.0.0" @@ -1281,7 +2130,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1301,6 +2150,10 @@ name = "futures-timer" version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" +dependencies = [ + "gloo-timers", + "send_wrapper 0.4.0", +] [[package]] name = "futures-util" @@ -1320,6 +2173,12 @@ dependencies = [ "slab", ] +[[package]] +name = "futures-utils-wasm" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" + [[package]] name = "fxhash" version = "0.2.1" @@ -1329,15 +2188,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -1346,6 +2196,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -1355,10 +2206,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] [[package]] @@ -1367,11 +2216,29 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "group" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core", @@ -1389,7 +2256,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.12", "indexmap", "slab", "tokio", @@ -1399,9 +2266,27 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", + "serde", +] [[package]] name = "hashers" @@ -1412,12 +2297,6 @@ dependencies = [ "fxhash", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -1435,6 +2314,15 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hmac" @@ -1445,6 +2333,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "hostname" version = "0.3.1" @@ -1467,6 +2364,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http-body" version = "0.4.6" @@ -1474,7 +2382,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", "pin-project-lite", ] @@ -1492,17 +2423,17 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", "h2", - "http", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -1515,63 +2446,246 @@ dependencies = [ ] [[package]] -name = "hyper-rustls" -version = "0.24.2" +name = "hyper" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http 0.2.12", + "hyper 0.14.31", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper 0.14.31", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.5.0", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.5.0", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ - "futures-util", - "http", - "hyper", - "rustls", - "tokio", - "tokio-rustls", + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", ] [[package]] -name = "hyper-tls" -version = "0.5.0" +name = "icu_normalizer_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", ] [[package]] -name = "iana-time-zone" -version = "0.1.61" +name = "icu_properties_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" +name = "icu_provider_macros" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ - "cc", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1625,7 +2739,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.15.1", + "serde", ] [[package]] @@ -1634,7 +2749,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ - "generic-array 0.14.7", + "generic-array", ] [[package]] @@ -1644,9 +2759,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", ] [[package]] @@ -1661,17 +2773,53 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -1692,15 +2840,16 @@ dependencies = [ [[package]] name = "k256" -version = "0.11.6" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", - "sha2 0.10.8", - "sha3", + "once_cell", + "sha2", + "signature", ] [[package]] @@ -1712,6 +2861,46 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "keccak-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + +[[package]] +name = "lalrpop" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" +dependencies = [ + "ascii-canvas", + "bit-set", + "ena", + "itertools 0.11.0", + "lalrpop-util", + "petgraph", + "regex", + "regex-syntax 0.8.5", + "string_cache", + "term", + "tiny-keccak", + "unicode-xid", + "walkdir", +] + +[[package]] +name = "lalrpop-util" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" +dependencies = [ + "regex-automata 0.4.8", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -1720,9 +2909,25 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" + +[[package]] +name = "libm" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", +] [[package]] name = "linux-raw-sys" @@ -1730,6 +2935,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.12" @@ -1746,6 +2957,15 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown 0.15.1", +] + [[package]] name = "match_cfg" version = "0.1.0" @@ -1761,6 +2981,16 @@ dependencies = [ "regex-automata 0.1.10", ] +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest 0.10.7", +] + [[package]] name = "memchr" version = "2.7.4" @@ -1824,7 +3054,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1844,6 +3074,12 @@ dependencies = [ "tempfile", ] +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + [[package]] name = "nom" version = "7.1.3" @@ -1896,6 +3132,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] @@ -1913,12 +3181,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - [[package]] name = "open-fastrlp" version = "0.1.4" @@ -1926,7 +3188,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" dependencies = [ "arrayvec", - "auto_impl 1.2.0", + "auto_impl", "bytes", "ethereum-types", "open-fastrlp-derive", @@ -1946,9 +3208,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -1967,7 +3229,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1978,9 +3240,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -1988,6 +3250,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "os_info" version = "3.8.2" @@ -2012,7 +3280,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ "arrayvec", - "bitvec 1.0.1", + "bitvec", "byte-slice-cast", "impl-trait-for-tuples", "parity-scale-codec-derive", @@ -2031,17 +3299,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -2049,21 +3306,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.10", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -2074,7 +3317,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.7", + "redox_syscall", "smallvec", "windows-targets 0.52.6", ] @@ -2090,6 +3333,18 @@ dependencies = [ "subtle", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "path-slash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" + [[package]] name = "pbkdf2" version = "0.11.0" @@ -2099,59 +3354,141 @@ dependencies = [ "digest 0.10.7", "hmac", "password-hash", - "sha2 0.10.8", + "sha2", +] + +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest 0.10.7", + "hmac", ] [[package]] name = "pem" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pest" +version = "2.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pharos" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" +dependencies = [ + "futures", + "rustc_version 0.4.1", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared 0.11.2", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared 0.11.2", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ - "base64 0.13.1", + "phf_generator", + "phf_shared 0.11.2", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "percent-encoding" -version = "2.3.1" +name = "phf_shared" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] [[package]] -name = "pharos" -version = "0.5.3" +name = "phf_shared" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ - "futures", - "rustc_version", + "siphasher", ] [[package]] name = "pin-project" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -2161,9 +3498,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkcs8" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der", "spki", @@ -2190,6 +3527,12 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + [[package]] name = "predicates" version = "3.1.2" @@ -2216,6 +3559,16 @@ dependencies = [ "termtree", ] +[[package]] +name = "prettyplease" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +dependencies = [ + "proc-macro2", + "syn 2.0.87", +] + [[package]] name = "primitive-types" version = "0.12.2" @@ -2240,38 +3593,62 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "proc-macro-error-attr2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" dependencies = [ - "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.109", - "version_check", ] [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "proc-macro-error2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" dependencies = [ + "proc-macro-error-attr2", "proc-macro2", "quote", - "version_check", + "syn 2.0.87", ] [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] +[[package]] +name = "proptest" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.6.0", + "lazy_static", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax 0.8.5", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quote" version = "1.0.37" @@ -2281,12 +3658,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" - [[package]] name = "radium" version = "0.7.0" @@ -2302,6 +3673,7 @@ dependencies = [ "libc", "rand_chacha", "rand_core", + "serde", ] [[package]] @@ -2324,12 +3696,32 @@ dependencies = [ ] [[package]] -name = "redox_syscall" -version = "0.2.16" +name = "rand_xorshift" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "bitflags 1.3.2", + "rand_core", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", ] [[package]] @@ -2341,11 +3733,22 @@ dependencies = [ "bitflags 2.6.0", ] +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom", + "libredox", + "thiserror", +] + [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -2397,11 +3800,11 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", - "http-body", - "hyper", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.31", "hyper-rustls", - "hyper-tls", + "hyper-tls 0.5.0", "ipnet", "js-sys", "log", @@ -2411,11 +3814,11 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-native-tls", @@ -2431,6 +3834,45 @@ dependencies = [ "winreg", ] +[[package]] +name = "reqwest" +version = "0.12.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.5.0", + "hyper-tls 0.6.0", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile 2.2.0", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-registry", +] + [[package]] name = "reqwest-eventsource" version = "0.5.0" @@ -2443,19 +3885,18 @@ dependencies = [ "mime", "nom", "pin-project-lite", - "reqwest", + "reqwest 0.11.27", "thiserror", ] [[package]] name = "rfc6979" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "crypto-bigint", "hmac", - "zeroize", + "subtle", ] [[package]] @@ -2504,6 +3945,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ "bytes", + "rlp-derive", "rustc-hex", ] @@ -2518,32 +3960,77 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ruint" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp", + "num-bigint", + "num-traits", + "parity-scale-codec", + "primitive-types", + "proptest", + "rand", + "rlp", + "ruint-macro", + "serde", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + [[package]] name = "rustc-demangle" version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc-hex" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "rustc_version" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver", + "semver 1.0.23", ] [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "375116bee2be9ed569afe2154ea6a99dfdffd257f533f187498c2a8f5feaf4ee" dependencies = [ "bitflags 2.6.0", "errno", @@ -2573,6 +4060,21 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -2585,9 +4087,21 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" + +[[package]] +name = "rusty-fork" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] [[package]] name = "ryu" @@ -2615,9 +4129,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.11.3" +version = "2.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" +checksum = "1aa7ffc1c0ef49b0452c6e2986abf2b07743320641ffd5fc63d552458e3b779b" dependencies = [ "cfg-if", "derive_more", @@ -2627,14 +4141,14 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.11.3" +version = "2.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" +checksum = "46385cc24172cf615450267463f937c10072516359b3ff1cb24228a4a08bf951" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.87", ] [[package]] @@ -2646,6 +4160,17 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "schnellru" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" +dependencies = [ + "ahash", + "cfg-if", + "hashbrown 0.13.2", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -2659,9 +4184,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" dependencies = [ "hmac", - "pbkdf2", + "pbkdf2 0.11.0", "salsa20", - "sha2 0.10.8", + "sha2", ] [[package]] @@ -2676,13 +4201,13 @@ dependencies = [ [[package]] name = "sec1" -version = "0.3.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", - "generic-array 0.14.7", + "generic-array", "pkcs8", "subtle", "zeroize", @@ -2711,6 +4236,15 @@ dependencies = [ "libc", ] +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + [[package]] name = "semver" version = "1.0.23" @@ -2720,6 +4254,21 @@ dependencies = [ "serde", ] +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + +[[package]] +name = "send_wrapper" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" + [[package]] name = "send_wrapper" version = "0.6.0" @@ -2734,7 +4283,7 @@ checksum = "6ce4b57f1b521f674df7a1d200be8ff5d74e3712020ee25b553146657b5377d5" dependencies = [ "httpdate", "native-tls", - "reqwest", + "reqwest 0.11.27", "sentry-backtrace", "sentry-contexts", "sentry-core", @@ -2766,7 +4315,7 @@ dependencies = [ "hostname", "libc", "os_info", - "rustc_version", + "rustc_version 0.4.1", "sentry-core", "uname", ] @@ -2831,44 +4380,34 @@ dependencies = [ "thiserror", "time", "url", - "uuid 1.10.0", + "uuid 1.11.0", ] [[package]] name = "serde" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] -[[package]] -name = "serde-aux" -version = "4.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2e8bfba469d06512e11e3311d4d051a4a387a5b42d010404fecf3200321c95" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -2876,6 +4415,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -2889,15 +4437,14 @@ dependencies = [ ] [[package]] -name = "sha2" -version = "0.8.2" +name = "sha1" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug", + "cfg-if", + "cpufeatures", + "digest 0.10.7", ] [[package]] @@ -2921,6 +4468,16 @@ dependencies = [ "keccak", ] +[[package]] +name = "sha3-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" +dependencies = [ + "cc", + "cfg-if", +] + [[package]] name = "sharded-slab" version = "0.1.7" @@ -2947,9 +4504,9 @@ dependencies = [ [[package]] name = "signature" -version = "1.6.4" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", "rand_core", @@ -2967,6 +4524,12 @@ dependencies = [ "time", ] +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "slab" version = "0.4.9" @@ -2992,6 +4555,20 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "solang-parser" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c425ce1c59f4b154717592f0bdf4715c3a1d55058883622d3157e1f0908a5b26" +dependencies = [ + "itertools 0.11.0", + "lalrpop", + "lalrpop-util", + "phf", + "thiserror", + "unicode-xid", +] + [[package]] name = "spin" version = "0.5.2" @@ -3006,20 +4583,39 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "spki" -version = "0.6.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared 0.10.0", + "precomputed-hash", +] + [[package]] name = "strsim" version = "0.11.1" @@ -3028,24 +4624,24 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.24.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn 2.0.87", ] [[package]] @@ -3054,6 +4650,26 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "svm-rs" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11297baafe5fa0c99d5722458eac6a5e25c01eb1b8e5cd137f54079093daa7a4" +dependencies = [ + "dirs", + "fs2", + "hex", + "once_cell", + "reqwest 0.11.27", + "semver 1.0.23", + "serde", + "serde_json", + "sha2", + "thiserror", + "url", + "zip", +] + [[package]] name = "syn" version = "1.0.109" @@ -3067,21 +4683,53 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "syn-solidity" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edf42e81491fb8871b74df3d222c64ae8cbc1269ea509fa768a3ed3e1b0ac8cb" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "sync_wrapper" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -3122,6 +4770,17 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + [[package]] name = "termtree" version = "0.4.1" @@ -3130,22 +4789,22 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3158,6 +4817,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + [[package]] name = "time" version = "0.3.36" @@ -3198,6 +4866,16 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -3215,15 +4893,15 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", "libc", "mio", - "parking_lot 0.12.3", + "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", @@ -3239,7 +4917,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3262,6 +4940,33 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-stream" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +dependencies = [ + "futures-util", + "log", + "rustls", + "tokio", + "tokio-rustls", + "tungstenite", + "webpki-roots", +] + [[package]] name = "tokio-util" version = "0.7.12" @@ -3277,11 +4982,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.11" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", ] [[package]] @@ -3289,6 +4997,9 @@ name = "toml_datetime" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" @@ -3297,10 +5008,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", + "serde", + "serde_spanned", "toml_datetime", "winnow", ] +[[package]] +name = "tower" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 0.1.2", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" version = "0.3.3" @@ -3326,7 +5059,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3395,12 +5128,38 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 0.2.12", + "httparse", + "log", + "rand", + "rustls", + "sha1", + "thiserror", + "url", + "utf-8", +] + [[package]] name = "typenum" version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "uint" version = "0.9.5" @@ -3423,10 +5182,10 @@ dependencies = [ ] [[package]] -name = "unicode-bidi" -version = "0.3.17" +name = "unarray" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" @@ -3434,21 +5193,6 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" -[[package]] -name = "unicode-normalization" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - [[package]] name = "unicode-xid" version = "0.2.6" @@ -3482,9 +5226,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" dependencies = [ "form_urlencoded", "idna", @@ -3492,6 +5236,24 @@ dependencies = [ "serde", ] +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -3510,9 +5272,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "serde", ] @@ -3535,6 +5297,15 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + [[package]] name = "walkdir" version = "2.5.0" @@ -3562,9 +5333,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -3573,24 +5344,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -3600,9 +5371,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3610,28 +5381,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-streams" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ "futures-util", "js-sys", @@ -3641,25 +5412,24 @@ dependencies = [ ] [[package]] -name = "wasm-timer" -version = "0.2.5" +name = "wasmtimer" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +checksum = "c7ed9d8b15c7fb594d72bfb4b5a276f3d2029333cd93a932f376f5937f6f80ee" dependencies = [ "futures", "js-sys", - "parking_lot 0.11.2", + "parking_lot", "pin-utils", + "slab", "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", ] [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -3711,6 +5481,36 @@ dependencies = [ "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]] name = "windows-sys" version = "0.48.0" @@ -3878,6 +5678,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -3889,8 +5701,8 @@ dependencies = [ "js-sys", "log", "pharos", - "rustc_version", - "send_wrapper", + "rustc_version 0.4.1", + "send_wrapper 0.6.0", "thiserror", "wasm-bindgen", "wasm-bindgen-futures", @@ -3906,6 +5718,36 @@ dependencies = [ "tap", ] +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -3924,7 +5766,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", ] [[package]] @@ -3932,3 +5795,88 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac", + "pbkdf2 0.11.0", + "sha1", + "time", + "zstd", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.13+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml index 5fc9d7a..56ce24c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,9 @@ async-trait = "0.1.80" dyn-clone = "1.0.17" dotenv = "0.15.0" envy = "0.4.2" -ethers = "1.0.2" +ethers = "2.0.14" +alloy = { version = "0.5.3", features = ["provider-http", "rpc-types"] } +sha2 = "0.10.8" futures = "0.3.25" hex = "0.4.3" reqwest = { version = "0.11.13", features = ["json"] } @@ -36,5 +38,6 @@ thiserror = "1.0.40" sentry = { version = "0.31.2", features = ["debug-images"] } sentry-tracing = "0.31.2" + [dev-dependencies] mockall = "0.12.1" diff --git a/src/clients/beacon/types.rs b/src/clients/beacon/types.rs index 3b6710d..0e91b0a 100644 --- a/src/clients/beacon/types.rs +++ b/src/clients/beacon/types.rs @@ -1,6 +1,6 @@ use std::{fmt, str::FromStr}; -use ethers::types::{Bytes, H256}; +use alloy::primitives::{Bytes, B256}; use serde::{Deserialize, Serialize}; #[derive(Serialize, Debug, Clone, PartialEq)] @@ -8,7 +8,7 @@ pub enum BlockId { Head, Finalized, Slot(u32), - Hash(H256), + Hash(B256), } #[derive(Serialize, Debug)] @@ -20,7 +20,7 @@ pub enum Topic { #[derive(Deserialize, Debug)] pub struct ExecutionPayload { - pub block_hash: H256, + pub block_hash: B256, #[serde(deserialize_with = "deserialize_number")] pub block_number: u32, } @@ -64,7 +64,7 @@ pub struct BlockHeaderResponse { #[derive(Deserialize, Debug)] pub struct BlockHeader { - pub root: H256, + pub root: B256, pub header: InnerBlockHeader, } #[derive(Deserialize, Debug)] @@ -74,7 +74,7 @@ pub struct InnerBlockHeader { #[derive(Deserialize, Debug)] pub struct BlockHeaderMessage { - pub parent_root: H256, + pub parent_root: B256, #[serde(deserialize_with = "deserialize_number")] pub slot: u32, } @@ -83,12 +83,12 @@ pub struct BlockHeaderMessage { pub struct HeadEventData { #[serde(deserialize_with = "deserialize_number")] pub slot: u32, - pub block: H256, + pub block: B256, } #[derive(Deserialize, Debug)] pub struct FinalizedCheckpointEventData { - pub block: H256, + pub block: B256, } fn deserialize_number<'de, D>(deserializer: D) -> Result @@ -133,7 +133,7 @@ impl FromStr for BlockId { Ok(num) => Ok(BlockId::Slot(num)), Err(_) => { if s.starts_with("0x") { - match H256::from_str(s) { + match B256::from_str(s) { Ok(hash) => Ok(BlockId::Hash(hash)), Err(_) => Err(format!("Invalid block ID hash: {s}")), } diff --git a/src/clients/blobscan/types.rs b/src/clients/blobscan/types.rs index 7c2a8ea..1504e0f 100644 --- a/src/clients/blobscan/types.rs +++ b/src/clients/blobscan/types.rs @@ -1,9 +1,9 @@ use core::fmt; +use alloy::primitives::{Address, BlockNumber, BlockTimestamp, Bytes, TxIndex, B256, U256}; +use alloy::rpc::types::{Block as ExecutionBlock, Transaction as ExecutionTransaction}; use anyhow::{Context, Result}; -use ethers::types::{ - Address, Block as EthersBlock, Bytes, Transaction as EthersTransaction, H256, U256, U64, -}; + use serde::{Deserialize, Serialize}; use crate::{clients::beacon::types::Blob as BeaconBlob, utils::web3::calculate_versioned_hash}; @@ -11,9 +11,9 @@ use crate::{clients::beacon::types::Blob as BeaconBlob, utils::web3::calculate_v #[derive(Serialize, Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct Block { - pub number: U64, - pub hash: H256, - pub timestamp: U256, + pub number: BlockNumber, + pub hash: B256, + pub timestamp: BlockTimestamp, pub slot: u32, pub blob_gas_used: U256, pub excess_blob_gas: U256, @@ -22,12 +22,12 @@ pub struct Block { #[derive(Serialize, Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct Transaction { - pub hash: H256, + pub hash: B256, pub from: Address, #[serde(default, skip_serializing_if = "Option::is_none")] pub to: Option
, - pub block_number: U64, - pub index: U64, + pub block_number: BlockNumber, + pub index: TxIndex, pub gas_price: U256, pub max_fee_per_blob_gas: U256, } @@ -35,11 +35,11 @@ pub struct Transaction { #[derive(Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Blob { - pub versioned_hash: H256, + pub versioned_hash: B256, pub commitment: String, pub proof: String, pub data: Bytes, - pub tx_hash: H256, + pub tx_hash: B256, pub index: u32, } @@ -118,106 +118,106 @@ impl From<(u32, u32)> for FailedSlotsChunk { } } -impl<'a> TryFrom<(&'a EthersBlock, u32)> for Block { +impl<'a> TryFrom<(&'a ExecutionBlock, u32)> for Block { type Error = anyhow::Error; fn try_from( - (ethers_block, slot): (&'a EthersBlock, u32), + (ethers_block, slot): (&'a ExecutionBlock, u32), ) -> Result { - let number = ethers_block - .number - .with_context(|| "Missing block number field in execution block".to_string())?; + let number = ethers_block.header.number; + let hash = ethers_block.header.hash; + let timestamp = ethers_block.header.timestamp; + let blob_gas_used = match ethers_block.header.blob_gas_used { + Some(blob_gas_used) => U256::from::(blob_gas_used), + None => { + return Err(anyhow::anyhow!( + "Missing `blob_gas_used` field in execution block {hash} with number {number}", + hash = hash, + number = number + )) + } + }; + let excess_blob_gas = match ethers_block.header.excess_blob_gas { + Some(excess_blob_gas) => U256::from::(excess_blob_gas), + None => { + return Err(anyhow::anyhow!( + "Missing `excess_blob_gas` field in execution block {hash} with number {number}", + hash = hash, + number = number + )) + } + }; Ok(Self { number, - hash: ethers_block - .hash - .with_context(|| format!("Missing block hash field in execution block {number}"))?, - timestamp: ethers_block.timestamp, + hash, + timestamp, slot, - blob_gas_used: match ethers_block.other.get("blobGasUsed") { - Some(blob_gas_used) => { - let blob_gas_used = blob_gas_used.as_str().with_context(|| { - format!("Failed to convert `blobGasUsed` field in execution block {number}") - })?; - - U256::from_str_radix(blob_gas_used, 16)? - } - None => { - return Err(anyhow::anyhow!( - "Missing `blobGasUsed` field in execution block {number}" - )) - } - }, - excess_blob_gas: match ethers_block.other.get("excessBlobGas") { - Some(excess_gas_gas) => { - let excess_blob_gas = excess_gas_gas.as_str().with_context(|| { - format!( - "Failed to convert excess blob gas field in execution block {number}" - ) - })?; - - U256::from_str_radix(excess_blob_gas, 16)? - } - None => { - return Err(anyhow::anyhow!( - "Missing `excessBlobGas` field in execution block {number}" - )) - } - }, + blob_gas_used, + excess_blob_gas, }) } } -impl<'a> TryFrom<(&'a EthersTransaction, &'a EthersBlock)> for Transaction { +impl<'a> + TryFrom<( + &'a ExecutionTransaction, + &'a ExecutionBlock, + )> for Transaction +{ type Error = anyhow::Error; fn try_from( - (ethers_tx, ethers_block): (&'a EthersTransaction, &'a EthersBlock), + (ethers_tx, ethers_block): ( + &'a ExecutionTransaction, + &'a ExecutionBlock, + ), ) -> Result { let hash = ethers_tx.hash; + let block_number = ethers_block.header.number; + let index = ethers_tx + .transaction_index + .with_context(|| format!("Missing `transaction_index` field in tx {hash}"))?; + let from = ethers_tx.from; + let to = ethers_tx.to; + let gas_price = match ethers_tx.gas_price { + Some(gas_price) => U256::from::(gas_price), + None => { + return Err(anyhow::anyhow!( + "Missing `gas_price` field in tx {hash} in block {block_number}", + hash = hash, + block_number = block_number + )) + } + }; + let max_fee_per_blob_gas = match ethers_tx.max_fee_per_blob_gas { + Some(max_fee_per_blob_gas) => U256::from::(max_fee_per_blob_gas), + None => { + return Err(anyhow::anyhow!( + "Missing `max_fee_per_blob_gas` field in tx {hash} in block {block_number}", + hash = hash, + block_number = block_number + )) + } + }; Ok(Self { - block_number: ethers_block - .number - .with_context(|| "Missing block number field in execution block".to_string())?, - index: ethers_tx - .transaction_index - .with_context(|| "Missing transaction index field".to_string())?, + block_number, + index, hash, - from: ethers_tx.from, - to: ethers_tx.to, - gas_price: ethers_tx.gas_price.with_context(|| { - format!("Missing gas price field in transaction {hash}", hash = hash) - })?, - max_fee_per_blob_gas: match ethers_tx.other.get("maxFeePerBlobGas") { - Some(max_fee_per_blob_gas) => { - let max_fee_per_blob_gas = - max_fee_per_blob_gas.as_str().with_context(|| { - format!( - "Failed to convert `maxFeePerBlobGas` field in transaction {hash}", - hash = hash - ) - })?; - - U256::from_str_radix(max_fee_per_blob_gas, 16)? - } - None => { - return Err(anyhow::anyhow!( - "Missing `maxFeePerBlobGas` field in transaction {hash}", - hash = hash - )) - } - }, + from, + to, + gas_price, + max_fee_per_blob_gas, }) } } -impl<'a> TryFrom<(&'a BeaconBlob, u32, H256)> for Blob { +impl<'a> TryFrom<(&'a BeaconBlob, u32, B256)> for Blob { type Error = anyhow::Error; fn try_from( - (blob_data, index, tx_hash): (&'a BeaconBlob, u32, H256), + (blob_data, index, tx_hash): (&'a BeaconBlob, u32, B256), ) -> Result { Ok(Self { tx_hash, @@ -230,9 +230,9 @@ impl<'a> TryFrom<(&'a BeaconBlob, u32, H256)> for Blob { } } -impl<'a> From<(&'a BeaconBlob, &'a H256, usize, &'a H256)> for Blob { +impl<'a> From<(&'a BeaconBlob, &'a B256, usize, &'a B256)> for Blob { fn from( - (blob_data, versioned_hash, index, tx_hash): (&'a BeaconBlob, &'a H256, usize, &'a H256), + (blob_data, versioned_hash, index, tx_hash): (&'a BeaconBlob, &'a B256, usize, &'a B256), ) -> Self { Self { tx_hash: *tx_hash, diff --git a/src/context.rs b/src/context.rs index 9cdedbd..4be6bec 100644 --- a/src/context.rs +++ b/src/context.rs @@ -1,9 +1,14 @@ -use std::{fmt::Debug, sync::Arc, time::Duration}; +use std::{sync::Arc, time::Duration}; +use alloy::{ + providers::{Provider, ProviderBuilder}, + transports::http::ReqwestTransport, +}; use anyhow::Result as AnyhowResult; use backoff::ExponentialBackoffBuilder; use dyn_clone::DynClone; -use ethers::providers::{Http as HttpProvider, MockProvider, Provider}; +// use ethers::providers::MockProvider; +// use ethers::providers::{Http as HttpProvider, MockProvider, Provider}; use crate::{ clients::{ @@ -13,17 +18,17 @@ use crate::{ env::Environment, }; -#[cfg(test)] -use crate::clients::{beacon::MockCommonBeaconClient, blobscan::MockCommonBlobscanClient}; +// #[cfg(test)] +// use crate::clients::{beacon::MockCommonBeaconClient, blobscan::MockCommonBlobscanClient}; -pub trait CommonContext: Send + Sync + Debug + DynClone { +pub trait CommonContext: Send + Sync + DynClone { fn beacon_client(&self) -> &dyn CommonBeaconClient; fn blobscan_client(&self) -> &dyn CommonBlobscanClient; - fn provider(&self) -> &Provider; + fn provider(&self) -> &dyn Provider; } -dyn_clone::clone_trait_object!(CommonContext); -dyn_clone::clone_trait_object!(CommonContext); +dyn_clone::clone_trait_object!(CommonContext); +// dyn_clone::clone_trait_object!(CommonContext); pub struct Config { pub blobscan_api_endpoint: String, @@ -32,19 +37,18 @@ pub struct Config { pub secret_key: String, } -#[derive(Debug)] struct ContextRef { pub beacon_client: Box, pub blobscan_client: Box, - pub provider: Provider, + pub provider: Box>, } -#[derive(Debug, Clone)] +#[derive(Clone)] pub struct Context { inner: Arc>, } -impl Context { +impl Context { pub fn try_new(config: Config) -> AnyhowResult { let Config { blobscan_api_endpoint, @@ -75,13 +79,16 @@ impl Context { exp_backoff, }, )?), - provider: Provider::::try_from(execution_node_endpoint)?, + // Provider::::try_from(execution_node_endpoint)? + provider: Box::new( + ProviderBuilder::new().on_http(execution_node_endpoint.parse()?), + ), }), }) } } -impl CommonContext for Context { +impl CommonContext for Context { fn beacon_client(&self) -> &dyn CommonBeaconClient { self.inner.beacon_client.as_ref() } @@ -90,8 +97,8 @@ impl CommonContext for Context { self.inner.blobscan_client.as_ref() } - fn provider(&self) -> &Provider { - &self.inner.provider + fn provider(&self) -> &dyn Provider { + self.inner.provider.as_ref() } } @@ -106,36 +113,36 @@ impl From<&Environment> for Config { } } -#[cfg(test)] -impl Context { - pub fn new( - beacon_client: Option, - blobscan_client: Option, - provider: Option>, - ) -> Box { - Box::new(Self { - inner: Arc::new(ContextRef { - beacon_client: Box::new(beacon_client.unwrap_or(MockCommonBeaconClient::new())), - blobscan_client: Box::new( - blobscan_client.unwrap_or(MockCommonBlobscanClient::new()), - ), - provider: provider.unwrap_or(Provider::mocked().0), - }), - }) - } -} - -#[cfg(test)] -impl CommonContext for Context { - fn beacon_client(&self) -> &dyn CommonBeaconClient { - self.inner.beacon_client.as_ref() - } - - fn blobscan_client(&self) -> &dyn CommonBlobscanClient { - self.inner.blobscan_client.as_ref() - } - - fn provider(&self) -> &Provider { - &self.inner.provider - } -} +// #[cfg(test)] +// impl Context { +// pub fn new( +// beacon_client: Option, +// blobscan_client: Option, +// provider: Option>, +// ) -> Box { +// Box::new(Self { +// inner: Arc::new(ContextRef { +// beacon_client: Box::new(beacon_client.unwrap_or(MockCommonBeaconClient::new())), +// blobscan_client: Box::new( +// blobscan_client.unwrap_or(MockCommonBlobscanClient::new()), +// ), +// provider: provider.unwrap_or(Provider::mocked().0), +// }), +// }) +// } +// } + +// #[cfg(test)] +// impl CommonContext for Context { +// fn beacon_client(&self) -> &dyn CommonBeaconClient { +// self.inner.beacon_client.as_ref() +// } + +// fn blobscan_client(&self) -> &dyn CommonBlobscanClient { +// self.inner.blobscan_client.as_ref() +// } + +// fn provider(&self) -> &Provider { +// &self.inner.provider +// } +// } diff --git a/src/indexer/event_handlers/finalized_checkpoint.rs b/src/indexer/event_handlers/finalized_checkpoint.rs index 0d70f50..49f9f80 100644 --- a/src/indexer/event_handlers/finalized_checkpoint.rs +++ b/src/indexer/event_handlers/finalized_checkpoint.rs @@ -1,4 +1,4 @@ -use ethers::providers::Http as HttpProvider; +use alloy::transports::Transport; use tracing::info; use crate::{ @@ -27,8 +27,11 @@ pub struct FinalizedCheckpointHandler { context: Box>, } -impl FinalizedCheckpointHandler { - pub fn new(context: Box>) -> Self { +impl FinalizedCheckpointHandler +where + T: Transport + Send + Sync + 'static, +{ + pub fn new(context: Box>) -> Self { FinalizedCheckpointHandler { context } } diff --git a/src/indexer/event_handlers/head.rs b/src/indexer/event_handlers/head.rs index d2ff23e..82784c3 100644 --- a/src/indexer/event_handlers/head.rs +++ b/src/indexer/event_handlers/head.rs @@ -1,7 +1,6 @@ use std::cmp; -use ethers::providers::JsonRpcClient; -use ethers::types::H256; +use alloy::{primitives::B256, transports::Transport}; use tracing::info; use crate::{ @@ -34,12 +33,12 @@ pub struct HeadEventHandler { context: Box>, synchronizer: Box, start_block_id: BlockId, - last_block_hash: Option, + last_block_hash: Option, } impl HeadEventHandler where - T: JsonRpcClient + Send + Sync + 'static, + T: Transport + Send + Sync + 'static, { pub fn new( context: Box>, @@ -146,562 +145,562 @@ where } } -#[cfg(test)] -mod tests { - use anyhow::anyhow; - use ethers::types::H256; - use mockall::predicate::eq; - - use super::HeadEventHandler; - use crate::{ - clients::{ - beacon::{ - types::{BlockHeader, BlockHeaderMessage, BlockId, InnerBlockHeader}, - MockCommonBeaconClient, - }, - blobscan::{types::BlockchainSyncState, MockCommonBlobscanClient}, - }, - context::Context, - synchronizer::MockCommonSynchronizer, - }; - - #[derive(Clone, Debug)] - struct BlockData { - slot: u32, - hash: H256, - parent_hash: Option, - } - - impl BlockData { - pub fn to_head_event(self) -> String { - format!( - r#"{{"slot": "{}", "block": "{}"}}"#, - self.slot, - format!("0x{:x}", self.hash) - ) - } - } - - #[tokio::test] - async fn test_handler_on_initial_event() { - let mut mock_synchronizer = Box::new(MockCommonSynchronizer::new()); - let mut mock_beacon_client = MockCommonBeaconClient::new(); - - let initial_start_block_id = BlockId::Slot(1); - - let block_data = Box::new(BlockData { - slot: 4, - hash: _create_hash("4"), - parent_hash: None, - }); - - _prepare_handler_calls( - &mut mock_beacon_client, - &mut mock_synchronizer, - &block_data, - Some(initial_start_block_id.clone()), - ); - - let mock_context = Context::new(Some(mock_beacon_client), None, None); - - let mut head_event_handler = - HeadEventHandler::new(mock_context, mock_synchronizer, initial_start_block_id); - - let result = head_event_handler.handle(block_data.to_head_event()).await; - - assert!(result.is_ok()) - } - - #[tokio::test] - async fn test_handler_after_first_event() { - let mut mock_synchronizer = Box::new(MockCommonSynchronizer::new()); - let mut mock_beacon_client = MockCommonBeaconClient::new(); - - let initial_start_block_id = BlockId::Slot(1); - - let first_head_block = BlockData { - hash: _create_hash("5"), - slot: 5, - parent_hash: None, - }; - let second_head_block = BlockData { - hash: _create_hash("6"), - slot: 6, - parent_hash: Some(first_head_block.hash), - }; - - _prepare_handler_calls( - &mut mock_beacon_client, - &mut mock_synchronizer, - &first_head_block, - Some(initial_start_block_id.clone()), - ); - - _prepare_handler_calls( - &mut mock_beacon_client, - &mut mock_synchronizer, - &second_head_block, - None, - ); - - let mock_context = Context::new(Some(mock_beacon_client), None, None); - - let mut head_event_handler = - HeadEventHandler::new(mock_context, mock_synchronizer, initial_start_block_id); - - let result = head_event_handler - .handle(first_head_block.to_head_event()) - .await; - - assert!( - result.is_ok(), - "Expected first head event handler to succeed" - ); - - let result = head_event_handler - .handle(second_head_block.to_head_event()) - .await; - - assert!( - result.is_ok(), - "Expected second head event handler to succeed" - ); - } - - #[tokio::test] - async fn test_handler_on_reorg() { - let mut mock_synchronizer = Box::new(MockCommonSynchronizer::new()); - let mut mock_beacon_client = MockCommonBeaconClient::new(); - let mut mock_blobscan_client = MockCommonBlobscanClient::new(); - - let initial_start_block_id = BlockId::Slot(1); - - let before_reorg_block = BlockData { - slot: 2, - hash: _create_hash("2"), - parent_hash: Some(_create_hash("1")), - }; - let reorged_block = BlockData { - slot: 5, - hash: _create_hash("5"), - parent_hash: Some(_create_hash("4")), - }; - let after_reorg_block = BlockData { - slot: 6, - hash: _create_hash("3b"), - parent_hash: Some(before_reorg_block.hash), - }; - - _stub_get_block_header(&mut mock_beacon_client, &before_reorg_block); - - _prepare_handler_calls( - &mut mock_beacon_client, - &mut mock_synchronizer, - &reorged_block, - Some(initial_start_block_id.clone()), - ); - - _prepare_handler_calls( - &mut mock_beacon_client, - &mut mock_synchronizer, - &after_reorg_block, - None, - ); - - _stub_handle_reorged_slots( - &mut mock_blobscan_client, - (before_reorg_block.slot + 1..after_reorg_block.slot).collect::>(), - ); - - // We're expecting the synchronizer to re-sync the parent block of the reorged block - _stub_synchronizer_run( - &mut mock_synchronizer, - BlockId::Slot(before_reorg_block.slot), - BlockId::Slot(before_reorg_block.slot + 1), - ); - - let mock_context = Context::new(Some(mock_beacon_client), Some(mock_blobscan_client), None); - let mut head_event_handler = - HeadEventHandler::new(mock_context, mock_synchronizer, initial_start_block_id); - - let result = head_event_handler - .handle(reorged_block.to_head_event()) - .await; - - assert!( - result.is_ok(), - "Expected first head event handling to succeed" - ); - - let result = head_event_handler - .handle(after_reorg_block.to_head_event()) - .await; - - assert!( - result.is_ok(), - "Expected reorged head event handling to succeed" - ); - } - - #[tokio::test] - async fn test_handler_on_one_depth_reorg() { - // Slots: - // 4 -> 5 - // 6 -> 7 -> ... - let mut mock_synchronizer = Box::new(MockCommonSynchronizer::new()); - let mut mock_beacon_client = MockCommonBeaconClient::new(); - let mut mock_blobscan_client = MockCommonBlobscanClient::new(); - - let initial_start_block_id = BlockId::Slot(1); - - let block_before_reorg = BlockData { - slot: 4, - hash: _create_hash("4"), - parent_hash: None, - }; - let reorged_block = BlockData { - slot: 5, - hash: _create_hash("50"), - parent_hash: Some(block_before_reorg.hash), - }; - let block_after_reorg = BlockData { - slot: 6, - hash: _create_hash("5"), - parent_hash: Some(block_before_reorg.hash), - }; - - _prepare_handler_calls( - &mut mock_beacon_client, - &mut mock_synchronizer, - &reorged_block, - Some(initial_start_block_id.clone()), - ); - _prepare_handler_calls( - &mut mock_beacon_client, - &mut mock_synchronizer, - &block_after_reorg, - None, - ); - - _stub_get_block_header(&mut mock_beacon_client, &block_before_reorg); - - _stub_handle_reorged_slots(&mut mock_blobscan_client, vec![reorged_block.slot]); - - _stub_synchronizer_run( - &mut mock_synchronizer, - BlockId::Slot(block_before_reorg.slot), - BlockId::Slot(block_before_reorg.slot + 1), - ); - - let mock_context = Context::new(Some(mock_beacon_client), Some(mock_blobscan_client), None); - - let mut head_event_handler = - HeadEventHandler::new(mock_context, mock_synchronizer, initial_start_block_id); - - let result = head_event_handler - .handle(reorged_block.to_head_event()) - .await; - - assert!( - result.is_ok(), - "Expected first head event handling to succeed" - ); - - let result = head_event_handler - .handle(block_after_reorg.to_head_event()) - .await; - - assert!( - result.is_ok(), - "Expected reorged head event handling to succeed" - ); - } - - #[tokio::test] - async fn test_handler_on_one_depth_former_reorg() { - // Reorged block is reorged back to its former parent - // Slots: - // 4 -> 5 -> 7 -> ... - // 6 - let mut mock_synchronizer = Box::new(MockCommonSynchronizer::new()); - let mut mock_beacon_client = MockCommonBeaconClient::new(); - let mut mock_blobscan_client = MockCommonBlobscanClient::new(); - - let initial_start_block_id = BlockId::Slot(1); - - let before_reorg_parent_block = BlockData { - slot: 4, - hash: _create_hash("4"), - parent_hash: None, - }; - let before_reorg_block = BlockData { - slot: 5, - hash: _create_hash("50"), - parent_hash: Some(before_reorg_parent_block.hash), - }; - let reorged_block = BlockData { - slot: 6, - hash: _create_hash("5"), - parent_hash: Some(before_reorg_parent_block.hash), - }; - let after_reorg_block = BlockData { - slot: 7, - hash: _create_hash("7"), - parent_hash: Some(before_reorg_block.hash), - }; - - _prepare_handler_calls( - &mut mock_beacon_client, - &mut mock_synchronizer, - &before_reorg_block, - Some(initial_start_block_id.clone()), - ); - _prepare_handler_calls( - &mut mock_beacon_client, - &mut mock_synchronizer, - &reorged_block, - None, - ); - _prepare_handler_calls( - &mut mock_beacon_client, - &mut mock_synchronizer, - &after_reorg_block, - None, - ); - - _stub_get_block_header(&mut mock_beacon_client, &before_reorg_parent_block); - - _stub_handle_reorged_slots(&mut mock_blobscan_client, vec![before_reorg_block.slot]); - - _stub_synchronizer_run( - &mut mock_synchronizer, - BlockId::Slot(before_reorg_parent_block.slot), - BlockId::Slot(before_reorg_parent_block.slot + 1), - ); - - _stub_handle_reorged_slots(&mut mock_blobscan_client, vec![reorged_block.slot]); - - _stub_synchronizer_run( - &mut mock_synchronizer, - BlockId::Slot(before_reorg_block.slot), - BlockId::Slot(before_reorg_block.slot + 1), - ); - - let mock_context = Context::new(Some(mock_beacon_client), Some(mock_blobscan_client), None); - - let mut head_event_handler = - HeadEventHandler::new(mock_context, mock_synchronizer, initial_start_block_id); - - let result = head_event_handler - .handle(before_reorg_block.to_head_event()) - .await; - - assert!( - result.is_ok(), - "Expected first head event handling to succeed" - ); - - let result = head_event_handler - .handle(reorged_block.to_head_event()) - .await; - - assert!( - result.is_ok(), - "Expected reorged head event handling to succeed" - ); - - let result = head_event_handler - .handle(after_reorg_block.to_head_event()) - .await; - - assert!( - result.is_ok(), - "Expected after reorged head event handling to succeed" - ); - } - - #[tokio::test] - async fn test_handler_on_reorg_with_error() { - let mut mock_synchronizer = Box::new(MockCommonSynchronizer::new()); - let mut mock_beacon_client = MockCommonBeaconClient::new(); - let mut mock_blobscan_client = MockCommonBlobscanClient::new(); - - let initial_start_block_id = BlockId::Slot(1); - - let before_reorg_parent_block = BlockData { - slot: 3, - hash: _create_hash("3"), - parent_hash: None, - }; - let before_reorg_block = BlockData { - slot: 4, - hash: _create_hash("4"), - parent_hash: Some(before_reorg_parent_block.hash), - }; - let first_block = BlockData { - slot: 5, - hash: _create_hash("5"), - parent_hash: Some(before_reorg_block.hash), - }; - let reorged_block = BlockData { - slot: 6, - hash: _create_hash("999"), - parent_hash: Some(before_reorg_block.hash), - }; - - _prepare_handler_calls( - &mut mock_beacon_client, - &mut mock_synchronizer, - &first_block, - Some(initial_start_block_id.clone()), - ); - - _stub_get_block_header(&mut mock_beacon_client, &reorged_block); - - _stub_get_block_header(&mut mock_beacon_client, &before_reorg_block); - - mock_blobscan_client - .expect_handle_reorged_slots() - .returning(|_x| { - Box::pin(async move { - Err(crate::clients::common::ClientError::Other(anyhow!( - "Internal blobscan client error" - ))) - }) - }); - - mock_blobscan_client - .expect_update_sync_state() - .times(1) - .with(eq(BlockchainSyncState { - last_finalized_block: None, - last_lower_synced_slot: None, - last_upper_synced_slot: Some(before_reorg_parent_block.slot), - })) - .returning(|_x| Box::pin(async move { Ok(()) })); - - let mock_context = Context::new(Some(mock_beacon_client), Some(mock_blobscan_client), None); - - let mut head_event_handler = - HeadEventHandler::new(mock_context, mock_synchronizer, initial_start_block_id); - - let result = head_event_handler.handle(first_block.to_head_event()).await; - - assert!( - result.is_ok(), - "Expected first head event handling to succeed" - ); - - let result = head_event_handler - .handle(reorged_block.to_head_event()) - .await; - - assert!( - result.is_err(), - "Expected reorged head event handling to fail" - ); - } - - fn _prepare_handler_calls( - mock_beacon_client: &mut MockCommonBeaconClient, - mock_synchronizer: &mut MockCommonSynchronizer, - head_block_data: &BlockData, - initial_block_id: Option, - ) { - let slot = head_block_data.slot; - - _stub_get_block_header(mock_beacon_client, head_block_data); - - _stub_synchronizer_run( - mock_synchronizer, - initial_block_id.unwrap_or(BlockId::Slot(slot)), - BlockId::Slot(slot + 1), - ) - } - - fn _stub_get_block_header( - mock_beacon_client: &mut MockCommonBeaconClient, - block_data: &BlockData, - ) { - let root = block_data.hash; - let slot = block_data.slot; - let parent_root = block_data - .parent_hash - .unwrap_or(_create_hash((slot - 1).to_string().as_str())); - - mock_beacon_client - .expect_get_block_header() - .with(eq(BlockId::Slot(block_data.slot))) - .returning(move |_x| { - Box::pin(async move { - Ok(Some(BlockHeader { - root, - header: InnerBlockHeader { - message: BlockHeaderMessage { parent_root, slot }, - }, - })) - }) - }); - mock_beacon_client - .expect_get_block_header() - .with(eq(BlockId::Hash(block_data.hash))) - .returning(move |_x| { - Box::pin(async move { - Ok(Some(BlockHeader { - root, - header: InnerBlockHeader { - message: BlockHeaderMessage { parent_root, slot }, - }, - })) - }) - }); - } - - fn _stub_handle_reorged_slots( - mock_blobscan_client: &mut MockCommonBlobscanClient, - reorged_slots: Vec, - ) { - let reorged_slots_len = reorged_slots.len() as u32; - - mock_blobscan_client - .expect_handle_reorged_slots() - .with(eq(reorged_slots)) - .returning(move |_x| Box::pin(async move { Ok(reorged_slots_len) })); - } - - fn _stub_synchronizer_run( - mock_synchronizer: &mut MockCommonSynchronizer, - initial_block_id: BlockId, - final_block_id: BlockId, - ) { - mock_synchronizer - .expect_run() - .times(1) - .with(eq(initial_block_id.clone()), eq(final_block_id)) - .returning(|_x, _y| Box::pin(async { Ok(()) })); - } - - fn _create_hash(input: &str) -> H256 { - // Ensure the input string is at most 64 characters - let truncated_input = if input.len() > 64 { - &input[0..64] - } else { - input - }; - - // Format the string to have a length of 64 characters by padding with zeros - let hash = format!("0x{:0>64}", truncated_input); - - hash.parse().unwrap() - } - - fn _create_head_event(slot: u32, block_hash: H256) -> String { - let head_event = format!( - r#"{{"slot": "{}", "block": "{}"}}"#, - slot, - format!("0x{:x}", block_hash) - ); - - head_event - } -} +// #[cfg(test)] +// mod tests { +// use alloy::primitives::B256; +// use anyhow::anyhow; +// use mockall::predicate::eq; + +// use super::HeadEventHandler; +// use crate::{ +// clients::{ +// beacon::{ +// types::{BlockHeader, BlockHeaderMessage, BlockId, InnerBlockHeader}, +// MockCommonBeaconClient, +// }, +// blobscan::{types::BlockchainSyncState, MockCommonBlobscanClient}, +// }, +// context::Context, +// synchronizer::MockCommonSynchronizer, +// }; + +// #[derive(Clone, Debug)] +// struct BlockData { +// slot: u32, +// hash: B256, +// parent_hash: Option, +// } + +// impl BlockData { +// pub fn to_head_event(self) -> String { +// format!( +// r#"{{"slot": "{}", "block": "{}"}}"#, +// self.slot, +// format!("0x{:x}", self.hash) +// ) +// } +// } + +// #[tokio::test] +// async fn test_handler_on_initial_event() { +// let mut mock_synchronizer = Box::new(MockCommonSynchronizer::new()); +// let mut mock_beacon_client = MockCommonBeaconClient::new(); + +// let initial_start_block_id = BlockId::Slot(1); + +// let block_data = Box::new(BlockData { +// slot: 4, +// hash: _create_hash("4"), +// parent_hash: None, +// }); + +// _prepare_handler_calls( +// &mut mock_beacon_client, +// &mut mock_synchronizer, +// &block_data, +// Some(initial_start_block_id.clone()), +// ); + +// let mock_context = Context::new(Some(mock_beacon_client), None, None); + +// let mut head_event_handler = +// HeadEventHandler::new(mock_context, mock_synchronizer, initial_start_block_id); + +// let result = head_event_handler.handle(block_data.to_head_event()).await; + +// assert!(result.is_ok()) +// } + +// #[tokio::test] +// async fn test_handler_after_first_event() { +// let mut mock_synchronizer = Box::new(MockCommonSynchronizer::new()); +// let mut mock_beacon_client = MockCommonBeaconClient::new(); + +// let initial_start_block_id = BlockId::Slot(1); + +// let first_head_block = BlockData { +// hash: _create_hash("5"), +// slot: 5, +// parent_hash: None, +// }; +// let second_head_block = BlockData { +// hash: _create_hash("6"), +// slot: 6, +// parent_hash: Some(first_head_block.hash), +// }; + +// _prepare_handler_calls( +// &mut mock_beacon_client, +// &mut mock_synchronizer, +// &first_head_block, +// Some(initial_start_block_id.clone()), +// ); + +// _prepare_handler_calls( +// &mut mock_beacon_client, +// &mut mock_synchronizer, +// &second_head_block, +// None, +// ); + +// let mock_context = Context::new(Some(mock_beacon_client), None, None); + +// let mut head_event_handler = +// HeadEventHandler::new(mock_context, mock_synchronizer, initial_start_block_id); + +// let result = head_event_handler +// .handle(first_head_block.to_head_event()) +// .await; + +// assert!( +// result.is_ok(), +// "Expected first head event handler to succeed" +// ); + +// let result = head_event_handler +// .handle(second_head_block.to_head_event()) +// .await; + +// assert!( +// result.is_ok(), +// "Expected second head event handler to succeed" +// ); +// } + +// #[tokio::test] +// async fn test_handler_on_reorg() { +// let mut mock_synchronizer = Box::new(MockCommonSynchronizer::new()); +// let mut mock_beacon_client = MockCommonBeaconClient::new(); +// let mut mock_blobscan_client = MockCommonBlobscanClient::new(); + +// let initial_start_block_id = BlockId::Slot(1); + +// let before_reorg_block = BlockData { +// slot: 2, +// hash: _create_hash("2"), +// parent_hash: Some(_create_hash("1")), +// }; +// let reorged_block = BlockData { +// slot: 5, +// hash: _create_hash("5"), +// parent_hash: Some(_create_hash("4")), +// }; +// let after_reorg_block = BlockData { +// slot: 6, +// hash: _create_hash("3b"), +// parent_hash: Some(before_reorg_block.hash), +// }; + +// _stub_get_block_header(&mut mock_beacon_client, &before_reorg_block); + +// _prepare_handler_calls( +// &mut mock_beacon_client, +// &mut mock_synchronizer, +// &reorged_block, +// Some(initial_start_block_id.clone()), +// ); + +// _prepare_handler_calls( +// &mut mock_beacon_client, +// &mut mock_synchronizer, +// &after_reorg_block, +// None, +// ); + +// _stub_handle_reorged_slots( +// &mut mock_blobscan_client, +// (before_reorg_block.slot + 1..after_reorg_block.slot).collect::>(), +// ); + +// // We're expecting the synchronizer to re-sync the parent block of the reorged block +// _stub_synchronizer_run( +// &mut mock_synchronizer, +// BlockId::Slot(before_reorg_block.slot), +// BlockId::Slot(before_reorg_block.slot + 1), +// ); + +// let mock_context = Context::new(Some(mock_beacon_client), Some(mock_blobscan_client), None); +// let mut head_event_handler = +// HeadEventHandler::new(mock_context, mock_synchronizer, initial_start_block_id); + +// let result = head_event_handler +// .handle(reorged_block.to_head_event()) +// .await; + +// assert!( +// result.is_ok(), +// "Expected first head event handling to succeed" +// ); + +// let result = head_event_handler +// .handle(after_reorg_block.to_head_event()) +// .await; + +// assert!( +// result.is_ok(), +// "Expected reorged head event handling to succeed" +// ); +// } + +// #[tokio::test] +// async fn test_handler_on_one_depth_reorg() { +// // Slots: +// // 4 -> 5 +// // 6 -> 7 -> ... +// let mut mock_synchronizer = Box::new(MockCommonSynchronizer::new()); +// let mut mock_beacon_client = MockCommonBeaconClient::new(); +// let mut mock_blobscan_client = MockCommonBlobscanClient::new(); + +// let initial_start_block_id = BlockId::Slot(1); + +// let block_before_reorg = BlockData { +// slot: 4, +// hash: _create_hash("4"), +// parent_hash: None, +// }; +// let reorged_block = BlockData { +// slot: 5, +// hash: _create_hash("50"), +// parent_hash: Some(block_before_reorg.hash), +// }; +// let block_after_reorg = BlockData { +// slot: 6, +// hash: _create_hash("5"), +// parent_hash: Some(block_before_reorg.hash), +// }; + +// _prepare_handler_calls( +// &mut mock_beacon_client, +// &mut mock_synchronizer, +// &reorged_block, +// Some(initial_start_block_id.clone()), +// ); +// _prepare_handler_calls( +// &mut mock_beacon_client, +// &mut mock_synchronizer, +// &block_after_reorg, +// None, +// ); + +// _stub_get_block_header(&mut mock_beacon_client, &block_before_reorg); + +// _stub_handle_reorged_slots(&mut mock_blobscan_client, vec![reorged_block.slot]); + +// _stub_synchronizer_run( +// &mut mock_synchronizer, +// BlockId::Slot(block_before_reorg.slot), +// BlockId::Slot(block_before_reorg.slot + 1), +// ); + +// let mock_context = Context::new(Some(mock_beacon_client), Some(mock_blobscan_client), None); + +// let mut head_event_handler = +// HeadEventHandler::new(mock_context, mock_synchronizer, initial_start_block_id); + +// let result = head_event_handler +// .handle(reorged_block.to_head_event()) +// .await; + +// assert!( +// result.is_ok(), +// "Expected first head event handling to succeed" +// ); + +// let result = head_event_handler +// .handle(block_after_reorg.to_head_event()) +// .await; + +// assert!( +// result.is_ok(), +// "Expected reorged head event handling to succeed" +// ); +// } + +// #[tokio::test] +// async fn test_handler_on_one_depth_former_reorg() { +// // Reorged block is reorged back to its former parent +// // Slots: +// // 4 -> 5 -> 7 -> ... +// // 6 +// let mut mock_synchronizer = Box::new(MockCommonSynchronizer::new()); +// let mut mock_beacon_client = MockCommonBeaconClient::new(); +// let mut mock_blobscan_client = MockCommonBlobscanClient::new(); + +// let initial_start_block_id = BlockId::Slot(1); + +// let before_reorg_parent_block = BlockData { +// slot: 4, +// hash: _create_hash("4"), +// parent_hash: None, +// }; +// let before_reorg_block = BlockData { +// slot: 5, +// hash: _create_hash("50"), +// parent_hash: Some(before_reorg_parent_block.hash), +// }; +// let reorged_block = BlockData { +// slot: 6, +// hash: _create_hash("5"), +// parent_hash: Some(before_reorg_parent_block.hash), +// }; +// let after_reorg_block = BlockData { +// slot: 7, +// hash: _create_hash("7"), +// parent_hash: Some(before_reorg_block.hash), +// }; + +// _prepare_handler_calls( +// &mut mock_beacon_client, +// &mut mock_synchronizer, +// &before_reorg_block, +// Some(initial_start_block_id.clone()), +// ); +// _prepare_handler_calls( +// &mut mock_beacon_client, +// &mut mock_synchronizer, +// &reorged_block, +// None, +// ); +// _prepare_handler_calls( +// &mut mock_beacon_client, +// &mut mock_synchronizer, +// &after_reorg_block, +// None, +// ); + +// _stub_get_block_header(&mut mock_beacon_client, &before_reorg_parent_block); + +// _stub_handle_reorged_slots(&mut mock_blobscan_client, vec![before_reorg_block.slot]); + +// _stub_synchronizer_run( +// &mut mock_synchronizer, +// BlockId::Slot(before_reorg_parent_block.slot), +// BlockId::Slot(before_reorg_parent_block.slot + 1), +// ); + +// _stub_handle_reorged_slots(&mut mock_blobscan_client, vec![reorged_block.slot]); + +// _stub_synchronizer_run( +// &mut mock_synchronizer, +// BlockId::Slot(before_reorg_block.slot), +// BlockId::Slot(before_reorg_block.slot + 1), +// ); + +// let mock_context = Context::new(Some(mock_beacon_client), Some(mock_blobscan_client), None); + +// let mut head_event_handler = +// HeadEventHandler::new(mock_context, mock_synchronizer, initial_start_block_id); + +// let result = head_event_handler +// .handle(before_reorg_block.to_head_event()) +// .await; + +// assert!( +// result.is_ok(), +// "Expected first head event handling to succeed" +// ); + +// let result = head_event_handler +// .handle(reorged_block.to_head_event()) +// .await; + +// assert!( +// result.is_ok(), +// "Expected reorged head event handling to succeed" +// ); + +// let result = head_event_handler +// .handle(after_reorg_block.to_head_event()) +// .await; + +// assert!( +// result.is_ok(), +// "Expected after reorged head event handling to succeed" +// ); +// } + +// #[tokio::test] +// async fn test_handler_on_reorg_with_error() { +// let mut mock_synchronizer = Box::new(MockCommonSynchronizer::new()); +// let mut mock_beacon_client = MockCommonBeaconClient::new(); +// let mut mock_blobscan_client = MockCommonBlobscanClient::new(); + +// let initial_start_block_id = BlockId::Slot(1); + +// let before_reorg_parent_block = BlockData { +// slot: 3, +// hash: _create_hash("3"), +// parent_hash: None, +// }; +// let before_reorg_block = BlockData { +// slot: 4, +// hash: _create_hash("4"), +// parent_hash: Some(before_reorg_parent_block.hash), +// }; +// let first_block = BlockData { +// slot: 5, +// hash: _create_hash("5"), +// parent_hash: Some(before_reorg_block.hash), +// }; +// let reorged_block = BlockData { +// slot: 6, +// hash: _create_hash("999"), +// parent_hash: Some(before_reorg_block.hash), +// }; + +// _prepare_handler_calls( +// &mut mock_beacon_client, +// &mut mock_synchronizer, +// &first_block, +// Some(initial_start_block_id.clone()), +// ); + +// _stub_get_block_header(&mut mock_beacon_client, &reorged_block); + +// _stub_get_block_header(&mut mock_beacon_client, &before_reorg_block); + +// mock_blobscan_client +// .expect_handle_reorged_slots() +// .returning(|_x| { +// Box::pin(async move { +// Err(crate::clients::common::ClientError::Other(anyhow!( +// "Internal blobscan client error" +// ))) +// }) +// }); + +// mock_blobscan_client +// .expect_update_sync_state() +// .times(1) +// .with(eq(BlockchainSyncState { +// last_finalized_block: None, +// last_lower_synced_slot: None, +// last_upper_synced_slot: Some(before_reorg_parent_block.slot), +// })) +// .returning(|_x| Box::pin(async move { Ok(()) })); + +// let mock_context = Context::new(Some(mock_beacon_client), Some(mock_blobscan_client), None); + +// let mut head_event_handler = +// HeadEventHandler::new(mock_context, mock_synchronizer, initial_start_block_id); + +// let result = head_event_handler.handle(first_block.to_head_event()).await; + +// assert!( +// result.is_ok(), +// "Expected first head event handling to succeed" +// ); + +// let result = head_event_handler +// .handle(reorged_block.to_head_event()) +// .await; + +// assert!( +// result.is_err(), +// "Expected reorged head event handling to fail" +// ); +// } + +// fn _prepare_handler_calls( +// mock_beacon_client: &mut MockCommonBeaconClient, +// mock_synchronizer: &mut MockCommonSynchronizer, +// head_block_data: &BlockData, +// initial_block_id: Option, +// ) { +// let slot = head_block_data.slot; + +// _stub_get_block_header(mock_beacon_client, head_block_data); + +// _stub_synchronizer_run( +// mock_synchronizer, +// initial_block_id.unwrap_or(BlockId::Slot(slot)), +// BlockId::Slot(slot + 1), +// ) +// } + +// fn _stub_get_block_header( +// mock_beacon_client: &mut MockCommonBeaconClient, +// block_data: &BlockData, +// ) { +// let root = block_data.hash; +// let slot = block_data.slot; +// let parent_root = block_data +// .parent_hash +// .unwrap_or(_create_hash((slot - 1).to_string().as_str())); + +// mock_beacon_client +// .expect_get_block_header() +// .with(eq(BlockId::Slot(block_data.slot))) +// .returning(move |_x| { +// Box::pin(async move { +// Ok(Some(BlockHeader { +// root, +// header: InnerBlockHeader { +// message: BlockHeaderMessage { parent_root, slot }, +// }, +// })) +// }) +// }); +// mock_beacon_client +// .expect_get_block_header() +// .with(eq(BlockId::Hash(block_data.hash))) +// .returning(move |_x| { +// Box::pin(async move { +// Ok(Some(BlockHeader { +// root, +// header: InnerBlockHeader { +// message: BlockHeaderMessage { parent_root, slot }, +// }, +// })) +// }) +// }); +// } + +// fn _stub_handle_reorged_slots( +// mock_blobscan_client: &mut MockCommonBlobscanClient, +// reorged_slots: Vec, +// ) { +// let reorged_slots_len = reorged_slots.len() as u32; + +// mock_blobscan_client +// .expect_handle_reorged_slots() +// .with(eq(reorged_slots)) +// .returning(move |_x| Box::pin(async move { Ok(reorged_slots_len) })); +// } + +// fn _stub_synchronizer_run( +// mock_synchronizer: &mut MockCommonSynchronizer, +// initial_block_id: BlockId, +// final_block_id: BlockId, +// ) { +// mock_synchronizer +// .expect_run() +// .times(1) +// .with(eq(initial_block_id.clone()), eq(final_block_id)) +// .returning(|_x, _y| Box::pin(async { Ok(()) })); +// } + +// fn _create_hash(input: &str) -> B256 { +// // Ensure the input string is at most 64 characters +// let truncated_input = if input.len() > 64 { +// &input[0..64] +// } else { +// input +// }; + +// // Format the string to have a length of 64 characters by padding with zeros +// let hash = format!("0x{:0>64}", truncated_input); + +// hash.parse().unwrap() +// } + +// fn _create_head_event(slot: u32, block_hash: B256) -> String { +// let head_event = format!( +// r#"{{"slot": "{}", "block": "{}"}}"#, +// slot, +// format!("0x{:x}", block_hash) +// ); + +// head_event +// } +// } diff --git a/src/indexer/mod.rs b/src/indexer/mod.rs index 0236076..7ede972 100644 --- a/src/indexer/mod.rs +++ b/src/indexer/mod.rs @@ -1,7 +1,7 @@ use std::thread; +use alloy::transports::http::ReqwestTransport; use anyhow::anyhow; -use ethers::providers::Http as HttpProvider; use event_handlers::{finalized_checkpoint::FinalizedCheckpointHandler, head::HeadEventHandler}; use futures::StreamExt; use reqwest_eventsource::Event; @@ -36,7 +36,7 @@ pub struct Indexer { num_threads: u32, } -impl Indexer { +impl Indexer { pub fn try_new(env: &Environment, args: &Args) -> IndexerResult { let context = match Context::try_new(ContextConfig::from(env)) { Ok(c) => c, diff --git a/src/slots_processor/error.rs b/src/slots_processor/error.rs index 53438ed..8cc1fb7 100644 --- a/src/slots_processor/error.rs +++ b/src/slots_processor/error.rs @@ -3,7 +3,7 @@ pub enum SlotProcessingError { #[error(transparent)] ClientError(#[from] crate::clients::common::ClientError), #[error(transparent)] - Provider(#[from] ethers::providers::ProviderError), + Provider(#[from] alloy::transports::TransportError), #[error(transparent)] Other(#[from] anyhow::Error), } diff --git a/src/slots_processor/helpers.rs b/src/slots_processor/helpers.rs index 8cbdab5..3fcb97e 100644 --- a/src/slots_processor/helpers.rs +++ b/src/slots_processor/helpers.rs @@ -1,31 +1,33 @@ use std::collections::HashMap; -use ethers::types::{Block as EthersBlock, Transaction as EthersTransaction, H256}; - -use crate::{ - clients::beacon::types::Blob as BeaconBlob, - utils::web3::{calculate_versioned_hash, get_tx_versioned_hashes}, +use crate::{clients::beacon::types::Blob as BeaconBlob, utils::web3::calculate_versioned_hash}; +use alloy::{ + primitives::B256, + rpc::types::{Block, Transaction}, }; pub fn create_tx_hash_versioned_hashes_mapping( - block: &EthersBlock, -) -> Result>, anyhow::Error> { + block: &Block, +) -> Result>, anyhow::Error> { let mut tx_to_versioned_hashes = HashMap::new(); - for tx in &block.transactions { - match get_tx_versioned_hashes(tx)? { - Some(versioned_hashes) => { - tx_to_versioned_hashes.insert(tx.hash, versioned_hashes); - } - None => continue, - }; + if let Some(transactions) = block.transactions.as_transactions() { + transactions + .iter() + .for_each(|tx| match &tx.blob_versioned_hashes { + Some(versioned_hashes) => { + tx_to_versioned_hashes.insert(tx.hash, versioned_hashes.clone()); + } + None => {} + }); } + Ok(tx_to_versioned_hashes) } pub fn create_versioned_hash_blob_mapping( blobs: &Vec, -) -> Result, anyhow::Error> { +) -> Result, anyhow::Error> { let mut version_hash_to_blob = HashMap::new(); for blob in blobs { diff --git a/src/slots_processor/mod.rs b/src/slots_processor/mod.rs index 259ab99..cb111ae 100644 --- a/src/slots_processor/mod.rs +++ b/src/slots_processor/mod.rs @@ -1,6 +1,6 @@ +use alloy::{rpc::types::BlockTransactionsKind, transports::http::ReqwestTransport}; use anyhow::{anyhow, Context as AnyhowContext, Result}; -use ethers::providers::{Http as HttpProvider, Middleware}; use tracing::{debug, info}; use crate::{ @@ -21,8 +21,10 @@ pub struct SlotsProcessor { context: Box>, } -impl SlotsProcessor { - pub fn new(context: Box>) -> SlotsProcessor { +impl SlotsProcessor { + pub fn new( + context: Box>, + ) -> SlotsProcessor { Self { context } } @@ -97,7 +99,7 @@ impl SlotsProcessor { // Fetch execution block and perform some checks let execution_block = provider - .get_block_with_txs(execution_block_hash) + .get_block(execution_block_hash.into(), BlockTransactionsKind::Full) .await? .with_context(|| format!("Execution block {execution_block_hash} not found"))?; @@ -134,9 +136,12 @@ impl SlotsProcessor { // Create entities to be indexed let block_entity = Block::try_from((&execution_block, slot))?; - - let transactions_entities = execution_block + let block_transactions = execution_block .transactions + .as_transactions() + .ok_or_else(|| anyhow!("Failed to parse transactions"))?; + + let transactions_entities = block_transactions .iter() .filter(|tx| tx_hash_to_versioned_hashes.contains_key(&tx.hash)) .map(|tx| Transaction::try_from((tx, &execution_block))) @@ -164,7 +169,7 @@ impl SlotsProcessor { .collect::>(); */ - let block_number = block_entity.number.as_u32(); + let block_number = block_entity.number; blobscan_client .index(block_entity, transactions_entities, blob_entities) diff --git a/src/synchronizer/mod.rs b/src/synchronizer/mod.rs index 9f4f660..e662fae 100644 --- a/src/synchronizer/mod.rs +++ b/src/synchronizer/mod.rs @@ -1,8 +1,8 @@ use std::fmt::Debug; +use alloy::transports::http::ReqwestTransport; use anyhow::anyhow; use async_trait::async_trait; -use ethers::providers::Http as HttpProvider; use futures::future::join_all; use tokio::task::JoinHandle; use tracing::{debug, info, Instrument}; @@ -22,7 +22,7 @@ pub mod error; #[async_trait] #[cfg_attr(test, automock)] -pub trait CommonSynchronizer: Send + Sync + Debug { +pub trait CommonSynchronizer: Send + Sync { async fn run( &self, initial_block_id: &BlockId, @@ -38,7 +38,6 @@ pub struct SynchronizerBuilder { checkpoint_type: CheckpointType, } -#[derive(Debug)] pub struct Synchronizer { context: Box>, num_threads: u32, @@ -89,8 +88,8 @@ impl SynchronizerBuilder { pub fn build( &self, - context: Box>, - ) -> Synchronizer { + context: Box>, + ) -> Synchronizer { Synchronizer { context, num_threads: self.num_threads, @@ -101,7 +100,7 @@ impl SynchronizerBuilder { } } -impl Synchronizer { +impl Synchronizer { async fn sync_slots(&self, from_slot: u32, to_slot: u32) -> Result<(), SynchronizerError> { let is_reverse_sync = to_slot < from_slot; let unprocessed_slots = to_slot.abs_diff(from_slot); @@ -314,7 +313,7 @@ impl Synchronizer { } #[async_trait] -impl CommonSynchronizer for Synchronizer { +impl CommonSynchronizer for Synchronizer { async fn run( &self, initial_block_id: &BlockId, diff --git a/src/utils/web3.rs b/src/utils/web3.rs index 25a3faf..ef75015 100644 --- a/src/utils/web3.rs +++ b/src/utils/web3.rs @@ -1,12 +1,10 @@ -use std::str::FromStr; - +use alloy::primitives::B256; use anyhow::{Context, Result}; -use ethers::core::k256::sha2::{Digest, Sha256}; -use ethers::{prelude::*, types::H256}; +use sha2::{Digest, Sha256}; const BLOB_COMMITMENT_VERSION_KZG: u8 = 0x01; -pub fn sha256(value: &str) -> Result { +pub fn sha256(value: &str) -> Result { let value_without_prefix = if let Some(value_without_prefix) = value.strip_prefix("0x") { value_without_prefix } else { @@ -20,51 +18,20 @@ pub fn sha256(value: &str) -> Result { let result = hasher.finalize(); - Ok(H256::from_slice(&result)) + Ok(B256::from_slice(&result)) } -pub fn calculate_versioned_hash(commitment: &str) -> Result { +pub fn calculate_versioned_hash(commitment: &str) -> Result { let hashed_commitment = sha256(commitment).context(format!("Failed to encode commitment {commitment}"))?; // Replace first byte with the blob commitment version byte - let hashed_commitment = &mut hashed_commitment.as_bytes()[1..].to_vec(); + let hashed_commitment = &mut hashed_commitment[1..].to_vec(); hashed_commitment.insert(0, BLOB_COMMITMENT_VERSION_KZG); - Ok(H256::from_slice(hashed_commitment)) -} - -pub fn get_tx_versioned_hashes(tx: &Transaction) -> Result>> { - match tx.other.get("blobVersionedHashes") { - Some(blob_versioned_hashes) => { - let blob_versioned_hashes = blob_versioned_hashes - .as_array() - .context("blobVersionedHashes field is not an array")?; - - if blob_versioned_hashes.is_empty() { - return Ok(None); - } - - let blob_versioned_hashes = blob_versioned_hashes - .iter() - .enumerate() - .map(|(i, versioned_hash)| { - versioned_hash - .as_str() - .with_context(|| format!("blobVersionedHashes[{}]: expected a string", i)) - .and_then(|versioned_hash| { - H256::from_str(versioned_hash) - .context(format!("blobVersionedHashes[{}]: invalid H256", i)) - }) - }) - .collect::>>()?; - - Ok(Some(blob_versioned_hashes)) - } - None => Ok(None), - } + Ok(B256::from_slice(hashed_commitment)) } -pub fn get_full_hash(hash: &H256) -> String { +pub fn get_full_hash(hash: &B256) -> String { format!("0x{:x}", hash) }