From 80821ac35708fb3e169760d15912b441b28631cd Mon Sep 17 00:00:00 2001 From: Lohann Paterno Coutinho Ferreira Date: Wed, 4 Sep 2024 12:09:07 +0100 Subject: [PATCH] Fix polygon block finality (#254) --- Cargo.lock | 688 +++++++++--------- chains/ethereum/backend/Cargo.toml | 2 +- chains/ethereum/backend/src/jsonrpsee.rs | 6 +- chains/ethereum/server/Cargo.toml | 1 + chains/ethereum/server/src/block_provider.rs | 297 ++++++++ chains/ethereum/server/src/block_stream.rs | 42 +- chains/ethereum/server/src/client.rs | 30 +- chains/ethereum/server/src/event_stream.rs | 39 +- .../server/src/finalized_block_stream.rs | 77 +- chains/ethereum/server/src/lib.rs | 7 +- chains/ethereum/server/src/log_filter.rs | 31 - chains/ethereum/server/src/logs_stream.rs | 2 +- chains/ethereum/server/src/multi_block.rs | 4 +- chains/ethereum/server/src/new_heads.rs | 19 +- chains/ethereum/server/src/shared_stream.rs | 2 +- rosetta-utils/Cargo.toml | 8 +- rosetta-utils/src/fns.rs | 27 + rosetta-utils/src/futures.rs | 20 + rosetta-utils/src/jsonrpsee.rs | 20 - rosetta-utils/src/jsonrpsee/auto_subscribe.rs | 2 +- .../src/jsonrpsee/polling_interval.rs | 2 +- rosetta-utils/src/lib.rs | 4 + scripts/check.sh | 4 +- 23 files changed, 834 insertions(+), 500 deletions(-) create mode 100644 chains/ethereum/server/src/block_provider.rs create mode 100644 rosetta-utils/src/fns.rs create mode 100644 rosetta-utils/src/futures.rs diff --git a/Cargo.lock b/Cargo.lock index 86ef041f..155c374b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,6 +36,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "aead" version = "0.3.2" @@ -174,11 +180,11 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a43b18702501396fa9bcdeecd533bc85fac75150d308fc0f6800a01e6234a003" +checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bytes", ] @@ -193,7 +199,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -205,11 +211,11 @@ dependencies = [ "alloy-sol-macro-input", "const-hex", "heck 0.5.0", - "indexmap 2.2.6", + "indexmap 2.5.0", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", "syn-solidity", "tiny-keccak", ] @@ -225,7 +231,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", "syn-solidity", ] @@ -345,7 +351,7 @@ dependencies = [ "num-bigint", "num-traits", "paste", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "zeroize", ] @@ -468,9 +474,9 @@ checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" @@ -489,9 +495,9 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii-canvas" @@ -537,13 +543,13 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8828ec6e544c02b0d6691d21ed9f9218d0384a82542855073c2a3f58304aaf0" +checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" dependencies = [ "async-task", "concurrent-queue", - "fastrand 2.1.0", + "fastrand 2.1.1", "futures-lite 2.3.0", "slab", ] @@ -567,7 +573,7 @@ checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ "async-channel 2.3.1", "async-executor", - "async-io 2.3.3", + "async-io 2.3.4", "async-lock 3.4.0", "blocking", "futures-lite 2.3.0", @@ -613,9 +619,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.3" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ "async-lock 3.4.0", "cfg-if", @@ -623,11 +629,11 @@ dependencies = [ "futures-io", "futures-lite 2.3.0", "parking", - "polling 3.7.2", - "rustix 0.38.34", + "polling 3.7.3", + "rustix 0.38.35", "slab", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -656,19 +662,19 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" dependencies = [ - "async-io 2.3.3", + "async-io 2.3.4", "blocking", "futures-lite 2.3.0", ] [[package]] name = "async-process" -version = "2.2.3" +version = "2.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7eda79bbd84e29c2b308d1dc099d7de8dcc7035e48f4bf5dc4a531a44ff5e2a" +checksum = "a8a07789659a4d385b79b18b9127fc27e1a59e1e89117c78c5ea3b806f016374" dependencies = [ "async-channel 2.3.1", - "async-io 2.3.3", + "async-io 2.3.4", "async-lock 3.4.0", "async-signal", "async-task", @@ -676,27 +682,27 @@ dependencies = [ "cfg-if", "event-listener 5.3.1", "futures-lite 2.3.0", - "rustix 0.38.34", + "rustix 0.38.35", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "async-signal" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794f185324c2f00e771cd9f1ae8b5ac68be2ca7abb129a87afd6e86d228bc54d" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" dependencies = [ - "async-io 2.3.3", + "async-io 2.3.4", "async-lock 3.4.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.34", + "rustix 0.38.35", "signal-hook-registry", "slab", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -733,13 +739,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -750,7 +756,7 @@ checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" dependencies = [ "futures", "pharos", - "rustc_version 0.4.0", + "rustc_version 0.4.1", ] [[package]] @@ -786,7 +792,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -805,8 +811,8 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", - "object 0.36.1", + "miniz_oxide 0.7.4", + "object 0.36.4", "rustc-demangle", ] @@ -972,8 +978,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", - "arrayvec 0.7.4", - "constant_time_eq 0.3.0", + "arrayvec 0.7.6", + "constant_time_eq 0.3.1", ] [[package]] @@ -1049,9 +1055,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" dependencies = [ "serde", ] @@ -1079,9 +1085,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.7" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] @@ -1111,12 +1117,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.5" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324c74f2155653c90b04f25b2a47a8a631360cb908f92a772695f430c7e31052" +checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -1303,9 +1310,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "constcat" @@ -1372,9 +1379,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpp_demangle" @@ -1387,9 +1394,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] @@ -1543,7 +1550,7 @@ dependencies = [ "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "subtle", "zeroize", ] @@ -1556,7 +1563,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -1604,7 +1611,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -1626,7 +1633,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -1702,7 +1709,7 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -1713,7 +1720,7 @@ checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -1725,8 +1732,8 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.4.0", - "syn 2.0.71", + "rustc_version 0.4.1", + "syn 2.0.77", ] [[package]] @@ -1819,7 +1826,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.71", + "syn 2.0.77", "termcolor", "toml", "walkdir", @@ -1870,9 +1877,9 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dyn-clonable" @@ -2207,7 +2214,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "syn 2.0.71", + "syn 2.0.77", "toml", "walkdir", ] @@ -2225,7 +2232,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -2234,7 +2241,7 @@ version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bytes", "cargo_metadata", "chrono", @@ -2251,7 +2258,7 @@ dependencies = [ "serde", "serde_json", "strum 0.26.3", - "syn 2.0.71", + "syn 2.0.77", "tempfile", "thiserror", "tiny-keccak", @@ -2439,7 +2446,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -2469,9 +2476,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fastrlp" @@ -2479,7 +2486,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "auto_impl", "bytes", ] @@ -2512,14 +2519,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] @@ -2552,12 +2559,12 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.8.0", ] [[package]] @@ -2736,7 +2743,7 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.1.0", + "fastrand 2.1.1", "futures-core", "futures-io", "parking", @@ -2761,7 +2768,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -2935,7 +2942,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.2.6", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -2944,9 +2951,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ "atomic-waker", "bytes", @@ -2954,7 +2961,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.2.6", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -3258,7 +3265,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.5", + "h2 0.4.6", "http 1.1.0", "http-body 1.0.1", "httparse", @@ -3296,7 +3303,7 @@ dependencies = [ "hyper 1.4.1", "hyper-util", "log", - "rustls 0.23.11", + "rustls 0.23.12", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -3305,9 +3312,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" dependencies = [ "bytes", "futures-channel", @@ -3443,9 +3450,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -3562,18 +3569,18 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -3603,15 +3610,15 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.24.0" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e419d6c39cb9632288c592a06d7d0a96740021b0bff812e211ace754b0fe8c9a" +checksum = "5ec465b607a36dc5dd45d48b7689bc83f679f66a3ac6b6b21cc787a11e0f8685" dependencies = [ - "jsonrpsee-client-transport 0.24.0", - "jsonrpsee-core 0.24.0", - "jsonrpsee-http-client 0.24.0", - "jsonrpsee-types 0.24.0", - "jsonrpsee-ws-client 0.24.0", + "jsonrpsee-client-transport 0.24.3", + "jsonrpsee-core 0.24.3", + "jsonrpsee-http-client 0.24.3", + "jsonrpsee-types 0.24.3", + "jsonrpsee-ws-client 0.24.3", ] [[package]] @@ -3624,7 +3631,7 @@ dependencies = [ "http 0.2.12", "jsonrpsee-core 0.22.5", "pin-project", - "rustls-native-certs 0.7.1", + "rustls-native-certs 0.7.3", "rustls-pki-types", "soketto 0.7.1", "thiserror", @@ -3646,7 +3653,7 @@ dependencies = [ "http 1.1.0", "jsonrpsee-core 0.23.2", "pin-project", - "rustls 0.23.11", + "rustls 0.23.12", "rustls-pki-types", "rustls-platform-verifier", "soketto 0.8.0", @@ -3660,16 +3667,16 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.24.0" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b6dc3b1e2da087969e69a095e7d6127966c8c194490b311017bb2053a7d5a1" +checksum = "90f0977f9c15694371b8024c35ab58ca043dbbf4b51ccb03db8858a021241df1" dependencies = [ "base64 0.22.1", "futures-util", "http 1.1.0", - "jsonrpsee-core 0.24.0", + "jsonrpsee-core 0.24.3", "pin-project", - "rustls 0.23.11", + "rustls 0.23.12", "rustls-pki-types", "rustls-platform-verifier", "soketto 0.8.0", @@ -3728,9 +3735,9 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.24.0" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06b8be79a3bdd7d87c1d95c0e939052b7f64fffce7b9436986e43e92f20a978" +checksum = "e942c55635fbf5dc421938b8558a8141c7e773720640f4f1dbe1f4164ca4e221" dependencies = [ "async-trait", "bytes", @@ -3739,7 +3746,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "jsonrpsee-types 0.24.0", + "jsonrpsee-types 0.24.3", "pin-project", "rustc-hash 2.0.0", "serde", @@ -3772,9 +3779,9 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.24.0" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52dc99c70619e252e6adc5e95144323505a69a1742771de5b3f2071e1595b363" +checksum = "e33774602df12b68a2310b38a535733c477ca4a498751739f89fe8dbbb62ec4c" dependencies = [ "async-trait", "base64 0.22.1", @@ -3782,9 +3789,9 @@ dependencies = [ "hyper 1.4.1", "hyper-rustls 0.27.2", "hyper-util", - "jsonrpsee-core 0.24.0", - "jsonrpsee-types 0.24.0", - "rustls 0.23.11", + "jsonrpsee-core 0.24.3", + "jsonrpsee-types 0.24.3", + "rustls 0.23.12", "rustls-platform-verifier", "serde", "serde_json", @@ -3823,9 +3830,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.24.0" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0feba38a9878d70ccccd2f54b534b15e861d6caa7911d59abfd3e0d8b4de091f" +checksum = "23b67d6e008164f027afbc2e7bb79662650158d26df200040282d2aa1cbb093b" dependencies = [ "http 1.1.0", "serde", @@ -3848,14 +3855,14 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.24.0" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82b1c7fc629c345581d89ad802d53dc11d18df11d4d94d2c95da6e70f8520d3" +checksum = "992bf67d1132f88edf4a4f8cff474cf01abb2be203004a2b8e11c2b20795b99e" dependencies = [ "http 1.1.0", - "jsonrpsee-client-transport 0.24.0", - "jsonrpsee-core 0.24.0", - "jsonrpsee-types 0.24.0", + "jsonrpsee-client-transport 0.24.3", + "jsonrpsee-core 0.24.3", + "jsonrpsee-types 0.24.3", "url", ] @@ -3899,9 +3906,9 @@ dependencies = [ [[package]] name = "keccak-asm" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47a3633291834c4fbebf8673acbc1b04ec9d151418ff9b8e26dcd79129928758" +checksum = "422fbc7ff2f2f5bdffeb07718e5a5324dca72b0c9293d50df4026652385e3314" dependencies = [ "digest 0.10.7", "sha3-asm", @@ -3967,9 +3974,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libm" @@ -3985,6 +3992,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", + "redox_syscall", ] [[package]] @@ -4074,9 +4082,9 @@ dependencies = [ [[package]] name = "lru" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" dependencies = [ "hashbrown 0.14.5", ] @@ -4121,7 +4129,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.34", + "rustix 0.38.35", ] [[package]] @@ -4185,15 +4193,25 @@ dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi 0.3.9", "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4322,7 +4340,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "itoa", ] @@ -4379,23 +4397,23 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -4412,9 +4430,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.1" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -4437,7 +4455,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "auto_impl", "bytes", "ethereum-types", @@ -4479,7 +4497,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -4543,7 +4561,7 @@ version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bitvec", "byte-slice-cast", "bytes", @@ -4558,7 +4576,7 @@ version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", @@ -4588,7 +4606,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.2", + "redox_syscall", "smallvec", "windows-targets 0.52.6", ] @@ -4692,7 +4710,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.2.6", + "indexmap 2.5.0", ] [[package]] @@ -4702,7 +4720,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" dependencies = [ "futures", - "rustc_version 0.4.0", + "rustc_version 0.4.1", ] [[package]] @@ -4735,7 +4753,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -4773,7 +4791,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -4790,12 +4808,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", - "fastrand 2.1.0", + "fastrand 2.1.1", "futures-io", ] @@ -4854,7 +4872,7 @@ dependencies = [ "polkavm-common 0.8.0", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -4866,7 +4884,7 @@ dependencies = [ "polkavm-common 0.9.0", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -4876,7 +4894,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" dependencies = [ "polkavm-derive-impl 0.8.0", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -4886,7 +4904,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ "polkavm-derive-impl 0.9.0", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -4907,17 +4925,17 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.2" +version = "3.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" dependencies = [ "cfg-if", "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.34", + "rustix 0.38.35", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4950,9 +4968,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "precomputed-hash" @@ -4962,12 +4983,12 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "prettyplease" -version = "0.2.20" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -5006,11 +5027,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.22.20", ] [[package]] @@ -5074,9 +5095,9 @@ dependencies = [ [[package]] name = "psm" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" dependencies = [ "cc", ] @@ -5089,9 +5110,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -5220,27 +5241,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom 0.2.15", "libredox", @@ -5264,14 +5276,14 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] name = "regex" -version = "1.10.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -5561,7 +5573,7 @@ dependencies = [ "auto_impl", "futures-core", "hex-literal", - "jsonrpsee-core 0.24.0", + "jsonrpsee-core 0.24.3", "parity-scale-codec", "rosetta-ethereum-types", "scale-info", @@ -5613,7 +5625,7 @@ dependencies = [ "futures-timer", "futures-util", "hex", - "jsonrpsee 0.24.0", + "jsonrpsee 0.24.3", "pin-project", "serde", "serde_json", @@ -5662,6 +5674,7 @@ dependencies = [ "alloy-sol-types", "anyhow", "async-trait", + "auto_impl", "ethers-solc", "fork-tree", "futures-timer", @@ -5804,7 +5817,7 @@ dependencies = [ "futures-util", "generic-array 1.1.0", "impl-serde", - "jsonrpsee-core 0.24.0", + "jsonrpsee-core 0.24.3", "pin-project", "serde", "serde_json", @@ -5899,9 +5912,9 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver 1.0.23", ] @@ -5936,9 +5949,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" dependencies = [ "bitflags 2.6.0", "errno", @@ -5968,22 +5981,22 @@ dependencies = [ "log", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.5", + "rustls-webpki 0.102.7", "subtle", "zeroize", ] [[package]] name = "rustls" -version = "0.23.11" +version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" +checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ "log", "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.5", + "rustls-webpki 0.102.7", "subtle", "zeroize", ] @@ -6002,12 +6015,12 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.2", + "rustls-pemfile 2.1.3", "rustls-pki-types", "schannel", "security-framework", @@ -6024,9 +6037,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ "base64 0.22.1", "rustls-pki-types", @@ -6034,36 +6047,36 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-platform-verifier" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e3beb939bcd33c269f4bf946cc829fcd336370267c4a927ac0399c84a3151a1" +checksum = "afbb878bdfdf63a336a5e63561b1835e7a8c91524f51621db870169eac84b490" dependencies = [ "core-foundation", "core-foundation-sys", "jni", "log", "once_cell", - "rustls 0.23.11", - "rustls-native-certs 0.7.1", + "rustls 0.23.12", + "rustls-native-certs 0.7.3", "rustls-platform-verifier-android", - "rustls-webpki 0.102.5", + "rustls-webpki 0.102.7", "security-framework", "security-framework-sys", - "webpki-roots 0.26.3", + "webpki-roots 0.26.5", "winapi", ] [[package]] name = "rustls-platform-verifier-android" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84e217e7fdc8466b5b35d30f8c0a30febd29173df4a3a0c2115d306b9c4117ad" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" [[package]] name = "rustls-webpki" @@ -6077,9 +6090,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.5" +version = "0.102.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -6226,7 +6239,7 @@ version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", @@ -6251,15 +6264,15 @@ dependencies = [ "proc-macro2", "quote", "scale-info", - "syn 2.0.71", + "syn 2.0.77", "thiserror", ] [[package]] name = "scale-value" -version = "0.16.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cf9738c263c665144177201126bdad39d3d62512152f178f35002228026976" +checksum = "ba4d772cfb7569e03868400344a1695d16560bf62b86b918604773607d39ec84" dependencies = [ "base58", "blake2", @@ -6304,7 +6317,7 @@ checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" dependencies = [ "aead 0.5.2", "arrayref", - "arrayvec 0.7.4", + "arrayvec 0.7.6", "curve25519-dalek 4.1.3", "getrandom_or_panic", "merlin", @@ -6465,9 +6478,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.204" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] @@ -6483,22 +6496,23 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -6516,9 +6530,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -6560,7 +6574,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -6608,9 +6622,9 @@ dependencies = [ [[package]] name = "sha1_smol" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" [[package]] name = "sha2" @@ -6648,9 +6662,9 @@ dependencies = [ [[package]] name = "sha3-asm" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b57fd861253bff08bb1919e995f90ba8f4889de2726091c8876f3a4e823b40" +checksum = "57d79b758b7cb2085612b11a235055e485605a5103faccdd633f35bd7aee69dd" dependencies = [ "cc", "cfg-if", @@ -6665,6 +6679,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -6731,14 +6751,14 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smol" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e635339259e51ef85ac7aa29a1cd991b957047507288697a690e80ab97d07cad" +checksum = "aad24f41392790e6ac67f4f4cd871da61f7d758e07b5622431e491e897d9c8a7" dependencies = [ "async-channel 2.3.1", "async-executor", "async-fs", - "async-io 2.3.3", + "async-io 2.3.4", "async-lock 3.4.0", "async-net", "async-process", @@ -6752,7 +6772,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d1eaa97d77be4d026a1e7ffad1bb3b78448763b357ea6f8188d3e6f736a9b9" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "async-lock 3.4.0", "atomic-take", "base64 0.21.7", @@ -6999,7 +7019,7 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -7128,10 +7148,10 @@ checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -7268,9 +7288,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.47.0" +version = "1.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4743ce898933fbff7bbf414f497c459a782d496269644b3d650a398ae6a487ba" +checksum = "43fce22ed1df64d04b262351c8f9d5c6da4f76f79f25ad15529792f893fad25d" dependencies = [ "Inflector", "num-format", @@ -7417,7 +7437,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -7504,7 +7524,7 @@ dependencies = [ "scale-info", "scale-typegen", "subxt-metadata", - "syn 2.0.71", + "syn 2.0.77", "thiserror", "tokio", ] @@ -7567,7 +7587,7 @@ dependencies = [ "quote", "scale-typegen", "subxt-codegen", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -7637,9 +7657,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.71" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -7655,7 +7675,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -7704,20 +7724,21 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.15" +version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", - "fastrand 2.1.0", - "rustix 0.38.34", - "windows-sys 0.52.0", + "fastrand 2.1.1", + "once_cell", + "rustix 0.38.35", + "windows-sys 0.59.0", ] [[package]] @@ -7742,22 +7763,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.62" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.62" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -7865,32 +7886,31 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2 0.5.7", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -7941,7 +7961,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.11", + "rustls 0.23.12", "rustls-pki-types", "tokio", ] @@ -7982,13 +8002,13 @@ dependencies = [ "futures-util", "log", "native-tls", - "rustls 0.23.11", + "rustls 0.23.12", "rustls-pki-types", "tokio", "tokio-native-tls", "tokio-rustls 0.26.0", "tungstenite 0.23.0", - "webpki-roots 0.26.3", + "webpki-roots 0.26.5", ] [[package]] @@ -8007,21 +8027,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.14" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.15", + "toml_edit 0.22.20", ] [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] @@ -8032,33 +8052,22 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "toml_datetime", "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.22.15" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.13", + "winnow 0.6.18", ] [[package]] @@ -8079,15 +8088,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -8109,7 +8118,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -8262,7 +8271,7 @@ dependencies = [ "log", "native-tls", "rand 0.8.5", - "rustls 0.23.11", + "rustls 0.23.12", "rustls-pki-types", "sha1 0.10.6", "thiserror", @@ -8343,9 +8352,9 @@ dependencies = [ [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" [[package]] name = "universal-hash" @@ -8427,9 +8436,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "void" @@ -8509,34 +8518,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -8546,9 +8556,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8556,22 +8566,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasmi" @@ -8757,9 +8767,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -8773,9 +8783,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" dependencies = [ "rustls-pki-types", ] @@ -8798,11 +8808,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -8847,6 +8857,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -9036,9 +9055,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.13" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] @@ -9064,7 +9083,7 @@ dependencies = [ "js-sys", "log", "pharos", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "send_wrapper 0.6.0", "thiserror", "wasm-bindgen", @@ -9101,7 +9120,7 @@ checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", "linux-raw-sys 0.4.14", - "rustix 0.38.34", + "rustix 0.38.35", ] [[package]] @@ -9122,6 +9141,7 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] @@ -9133,7 +9153,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -9153,7 +9173,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.77", ] [[package]] @@ -9197,9 +9217,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.12+zstd.1.5.6" +version = "2.0.13+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", diff --git a/chains/ethereum/backend/Cargo.toml b/chains/ethereum/backend/Cargo.toml index a488196a..6dcc609e 100644 --- a/chains/ethereum/backend/Cargo.toml +++ b/chains/ethereum/backend/Cargo.toml @@ -8,7 +8,7 @@ description = "Ethereum RPC method." [dependencies] async-trait = "0.1" -auto_impl = "1.1" +auto_impl = "1.2" futures-core = { version = "0.3", default-features = false, features = ["alloc"] } jsonrpsee-core = { version = "0.24", default-features = false, features = ["client"], optional = true } parity-scale-codec = { workspace = true, features = ["derive"], optional = true } diff --git a/chains/ethereum/backend/src/jsonrpsee.rs b/chains/ethereum/backend/src/jsonrpsee.rs index 04b967e3..453b34fb 100644 --- a/chains/ethereum/backend/src/jsonrpsee.rs +++ b/chains/ethereum/backend/src/jsonrpsee.rs @@ -104,9 +104,11 @@ where } } +impl Unpin for Adapter where T: Unpin {} + impl Debug for Adapter where - T: ClientT + Send + Sync + Debug, + T: Debug, { fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult { f.debug_tuple("Adapter").field(&self.0).finish() @@ -115,7 +117,7 @@ where impl Display for Adapter where - T: ClientT + Send + Sync + Display, + T: Display, { fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult { ::fmt(&self.0, f) diff --git a/chains/ethereum/server/Cargo.toml b/chains/ethereum/server/Cargo.toml index a00f670a..14abe039 100644 --- a/chains/ethereum/server/Cargo.toml +++ b/chains/ethereum/server/Cargo.toml @@ -9,6 +9,7 @@ description = "Ethereum rosetta server." [dependencies] anyhow = "1.0" async-trait = "0.1" +auto_impl = "1.2" fork-tree = { version = "13.0" } futures-timer = "3.0" futures-util = "0.3" diff --git a/chains/ethereum/server/src/block_provider.rs b/chains/ethereum/server/src/block_provider.rs new file mode 100644 index 00000000..d68ebf5e --- /dev/null +++ b/chains/ethereum/server/src/block_provider.rs @@ -0,0 +1,297 @@ +use super::client::BlockFinalityStrategy; +use std::sync::Arc; +use tokio::{ + sync::Mutex, + time::{Duration, Instant}, +}; + +use crate::utils::PartialBlock; +use auto_impl::auto_impl; +use futures_util::{future::BoxFuture, Future, FutureExt}; +use rosetta_config_ethereum::{ + ext::types::{crypto::DefaultCrypto, rpc::RpcBlock, BlockIdentifier, SealedBlock}, + AtBlock, H256, +}; +use rosetta_ethereum_backend::{jsonrpsee::Adapter, EthereumRpc}; + +/// Block Provider trait provides an interface to query blocks from an Ethereum node using +/// different finality strategies. +#[auto_impl(&, Box, Arc)] +pub trait BlockProvider { + /// Error type + type Error: Send; + /// Future type when querying a block by hash or number + type BlockAtFut: Future>, Self::Error>> + + Unpin + + Send + + 'static; + /// Future type when querying the latest block + type LatestFut: Future, Self::Error>> + Unpin + Send + 'static; + /// Future type when querying the latest finalized block + type FinalizedFut: Future, Self::Error>> + + Unpin + + Send + + 'static; + + /// Get block by identifier + fn block_at(&self, block_ref: BlockIdentifier) -> Self::BlockAtFut; + /// Retrieve the latest block + fn latest(&self) -> Self::LatestFut; + /// Retrieve the latest finalized block + fn finalized(&self) -> Self::FinalizedFut; +} + +/// Block Provider Error +#[derive(thiserror::Error, Debug, PartialEq, Eq, Clone)] +pub enum BlockProviderError { + #[error("{0}")] + Rpc(ERR), + #[error("latest block not found")] + LatestBlockNotFound, + #[error("finalized block not found")] + FinalizedBlockNotFound, +} + +/// Converts a `RpcBlock` into a `Arc`. +fn into_sealed_block( + block: Result>, ERR>, +) -> Result>>, BlockProviderError> { + let Some(block) = block.map_err(BlockProviderError::Rpc)? else { + return Ok(None); + }; + + let block_number = block.header.number; + let block = if let Some(hash) = block.hash { + block.seal(hash) + } else { + // OBS: this should never happen, except for pending blocks, a block should + // always have a hash. + let sealed_block = block.seal_slow::(); + let block_hash = sealed_block.header().hash(); + tracing::error!( + "[report this bug] api returned the block {block_number} without hash, hash was computed locally: {block_hash}." + ); + sealed_block + }; + Ok(Some(Arc::new(block))) +} + +impl BlockProvider for Adapter +where + RPC: EthereumRpc + Send + Clone + 'static, + RPC::Error: Send, +{ + type Error = BlockProviderError<::Error>; + type BlockAtFut = BoxFuture<'static, Result>, Self::Error>>; + type LatestFut = BoxFuture<'static, Result, Self::Error>>; + type FinalizedFut = BoxFuture<'static, Result, Self::Error>>; + + fn block_at(&self, block_ref: BlockIdentifier) -> Self::BlockAtFut { + let rpc = self.clone(); + async move { + let maybe_block = ::block(&rpc.0, block_ref.into()) + .map(into_sealed_block) + .await?; + Ok(maybe_block) + } + .boxed() + } + + fn latest(&self) -> Self::LatestFut { + let rpc = self.clone(); + async move { + let Some(latest_block) = ::block(&rpc.0, AtBlock::Latest) + .map(into_sealed_block) + .await? + else { + return Err(BlockProviderError::LatestBlockNotFound); + }; + Ok(latest_block) + } + .boxed() + } + + fn finalized(&self) -> Self::FinalizedFut { + let rpc = self.clone(); + async move { + let Some(best_block) = ::block(&rpc.0, AtBlock::Finalized) + .map(into_sealed_block) + .await? + else { + return Err(BlockProviderError::FinalizedBlockNotFound); + }; + Ok(best_block) + } + .boxed() + } +} + +#[derive(Clone)] +pub struct RpcBlockProvider(Arc>); + +impl RpcBlockProvider +where + RPC: EthereumRpc + Send + Sync + Clone + 'static, + RPC::Error: std::error::Error + Send, +{ + pub async fn new( + rpc: RPC, + cache_timeout: Duration, + finality_strategy: BlockFinalityStrategy, + ) -> Result> { + // Retrieve the latest block + let Some(latest_block) = ::block(&rpc, AtBlock::Latest) + .map(into_sealed_block) + .await? + else { + return Err(BlockProviderError::LatestBlockNotFound); + }; + + // Retrieve the best block following the finality strategy + let best_block = { + let at_block = match finality_strategy { + BlockFinalityStrategy::Finalized => AtBlock::Finalized, + BlockFinalityStrategy::Confirmations(confirmations) => { + let latest_block_number = latest_block.header().number(); + let best_block_number = latest_block_number.saturating_sub(confirmations); + AtBlock::At(BlockIdentifier::Number(best_block_number)) + }, + }; + let Some(best_block) = + ::block(&rpc, at_block).map(into_sealed_block).await? + else { + return Err(BlockProviderError::FinalizedBlockNotFound); + }; + best_block + }; + let now = Instant::now(); + + // Create the inner state + let inner = InnerState { + rpc, + finality_strategy, + cache_timeout, + best_block: Mutex::new((best_block, now)), + latest_block: Mutex::new((latest_block, now)), + }; + + // Return the block provider + Ok(Self(Arc::new(inner))) + } +} + +impl AsRef for RpcBlockProvider { + fn as_ref(&self) -> &RPC { + &self.0.rpc + } +} + +impl BlockProvider for RpcBlockProvider +where + RPC: EthereumRpc + Send + Sync + 'static, + RPC::Error: std::error::Error + Send, +{ + /// Error type + type Error = BlockProviderError; + /// Future type + type BlockAtFut = BoxFuture<'static, Result>, Self::Error>>; + /// Future type + type LatestFut = BoxFuture<'static, Result, Self::Error>>; + /// Future type + type FinalizedFut = BoxFuture<'static, Result, Self::Error>>; + + /// Get block by identifier + fn block_at(&self, block_ref: BlockIdentifier) -> Self::BlockAtFut { + let this = self.0.clone(); + async move { + let maybe_block = ::block(&this.rpc, block_ref.into()) + .map(into_sealed_block) + .await?; + Ok(maybe_block) + } + .boxed() + } + + /// Retrieve the latest block + fn latest(&self) -> Self::LatestFut { + let this = self.0.clone(); + async move { this.latest_block().await }.boxed() + } + + /// Retrieve the latest finalized block, following the specified finality strategy + fn finalized(&self) -> Self::FinalizedFut { + let this = self.0.clone(); + async move { this.best_block().await }.boxed() + } +} + +struct InnerState { + /// Ethereum RPC client + rpc: RPC, + /// How to determine block finality + finality_strategy: BlockFinalityStrategy, + /// Duration to discard cached `best_block` and `latest_block` + cache_timeout: Duration, + /// Best finalized block number that we have seen + best_block: Mutex<(Arc, Instant)>, + /// Latest block number that we have seen + latest_block: Mutex<(Arc, Instant)>, +} + +impl InnerState +where + RPC: EthereumRpc + Send + Sync + 'static, + RPC::Error: std::error::Error + Send, +{ + /// Get the cached latest block, or refresh after `cache_timeout`. + async fn latest_block<'a: 'b, 'b>( + &'a self, + ) -> Result, BlockProviderError<::Error>> { + let mut guard = self.latest_block.lock().await; + + // Check if the cache has expired + if guard.1.elapsed() > self.cache_timeout { + let Some(latest_block) = ::block(&self.rpc, AtBlock::Latest) + .map(into_sealed_block) + .await? + else { + return Err(BlockProviderError::LatestBlockNotFound); + }; + *guard = (latest_block, Instant::now()); + } + + Ok(guard.0.clone()) + } + + /// Get the cached finalized block, or refresh after `cache_timeout`. + async fn best_block<'a: 'b, 'b>( + &'a self, + ) -> Result, BlockProviderError<::Error>> { + let mut guard = self.best_block.lock().await; + + // Check if the cache has expired + if guard.1.elapsed() > self.cache_timeout { + let at_block = match self.finality_strategy { + BlockFinalityStrategy::Finalized => AtBlock::Finalized, + BlockFinalityStrategy::Confirmations(confirmations) => { + let latest_block_number = self.latest_block().await?.header().number(); + let best_block_number = latest_block_number.saturating_sub(confirmations); + // If the best block number is the same, simply refresh the cache timestamp. + if best_block_number == guard.0.header().number() { + *guard = (guard.0.clone(), Instant::now()); + return Ok(guard.0.clone()); + } + AtBlock::At(BlockIdentifier::Number(best_block_number)) + }, + }; + let Some(best_block) = + ::block(&self.rpc, at_block).map(into_sealed_block).await? + else { + return Err(BlockProviderError::FinalizedBlockNotFound); + }; + *guard = (best_block, Instant::now()); + } + + Ok(guard.0.clone()) + } +} diff --git a/chains/ethereum/server/src/block_stream.rs b/chains/ethereum/server/src/block_stream.rs index 00920549..68843aa2 100644 --- a/chains/ethereum/server/src/block_stream.rs +++ b/chains/ethereum/server/src/block_stream.rs @@ -1,4 +1,5 @@ use super::{ + block_provider::BlockProvider, event_stream::{EthereumEventStream, NewBlock}, state::State, }; @@ -15,56 +16,59 @@ use std::{ task::{Context, Poll}, }; -pub struct BlockStream +pub struct BlockStream where + P: BlockProvider + Unpin + Send + Sync + 'static, + P::Error: std::error::Error + Send + Sync + 'static, RPC: for<'s> EthereumPubSub = Subscription>> - + Clone + Unpin + Send + Sync + 'static, - RPC::SubscriptionError: Send + Sync, + RPC::SubscriptionError: Send + Sync + 'static, { - block_stream: Option>, + stream: Option>, state: State, } -impl BlockStream +impl BlockStream where + P: BlockProvider + Unpin + Send + Sync + 'static, + P::Error: std::error::Error + Send + Sync + 'static, RPC: for<'s> EthereumPubSub = Subscription>> - + Clone + Unpin + Send + Sync + 'static, - RPC::SubscriptionError: Send + Sync, + RPC::SubscriptionError: Send + Sync + 'static, { #[must_use] - pub fn new(client: RPC, state: State) -> Self { - Self { block_stream: Some(EthereumEventStream::new(client)), state } + pub fn new(provider: P, client: RPC, state: State) -> Self { + Self { stream: Some(EthereumEventStream::new(client, provider)), state } } } -impl Stream for BlockStream +impl Stream for BlockStream where + P: BlockProvider + Unpin + Send + Sync + 'static, + P::Error: std::error::Error + Send + Sync + 'static, RPC: for<'s> EthereumPubSub = Subscription>> - + Clone + Unpin + Send + Sync + 'static, - RPC::SubscriptionError: Send + Sync, + RPC::SubscriptionError: Send + Sync + 'static, { type Item = ClientEvent; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - let Some(mut block_stream) = self.block_stream.take() else { + let Some(mut stream) = self.stream.take() else { return Poll::Ready(None); }; let mut failures = 0; loop { - match block_stream.poll_next_unpin(cx) { + match stream.poll_next_unpin(cx) { Poll::Ready(Some(new_block)) => { let block_id = { let header = new_block.sealed_block().header(); @@ -76,7 +80,7 @@ where let is_finalized = matches!(new_block, NewBlock::Finalized(_)); if let Err(err) = self.state.import(new_block.into_sealed_block()) { failures += 1; - tracing::warn!("failed to import block {block_id} ({failures}): {:?}", err); + tracing::warn!("failed to import block {block_id} ({failures}): {err:?}"); if failures >= 5 { return Poll::Ready(None); } @@ -88,19 +92,15 @@ where } else { ClientEvent::NewHead(block_id) }; - self.block_stream = Some(block_stream); + self.stream = Some(stream); break Poll::Ready(Some(event)); }, Poll::Ready(None) => break Poll::Ready(None), Poll::Pending => { - self.block_stream = Some(block_stream); + self.stream = Some(stream); break Poll::Pending; }, } } } - - fn size_hint(&self) -> (usize, Option) { - (0, None) - } } diff --git a/chains/ethereum/server/src/client.rs b/chains/ethereum/server/src/client.rs index f4f64144..3637112a 100644 --- a/chains/ethereum/server/src/client.rs +++ b/chains/ethereum/server/src/client.rs @@ -1,5 +1,6 @@ #![allow(clippy::option_if_let_else)] use crate::{ + block_provider::RpcBlockProvider, block_stream::BlockStream, log_filter::LogFilter, proof::verify_proof, @@ -11,7 +12,6 @@ use crate::{ }, }; use anyhow::{Context, Result}; -use futures_util::StreamExt; use rosetta_config_ethereum::{ ext::types::{ crypto::{Crypto, DefaultCrypto, Keypair, Signer}, @@ -27,6 +27,7 @@ use rosetta_config_ethereum::{ QueryResult as EthQueryResult, SubmitResult, Subscription, }; +use futures_util::StreamExt; use rosetta_core::{ crypto::{address::Address, PublicKey}, types::{BlockIdentifier, PartialBlockIdentifier}, @@ -39,11 +40,16 @@ use rosetta_ethereum_backend::{ }, BlockRange, EthereumRpc, ExitReason, }; -use std::sync::{ - atomic::{self, Ordering}, - Arc, +use std::{ + sync::{ + atomic::{self, Ordering}, + Arc, + }, + time::Duration, }; +pub type BlockStreamType

= SharedStream>, Adapter

>>; + /// Strategy used to determine the finalized block #[derive(Default, Debug, Clone, Copy, PartialEq, Eq)] pub enum BlockFinalityStrategy { @@ -159,7 +165,7 @@ where impl

EthereumClient

where - P: ClientT + Send + Sync + 'static, + P: ClientT + Unpin + Send + Sync + 'static, { pub const fn config(&self) -> &BlockchainConfig { &self.config @@ -528,9 +534,19 @@ where P: SubscriptionClientT + Unpin + Clone + Send + Sync + 'static, { #[allow(clippy::missing_errors_doc)] - pub async fn listen(&self) -> Result>>> { + pub async fn listen(&self) -> Result> { let best_finalized_block = self.finalized_block(None).await?; - let mut stream = BlockStream::new(self.backend.clone(), State::new(best_finalized_block)); + let block_provider = RpcBlockProvider::new( + self.backend.clone(), + Duration::from_secs(5), + self.block_finality_strategy, + ) + .await?; + let mut stream = BlockStream::new( + block_provider, + self.backend.clone(), + State::new(best_finalized_block), + ); match stream.next().await { Some(ClientEvent::Close(msg)) => anyhow::bail!(msg), None => anyhow::bail!("Failed to open the event stream"), diff --git a/chains/ethereum/server/src/event_stream.rs b/chains/ethereum/server/src/event_stream.rs index 7ddfe042..211e7580 100644 --- a/chains/ethereum/server/src/event_stream.rs +++ b/chains/ethereum/server/src/event_stream.rs @@ -1,3 +1,5 @@ +use crate::block_provider::BlockProvider; + use super::{finalized_block_stream::FinalizedBlockStream, new_heads::NewHeadsStream}; use futures_util::StreamExt; use rosetta_config_ethereum::ext::types::SealedBlock; @@ -49,49 +51,52 @@ impl From for SealedBlock { } } -pub struct EthereumEventStream +pub struct EthereumEventStream where - C: for<'s> EthereumPubSub = Subscription>> - + Clone + P: BlockProvider + Unpin + Send + 'static, + P::Error: std::error::Error + Send, + RPC: for<'s> EthereumPubSub = Subscription>> + Unpin + Send + Sync + 'static, - C::SubscriptionError: Send + Sync, + RPC::SubscriptionError: Send + Sync, { /// Latest block stream - new_head_stream: Option>, + new_head_stream: Option>, /// Finalized blocks stream - finalized_stream: Option>, + finalized_stream: Option>, } -impl EthereumEventStream +impl EthereumEventStream where - C: for<'s> EthereumPubSub = Subscription>> - + Clone + P: BlockProvider + Unpin + Send + Sync + 'static, + P::Error: std::error::Error + Send + Sync + 'static, + RPC: for<'s> EthereumPubSub = Subscription>> + Unpin + Send + Sync + 'static, - C::SubscriptionError: Send + Sync, + RPC::SubscriptionError: Send + Sync + 'static, { - pub fn new(client: C) -> Self { + pub fn new(client: RPC, provider: P) -> Self { Self { - new_head_stream: Some(NewHeadsStream::new(client.clone())), - finalized_stream: Some(FinalizedBlockStream::new(client)), + new_head_stream: Some(NewHeadsStream::new(client)), + finalized_stream: Some(FinalizedBlockStream::new(provider)), } } } -impl Stream for EthereumEventStream +impl Stream for EthereumEventStream where - C: for<'s> EthereumPubSub = Subscription>> - + Clone + P: BlockProvider + Unpin + Send + Sync + 'static, + P::Error: std::error::Error + Send + Sync + 'static, + RPC: for<'s> EthereumPubSub = Subscription>> + Unpin + Send + Sync + 'static, - C::SubscriptionError: Send + Sync, + RPC::SubscriptionError: Send + Sync + 'static, { type Item = NewBlock; diff --git a/chains/ethereum/server/src/finalized_block_stream.rs b/chains/ethereum/server/src/finalized_block_stream.rs index ef3e7d08..50b20a10 100644 --- a/chains/ethereum/server/src/finalized_block_stream.rs +++ b/chains/ethereum/server/src/finalized_block_stream.rs @@ -1,13 +1,10 @@ -use crate::utils::{EthereumRpcExt, PartialBlock}; +use crate::{block_provider::BlockProvider, utils::PartialBlock}; use futures_timer::Delay; use futures_util::{future::BoxFuture, FutureExt, Stream}; -use rosetta_config_ethereum::ext::types::crypto::DefaultCrypto; -use rosetta_ethereum_backend::{ - ext::types::{AtBlock, Header}, - EthereumRpc, -}; +use rosetta_ethereum_backend::ext::types::Header; use std::{ pin::Pin, + sync::Arc, task::{Context, Poll}, time::{Duration, Instant}, }; @@ -125,30 +122,30 @@ impl Statistics { /// A stream which emits new blocks finalized blocks, it also guarantees new finalized blocks are /// monotonically increasing. -pub struct FinalizedBlockStream { +pub struct FinalizedBlockStream { /// Ethereum RPC backend. - backend: B, + provider: P, /// Controls the polling interval for checking for new finalized blocks. statistics: Statistics, /// Latest known finalized block and the timestamp when it was received. - best_finalized_block: Option<(PartialBlock, Instant)>, + best_finalized_block: Option<(Arc, Instant)>, /// State machine that controls fetching the latest finalized block. - state: Option, B::Error>>>, + state: Option, P::Error>>>, /// Count of consecutive errors. consecutive_errors: u32, } -impl FinalizedBlockStream +impl

FinalizedBlockStream

where - B: EthereumRpc + EthereumRpcExt + Unpin + Clone + Send + Sync + 'static, + P: BlockProvider + Send + 'static, { - pub fn new(backend: B) -> Self { + pub fn new(provider: P) -> Self { Self { - backend, + provider, statistics: Statistics { best_finalized_block: None, new: 0, @@ -164,9 +161,10 @@ where } } -impl Stream for FinalizedBlockStream +impl

Stream for FinalizedBlockStream

where - B: EthereumRpc + EthereumRpcExt + Unpin + Clone + Send + Sync + 'static, + P: BlockProvider + Unpin + Send + 'static, + P::Error: std::error::Error + Send, { type Item = PartialBlock; @@ -186,21 +184,8 @@ where //////////////////////////////////////////////// StateMachine::Wait(mut delay) => match delay.poll_unpin(cx) { Poll::Ready(()) => { - let client = self.backend.clone(); - let static_fut = - async move { - let block = client.block(AtBlock::Finalized).await; - block.map(|maybe_block| maybe_block.map(|block| { - if let Some(hash) = block.hash { - block.seal(hash) - } else { - // TODO: this should never happen, as a finalized block should always have a hash. - tracing::warn!("[report this bug] api returned a finalized block without hash, computing the hash locally..."); - block.seal_slow::() - } - })) - }.boxed(); - Some(StateMachine::Polling(static_fut)) + let future = self.provider.finalized().boxed(); + Some(StateMachine::Polling(future)) }, Poll::Pending => { self.state = Some(StateMachine::Wait(delay)); @@ -213,31 +198,24 @@ where ////////////////////////////////////////// StateMachine::Polling(mut fut) => match fut.poll_unpin(cx) { // Backend returned a new finalized block. - Poll::Ready(Ok(Some(new_block))) => { + Poll::Ready(Ok(block)) => { // Update last finalized block. - if self.statistics.on_finalized_block(new_block.header().header()) { - self.best_finalized_block = Some((new_block.clone(), Instant::now())); + if self.statistics.on_finalized_block(block.header().header()) { + self.best_finalized_block = Some((block.clone(), Instant::now())); self.state = Some(StateMachine::Wait(Delay::new( self.statistics.polling_interval, ))); - return Poll::Ready(Some(new_block)); + return Poll::Ready(Some(block.as_ref().clone())); } self.consecutive_errors = 0; Some(StateMachine::Wait(Delay::new(self.statistics.polling_interval))) }, - // Backend returned an empty finalized block, this should never happen. - Poll::Ready(Ok(None)) => { - self.consecutive_errors += 1; - tracing::error!("[report this bug] api returned empty for finalized block"); - Some(StateMachine::Wait(Delay::new(self.statistics.polling_interval))) - }, - // Backend returned an error, retry after delay. Poll::Ready(Err(err)) => { let delay = self.statistics.polling_interval; tracing::warn!( - "failed to retrieve finalized block, retrying in {delay:?}: {err}" + "failed to retrieve finalized block, retrying in {delay:?}: {err:?}" ); Some(StateMachine::Wait(Delay::new(delay))) }, @@ -256,7 +234,9 @@ where #[cfg(test)] mod tests { use super::*; - use crate::MaybeWsEthereumClient; + use crate::{ + block_provider::RpcBlockProvider, client::BlockFinalityStrategy, MaybeWsEthereumClient, + }; use futures_util::StreamExt; use rosetta_core::BlockchainConfig; use rosetta_docker::{run_test, Env}; @@ -280,7 +260,14 @@ mod tests { MaybeWsEthereumClient::Http(_) => panic!("the connections must be ws"), MaybeWsEthereumClient::Ws(client) => client.backend.clone(), }; - let mut sub = FinalizedBlockStream::new(client); + let provider = RpcBlockProvider::new( + client, + Duration::from_secs(1), + BlockFinalityStrategy::Finalized, + ) + .await + .unwrap(); + let mut sub = FinalizedBlockStream::new(provider); let mut last_block: Option = None; for _ in 0..30 { let Some(new_block) = sub.next().await else { diff --git a/chains/ethereum/server/src/lib.rs b/chains/ethereum/server/src/lib.rs index f9013e18..e0c37593 100644 --- a/chains/ethereum/server/src/lib.rs +++ b/chains/ethereum/server/src/lib.rs @@ -1,6 +1,5 @@ use anyhow::Result; -use block_stream::BlockStream; -pub use client::EthereumClient; +pub use client::{BlockStreamType, EthereumClient}; pub use rosetta_config_ethereum::{ EthereumMetadata, EthereumMetadataParams, Event, Query as EthQuery, QueryItem, QueryResult as EthQueryResult, SubmitResult, Subscription, @@ -10,10 +9,10 @@ use rosetta_core::{ types::{BlockIdentifier, PartialBlockIdentifier}, BlockchainClient, BlockchainConfig, }; -use rosetta_ethereum_backend::jsonrpsee::Adapter; use rosetta_server::ws::{default_client, default_http_client, DefaultClient, HttpClient}; use url::Url; +mod block_provider; mod block_stream; mod client; mod event_stream; @@ -113,7 +112,7 @@ impl MaybeWsEthereumClient { impl BlockchainClient for MaybeWsEthereumClient { type MetadataParams = EthereumMetadataParams; type Metadata = EthereumMetadata; - type EventStream<'a> = shared_stream::SharedStream>> where Self: 'a; + type EventStream<'a> = BlockStreamType where Self: 'a; type Call = EthQuery; type CallResult = EthQueryResult; diff --git a/chains/ethereum/server/src/log_filter.rs b/chains/ethereum/server/src/log_filter.rs index 54c6e7bd..1cc79241 100644 --- a/chains/ethereum/server/src/log_filter.rs +++ b/chains/ethereum/server/src/log_filter.rs @@ -54,8 +54,6 @@ impl LogFilter { #[cfg(test)] mod tests { use super::*; - // use hex_literal::hex; - // use rosetta_config_ethereum::ext::types::Bloom; #[test] fn add_remove_works() { @@ -71,33 +69,4 @@ mod tests { assert!(filter.remove(&address).is_none()); assert!(filter.is_empty()); } - - // #[test] - // fn filter_topics_works() { - // let mut filter = LogFilter::new(); - // let logs_bloom = - // Bloom::from(hex!(" - // 00000000000000000000000000000000000000000000020200040000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000002000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000200000000000000000" - // )); - - // // Empty filter - // let mut logs = filter.topics_from_bloom(logs_bloom); - // assert!(logs.next().is_none()); - // drop(logs); - - // let expect_address = Address::from(hex!("97be939b2eb5a462c634414c8134b09ebad04d83")); - // let expect_topics = [ - // H256(hex!("b7dbf4f78c37528484cb9761beaca968c613f3c6c534b25b1988b912413c68bc")), - // H256(hex!("fca76ae197bb7f913a92bd1f31cb362d0fdbf27b2cc56d8b9bc22d0d76c58dc8")), - // ]; - // filter.add(expect_address, expect_topics.into_iter()); - - // let mut logs = filter.topics_from_bloom(logs_bloom); - // let (address, mut topics) = logs.next().unwrap(); - // assert_eq!(address, expect_address); - // assert_eq!(topics.next().unwrap(), expect_topics[0]); - // assert_eq!(topics.next().unwrap(), expect_topics[1]); - // assert!(logs.next().is_none()); - // assert!(topics.next().is_none()); - // } } diff --git a/chains/ethereum/server/src/logs_stream.rs b/chains/ethereum/server/src/logs_stream.rs index 6533cb79..9d779ff1 100644 --- a/chains/ethereum/server/src/logs_stream.rs +++ b/chains/ethereum/server/src/logs_stream.rs @@ -4,7 +4,7 @@ use rosetta_ethereum_backend::{ jsonrpsee::core::client::{Error as RpcError, Subscription}, EthereumPubSub, EthereumRpc, }; -use rosetta_utils::jsonrpsee::{AutoSubscribe, CircuitBreaker, FutureFactory, PollingInterval}; +use rosetta_utils::{futures::FutureFactory, jsonrpsee::{AutoSubscribe, CircuitBreaker, PollingInterval}}; use std::{ mem, pin::Pin, diff --git a/chains/ethereum/server/src/multi_block.rs b/chains/ethereum/server/src/multi_block.rs index ef48e3a4..2eec2dd9 100644 --- a/chains/ethereum/server/src/multi_block.rs +++ b/chains/ethereum/server/src/multi_block.rs @@ -80,7 +80,7 @@ impl MultiBlock { (&self, &other), (Self::Partial(_), Self::Full(_)) | (Self::Header(_), Self::Full(_) | Self::Partial(_)) ); - if should_upgrade { + if should_upgrade && self.number() == other.number() && self.hash() == other.hash() { std::mem::replace(self, other) } else { other @@ -139,7 +139,7 @@ impl From

for MultiBlock { } // A reference to a block -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Default, Clone, Copy)] pub struct BlockRef { pub number: u64, pub hash: H256, diff --git a/chains/ethereum/server/src/new_heads.rs b/chains/ethereum/server/src/new_heads.rs index 080cbc42..876845d1 100644 --- a/chains/ethereum/server/src/new_heads.rs +++ b/chains/ethereum/server/src/new_heads.rs @@ -4,7 +4,10 @@ use rosetta_ethereum_backend::{ jsonrpsee::core::client::{Error as RpcError, Subscription}, EthereumPubSub, EthereumRpc, }; -use rosetta_utils::jsonrpsee::{AutoSubscribe, CircuitBreaker, FutureFactory, PollingInterval}; +use rosetta_utils::{ + futures::FutureFactory, + jsonrpsee::{AutoSubscribe, CircuitBreaker, PollingInterval}, +}; use std::{ mem, pin::Pin, @@ -37,7 +40,7 @@ where let block = if let Some(hash) = block.hash { block.seal(hash) } else { - tracing::warn!("[report this bug] the api returned the latest block without hash, computing block hash manually"); + tracing::error!("[report this bug] the api returned the latest block without hash, computing block hash manually"); block.seal_slow::() }; Ok(Some(block)) @@ -89,7 +92,7 @@ where + Send + Sync + 'static, - RPC::SubscriptionError: Send + Sync, + RPC::SubscriptionError: Send, { Subscription(AutoSubscribe, NewHeadsSubscriber>), Polling(CircuitBreaker>, ()>), @@ -103,7 +106,7 @@ where + Send + Sync + 'static, - RPC::SubscriptionError: Send + Sync, + RPC::SubscriptionError: Send, { #[must_use] pub const fn new(backend: RPC) -> Self { @@ -120,7 +123,7 @@ where + Send + Sync + 'static, - RPC::SubscriptionError: Send + Sync, + RPC::SubscriptionError: Send, { /// Subscription or Polling to new block headers. state: State, @@ -135,11 +138,10 @@ where impl NewHeadsStream where RPC: for<'s> EthereumPubSub = Subscription>> - + EthereumRpc + Send + Sync + 'static, - RPC::SubscriptionError: Send + Sync, + RPC::SubscriptionError: Send, { #[must_use] pub const fn new(backend: RPC) -> Self { @@ -150,11 +152,10 @@ where impl Stream for NewHeadsStream where RPC: for<'s> EthereumPubSub = Subscription>> - + EthereumRpc + Send + Sync + 'static, - RPC::SubscriptionError: Send + Sync, + RPC::SubscriptionError: Send, { type Item = PartialBlock; diff --git a/chains/ethereum/server/src/shared_stream.rs b/chains/ethereum/server/src/shared_stream.rs index ce68385d..9841b472 100644 --- a/chains/ethereum/server/src/shared_stream.rs +++ b/chains/ethereum/server/src/shared_stream.rs @@ -8,7 +8,7 @@ use tokio_stream::wrappers::{errors::BroadcastStreamRecvError, BroadcastStream}; pub struct SharedStream where - T: Stream + Unpin, + T: Stream + Unpin + 'static, T::Item: Clone + Send + Sync + 'static, { inner: Inner, diff --git a/rosetta-utils/Cargo.toml b/rosetta-utils/Cargo.toml index 028f86ff..c120a3fd 100644 --- a/rosetta-utils/Cargo.toml +++ b/rosetta-utils/Cargo.toml @@ -36,9 +36,15 @@ bytes = ["dep:bytes"] jsonrpsee = [ "std", "serde", + "futures", + "dep:jsonrpsee-core", + "dep:pin-project", + "dep:tracing", +] +futures = [ + "std", "dep:futures-util", "dep:futures-timer", - "dep:jsonrpsee-core", "dep:pin-project", "dep:tracing", ] diff --git a/rosetta-utils/src/fns.rs b/rosetta-utils/src/fns.rs new file mode 100644 index 00000000..d390b376 --- /dev/null +++ b/rosetta-utils/src/fns.rs @@ -0,0 +1,27 @@ +pub trait FnMut1 { + type Output; + fn call_mut(&mut self, arg: A) -> Self::Output; +} + +impl FnMut1 for T +where + T: FnMut(A) -> R, +{ + type Output = R; + fn call_mut(&mut self, arg: A) -> R { + self(arg) + } +} + +pub trait Fn1: FnMut1 { + fn call(&self, arg: A) -> Self::Output; +} + +impl Fn1 for T +where + T: Fn(A) -> R, +{ + fn call(&self, arg: A) -> R { + self(arg) + } +} diff --git a/rosetta-utils/src/futures.rs b/rosetta-utils/src/futures.rs new file mode 100644 index 00000000..5facab0a --- /dev/null +++ b/rosetta-utils/src/futures.rs @@ -0,0 +1,20 @@ +use futures_util::Future; + +pub trait FutureFactory: Send + 'static { + type Output: Send + Sync + 'static; + type Future<'a>: Future + Send; + fn new_future(&mut self) -> Self::Future<'_>; +} + +impl FutureFactory for F +where + R: Send + Sync + 'static, + for<'a> Fut: Future + Send + 'a, + F: FnMut() -> Fut + Send + Sync + 'static, +{ + type Output = ::Output; + type Future<'a> = Fut; + fn new_future(&mut self) -> Self::Future<'_> { + self() + } +} diff --git a/rosetta-utils/src/jsonrpsee.rs b/rosetta-utils/src/jsonrpsee.rs index cd91a563..2f9341c7 100644 --- a/rosetta-utils/src/jsonrpsee.rs +++ b/rosetta-utils/src/jsonrpsee.rs @@ -4,24 +4,4 @@ mod polling_interval; pub use auto_subscribe::AutoSubscribe; pub use circuit_breaker::{CircuitBreaker, ErrorHandler}; -use futures_util::Future; pub use polling_interval::PollingInterval; - -pub trait FutureFactory: Send + 'static { - type Output: Send + Sync + 'static; - type Future<'a>: Future + Send; - fn new_future(&mut self) -> Self::Future<'_>; -} - -impl FutureFactory for F -where - R: Send + Sync + 'static, - for<'a> Fut: Future + Send + 'a, - F: FnMut() -> Fut + Send + Sync + 'static, -{ - type Output = ::Output; - type Future<'a> = Fut; - fn new_future(&mut self) -> Self::Future<'_> { - self() - } -} diff --git a/rosetta-utils/src/jsonrpsee/auto_subscribe.rs b/rosetta-utils/src/jsonrpsee/auto_subscribe.rs index 7ef5c403..f2cca681 100644 --- a/rosetta-utils/src/jsonrpsee/auto_subscribe.rs +++ b/rosetta-utils/src/jsonrpsee/auto_subscribe.rs @@ -1,5 +1,5 @@ #![allow(clippy::option_if_let_else)] -use super::FutureFactory; +use crate::futures::FutureFactory; use futures_timer::Delay; use futures_util::{future::BoxFuture, FutureExt, Stream, StreamExt}; use jsonrpsee_core::client::{Error as RpcError, Subscription}; diff --git a/rosetta-utils/src/jsonrpsee/polling_interval.rs b/rosetta-utils/src/jsonrpsee/polling_interval.rs index c71ced42..0a1deea4 100644 --- a/rosetta-utils/src/jsonrpsee/polling_interval.rs +++ b/rosetta-utils/src/jsonrpsee/polling_interval.rs @@ -1,4 +1,4 @@ -use super::FutureFactory; +use crate::futures::FutureFactory; use futures_timer::Delay; use futures_util::{future::BoxFuture, FutureExt, Stream}; use pin_project::pin_project; diff --git a/rosetta-utils/src/lib.rs b/rosetta-utils/src/lib.rs index 8cb95dc3..56c0f3ff 100644 --- a/rosetta-utils/src/lib.rs +++ b/rosetta-utils/src/lib.rs @@ -1,6 +1,10 @@ #[cfg(feature = "std")] pub mod error; +#[cfg(feature = "futures")] +pub mod futures; #[cfg(feature = "jsonrpsee")] pub mod jsonrpsee; #[cfg(feature = "serde")] pub mod serde_utils; + +pub mod fns; diff --git a/scripts/check.sh b/scripts/check.sh index 59dc6eb9..f06be207 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -87,7 +87,7 @@ exec_cmd() { CLIPPY_FLAGS="-Dwarnings -Dclippy::unwrap_used -Dclippy::expect_used -Dclippy::nursery -Dclippy::pedantic -Aclippy::module_name_repetitions" if [[ "${RUN_FIX}" == "1" ]]; then exec_cmd 'format' 'cargo +nightly fmt --all && dprint fmt' - # exec_cmd 'clippy --fix' "cargo clippy --fix --allow-dirty --workspace --examples --tests --all-features --exclude playground -- ${CLIPPY_FLAGS}" + # exec_cmd 'clippy --fix' "cargo clippy --fix --allow-dirty --workspace --examples --tests --all-features -- ${CLIPPY_FLAGS}" fi exec_cmd 'shellcheck' 'shellcheck --enable=all --severity=style ./scripts/*.sh' exec_cmd 'cargo fmt' 'cargo +nightly fmt --all -- --check' @@ -113,7 +113,7 @@ exec_cmd 'cargo deny' 'cargo deny check' # exec_cmd 'clippy rosetta-server-ethereum' 'cargo clippy --locked -p rosetta-server-ethereum --examples --tests -- -Dwarnings -Dclippy::unwrap_used -Dclippy::expect_used -Dclippy::nursery -Dclippy::pedantic -Aclippy::module_name_repetitions' # exec_cmd 'clippy rosetta-server-polkadot' 'cargo clippy --locked -p rosetta-server-polkadot --examples --tests -- -Dwarnings -Dclippy::unwrap_used -Dclippy::expect_used -Dclippy::nursery -Dclippy::pedantic -Aclippy::module_name_repetitions' # exec_cmd 'clippy rosetta-client' 'cargo clippy --locked -p rosetta-client --examples --tests -- -Dwarnings -Dclippy::unwrap_used -Dclippy::expect_used -Dclippy::nursery -Dclippy::pedantic -Aclippy::module_name_repetitions' -exec_cmd 'clippy' "cargo clippy --locked --workspace --examples --tests --all-features --exclude playground -- ${CLIPPY_FLAGS}" +exec_cmd 'clippy' "cargo clippy --locked --workspace --examples --tests --all-features -- ${CLIPPY_FLAGS}" if [[ "${TEST_ETH_BACKEND}" == "1" ]]; then NAME='rosetta-ethereum-backend'