diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8f19505..0d9ca12 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,6 +15,7 @@ concurrency: env: CARGO_TERM_COLOR: always + POLKADOT_VERSION: polkadot-stable2506-2 jobs: cache-polkadot: @@ -65,6 +66,37 @@ jobs: run: | cd polkadot-sdk cargo install --path substrate/frame/revive/rpc --bin eth-rpc + + - name: Cache downloaded Polkadot binaries + id: cache-polkadot + uses: actions/cache@v3 + with: + path: | + ~/polkadot-cache/polkadot + ~/polkadot-cache/polkadot-execute-worker + ~/polkadot-cache/polkadot-prepare-worker + ~/polkadot-cache/polkadot-parachain + key: polkadot-downloaded-${{ matrix.os }}-${{ env.POLKADOT_VERSION }} + + - name: Download Polkadot binaries on macOS + if: matrix.os == 'macos-14' && steps.cache-polkadot.outputs.cache-hit != 'true' + run: | + mkdir -p ~/polkadot-cache + curl -sL https://github.com/paritytech/polkadot-sdk/releases/download/${{ env.POLKADOT_VERSION }}/polkadot-aarch64-apple-darwin -o ~/polkadot-cache/polkadot + curl -sL https://github.com/paritytech/polkadot-sdk/releases/download/${{ env.POLKADOT_VERSION }}/polkadot-execute-worker-aarch64-apple-darwin -o ~/polkadot-cache/polkadot-execute-worker + curl -sL https://github.com/paritytech/polkadot-sdk/releases/download/${{ env.POLKADOT_VERSION }}/polkadot-prepare-worker-aarch64-apple-darwin -o ~/polkadot-cache/polkadot-prepare-worker + curl -sL https://github.com/paritytech/polkadot-sdk/releases/download/${{ env.POLKADOT_VERSION }}/polkadot-parachain-aarch64-apple-darwin -o ~/polkadot-cache/polkadot-parachain + chmod +x ~/polkadot-cache/* + + - name: Download Polkadot binaries on Ubuntu + if: matrix.os == 'ubuntu-24.04' && steps.cache-polkadot.outputs.cache-hit != 'true' + run: | + mkdir -p ~/polkadot-cache + curl -sL https://github.com/paritytech/polkadot-sdk/releases/download/${{ env.POLKADOT_VERSION }}/polkadot -o ~/polkadot-cache/polkadot + curl -sL https://github.com/paritytech/polkadot-sdk/releases/download/${{ env.POLKADOT_VERSION }}/polkadot-execute-worker -o ~/polkadot-cache/polkadot-execute-worker + curl -sL https://github.com/paritytech/polkadot-sdk/releases/download/${{ env.POLKADOT_VERSION }}/polkadot-prepare-worker -o ~/polkadot-cache/polkadot-prepare-worker + curl -sL https://github.com/paritytech/polkadot-sdk/releases/download/${{ env.POLKADOT_VERSION }}/polkadot-parachain -o ~/polkadot-cache/polkadot-parachain + chmod +x ~/polkadot-cache/* ci: name: CI on ${{ matrix.os }} @@ -86,6 +118,24 @@ jobs: ~/.cargo/bin/eth-rpc key: polkadot-binaries-${{ matrix.os }}-${{ hashFiles('polkadot-sdk/.git') }} + - name: Restore downloaded Polkadot binaries from cache + uses: actions/cache@v3 + with: + path: | + ~/polkadot-cache/polkadot + ~/polkadot-cache/polkadot-execute-worker + ~/polkadot-cache/polkadot-prepare-worker + ~/polkadot-cache/polkadot-parachain + key: polkadot-downloaded-${{ matrix.os }}-${{ env.POLKADOT_VERSION }} + + - name: Install Polkadot binaries + run: | + sudo cp ~/polkadot-cache/polkadot /usr/local/bin/ + sudo cp ~/polkadot-cache/polkadot-execute-worker /usr/local/bin/ + sudo cp ~/polkadot-cache/polkadot-prepare-worker /usr/local/bin/ + sudo cp ~/polkadot-cache/polkadot-parachain /usr/local/bin/ + sudo chmod +x /usr/local/bin/polkadot* + - name: Setup Rust toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: @@ -170,6 +220,18 @@ jobs: - name: Check resolc version run: resolc --version + - name: Check polkadot version + run: polkadot --version + + - name: Check polkadot-parachain version + run: polkadot-parachain --version + + - name: Check polkadot-execute-worker version + run: polkadot-execute-worker --version + + - name: Check polkadot-prepare-worker version + run: polkadot-prepare-worker --version + - name: Test Formatting run: make format diff --git a/Cargo.lock b/Cargo.lock index aa09b1e..44029af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -286,7 +286,7 @@ checksum = "65f763621707fa09cece30b73ecc607eb43fd7a72451fe3b46f645b905086926" dependencies = [ "alloy-primitives", "alloy-sol-types", - "http", + "http 1.3.1", "serde", "serde_json", "thiserror 2.0.12", @@ -391,7 +391,7 @@ dependencies = [ "either", "futures", "futures-utils-wasm", - "lru", + "lru 0.13.0", "parking_lot", "pin-project", "reqwest", @@ -421,7 +421,7 @@ dependencies = [ "serde_json", "tokio", "tokio-stream", - "tower", + "tower 0.5.2", "tracing", "wasmtimer", ] @@ -433,7 +433,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f70d83b765fdc080dbcd4f4db70d8d23fe4761f2f02ebfa9146b833900634b4" dependencies = [ "alloy-rlp-derive", - "arrayvec", + "arrayvec 0.7.6", "bytes", ] @@ -468,7 +468,7 @@ dependencies = [ "serde_json", "tokio", "tokio-stream", - "tower", + "tower 0.5.2", "tracing", "url", "wasmtimer", @@ -679,7 +679,7 @@ dependencies = [ "serde_json", "thiserror 2.0.12", "tokio", - "tower", + "tower 0.5.2", "tracing", "url", "wasmtimer", @@ -695,7 +695,7 @@ dependencies = [ "alloy-transport", "reqwest", "serde_json", - "tower", + "tower 0.5.2", "tracing", "url", ] @@ -729,11 +729,11 @@ dependencies = [ "alloy-pubsub", "alloy-transport", "futures", - "http", - "rustls", + "http 1.3.1", + "rustls 0.23.27", "serde_json", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.26.2", "tracing", "ws_stream_wasm", ] @@ -746,7 +746,7 @@ checksum = "bada1fc392a33665de0dc50d401a3701b62583c655e3522a323490a5da016962" dependencies = [ "alloy-primitives", "alloy-rlp", - "arrayvec", + "arrayvec 0.7.6", "derive_more 2.0.1", "nybbles", "serde", @@ -971,7 +971,7 @@ dependencies = [ "ark-ff-macros 0.5.0", "ark-serialize 0.5.0", "ark-std 0.5.0", - "arrayvec", + "arrayvec 0.7.6", "digest 0.10.7", "educe", "itertools 0.13.0", @@ -1107,7 +1107,7 @@ checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" dependencies = [ "ark-serialize-derive 0.5.0", "ark-std 0.5.0", - "arrayvec", + "arrayvec 0.7.6", "digest 0.10.7", "num-bigint", ] @@ -1209,6 +1209,15 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" +[[package]] +name = "arrayvec" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +dependencies = [ + "nodrop", +] + [[package]] name = "arrayvec" version = "0.7.6" @@ -1255,6 +1264,17 @@ dependencies = [ "slab", ] +[[package]] +name = "async-fs" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5" +dependencies = [ + "async-lock", + "blocking", + "futures-lite", +] + [[package]] name = "async-global-executor" version = "2.4.1" @@ -1300,6 +1320,17 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "async-net" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" +dependencies = [ + "async-io", + "blocking", + "futures-lite", +] + [[package]] name = "async-process" version = "2.4.0" @@ -1413,6 +1444,12 @@ dependencies = [ "rustc_version 0.4.1", ] +[[package]] +name = "atomic-take" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8ab6b55fe97976e46f91ddbed8d147d966475dc29b2032757ba47e02376fbc3" + [[package]] name = "atomic-waker" version = "1.1.2" @@ -1436,6 +1473,17 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "backoff" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" +dependencies = [ + "getrandom 0.2.16", + "instant", + "rand 0.8.5", +] + [[package]] name = "backtrace" version = "0.3.75" @@ -1451,12 +1499,34 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + [[package]] name = "base16ct" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "base256emoji" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e9430d9a245a77c92176e649af6e275f20839a48389859d1661e9a128d077c" +dependencies = [ + "const-str", + "match-lookup", +] + +[[package]] +name = "base58" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" + [[package]] name = "base64" version = "0.21.7" @@ -1492,6 +1562,17 @@ dependencies = [ "parity-scale-codec", ] +[[package]] +name = "bip39" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d193de1f7487df1914d3a568b772458861d33f9c54249612cc2893d6915054" +dependencies = [ + "bitcoin_hashes 0.13.0", + "serde", + "unicode-normalization", +] + [[package]] name = "bit-set" version = "0.8.0" @@ -1572,6 +1653,16 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "blake2-rfc" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" +dependencies = [ + "arrayvec 0.4.12", + "constant_time_eq 0.1.5", +] + [[package]] name = "blake2b_simd" version = "1.0.3" @@ -1579,8 +1670,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06e903a20b159e944f91ec8499fe1e55651480c541ea0a584f5d967c49ad9d99" dependencies = [ "arrayref", - "arrayvec", - "constant_time_eq", + "arrayvec 0.7.6", + "constant_time_eq 0.3.1", ] [[package]] @@ -1747,12 +1838,35 @@ dependencies = [ "shlex", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chacha20" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "chrono" version = "0.4.41" @@ -1766,6 +1880,17 @@ dependencies = [ "windows-link", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", + "zeroize", +] + [[package]] name = "clap" version = "4.5.39" @@ -1812,6 +1937,16 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "common-path" version = "1.0.0" @@ -1846,6 +1981,12 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const-str" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f421161cb492475f1661ddc9815a745a1c894592070661180fdec3d4872e9c3" + [[package]] name = "const_format" version = "0.2.34" @@ -1866,12 +2007,27 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + [[package]] name = "constant_time_eq" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" +[[package]] +name = "convert_case" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb402b8d4c85569410425650ce3eddc7d698ed96d39a73f941b08fb63082f1e7" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -1882,12 +2038,31 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + [[package]] name = "cpufeatures" version = "0.2.17" @@ -1912,6 +2087,15 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + [[package]] name = "crossbeam-channel" version = "0.5.15" @@ -1940,6 +2124,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.21" @@ -1985,6 +2178,21 @@ dependencies = [ "subtle", ] +[[package]] +name = "crypto_secretbox" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d6cf87adf719ddf43a805e92c6870a531aedda35ff640442cbaf8674e141e1" +dependencies = [ + "aead", + "cipher", + "generic-array", + "poly1305", + "salsa20", + "subtle", + "zeroize", +] + [[package]] name = "curve25519-dalek" version = "4.1.3" @@ -2103,6 +2311,26 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" +[[package]] +name = "data-encoding-macro" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47ce6c96ea0102f01122a185683611bd5ac8d99e62bc59dd12e6bda344ee673d" +dependencies = [ + "data-encoding", + "data-encoding-macro-internal", +] + +[[package]] +name = "data-encoding-macro-internal" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d162beedaa69905488a8da94f5ac3edb4dd4788b732fadb7bd120b2625c1976" +dependencies = [ + "data-encoding", + "syn 1.0.109", +] + [[package]] name = "der" version = "0.7.10" @@ -2145,6 +2373,17 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "derive-where" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef941ded77d15ca19b40374869ac6000af1c9f2a4c0f3d4c70926287e6364a8f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "derive_more" version = "1.0.0" @@ -2180,6 +2419,7 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ + "convert_case", "proc-macro2", "quote", "syn 2.0.101", @@ -2251,6 +2491,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + [[package]] name = "dunce" version = "1.0.5" @@ -2472,6 +2718,17 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "fancy-regex" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" +dependencies = [ + "bit-set", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + [[package]] name = "fastrand" version = "2.3.0" @@ -2484,7 +2741,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" dependencies = [ - "arrayvec", + "arrayvec 0.7.6", "auto_impl", "bytes", ] @@ -2495,7 +2752,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" dependencies = [ - "arrayvec", + "arrayvec 0.7.6", "auto_impl", "bytes", ] @@ -2526,6 +2783,18 @@ dependencies = [ "winapi", ] +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -2538,6 +2807,16 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "flate2" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc5a4e564e38c699f2880d3fda590bedc2e69f3f84cd48b457bd892ce61d0aa9" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "fnv" version = "1.0.7" @@ -2634,6 +2913,32 @@ dependencies = [ "thiserror 2.0.12", ] +[[package]] +name = "frame-decode" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e56c0e51972d7b26ff76966c4d0f2307030df9daa5ce0885149ece1ab7ca5ad" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-decode", + "scale-info", + "scale-type-resolver", + "sp-crypto-hashing", +] + +[[package]] +name = "frame-metadata" +version = "23.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8c26fcb0454397c522c05fdad5380c4e622f8a875638af33bff5a320d1fc965" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", + "serde", +] + [[package]] name = "fs-err" version = "2.11.0" @@ -2734,6 +3039,12 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +[[package]] +name = "futures-timer" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" + [[package]] name = "futures-util" version = "0.3.31" @@ -2832,6 +3143,12 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" +[[package]] +name = "glob-match" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985c9503b412198aa4197559e9a318524ebc4519c229bfa05a535828c950b9d" + [[package]] name = "gloo-timers" version = "0.3.0" @@ -2866,7 +3183,7 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http", + "http 1.3.1", "indexmap 2.10.0", "slab", "tokio", @@ -2965,7 +3282,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" dependencies = [ - "arrayvec", + "arrayvec 0.7.6", +] + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac 0.12.1", ] [[package]] @@ -2998,6 +3324,26 @@ dependencies = [ "hmac 0.8.1", ] +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http" version = "1.3.1" @@ -3009,6 +3355,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + [[package]] name = "http-body" version = "1.0.1" @@ -3016,7 +3373,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http", + "http 1.3.1", ] [[package]] @@ -3027,17 +3384,52 @@ checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", "futures-core", - "http", - "http-body", + "http 1.3.1", + "http-body 1.0.1", "pin-project-lite", ] +[[package]] +name = "http-range-header" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" + [[package]] name = "httparse" version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.5.10", + "tokio", + "tower-service", + "tracing", + "want", +] + [[package]] name = "hyper" version = "1.6.0" @@ -3048,8 +3440,8 @@ dependencies = [ "futures-channel", "futures-util", "h2", - "http", - "http-body", + "http 1.3.1", + "http-body 1.0.1", "httparse", "itoa", "pin-project-lite", @@ -3058,22 +3450,50 @@ dependencies = [ "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.32", + "log", + "rustls 0.21.12", + "rustls-native-certs 0.6.3", + "tokio", + "tokio-rustls 0.24.1", +] + [[package]] name = "hyper-rustls" version = "0.27.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a01595e11bdcec50946522c32dde3fc6914743000a68b93000965f2f02406d" dependencies = [ - "http", - "hyper", + "http 1.3.1", + "hyper 1.6.0", "hyper-util", - "rustls", + "rustls 0.23.27", "rustls-pki-types", "tokio", - "tokio-rustls", + "tokio-rustls 0.26.2", "tower-service", ] +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper 0.14.32", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + [[package]] name = "hyper-tls" version = "0.6.0" @@ -3082,7 +3502,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper", + "hyper 1.6.0", "hyper-util", "native-tls", "tokio", @@ -3101,9 +3521,9 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "http", - "http-body", - "hyper", + "http 1.3.1", + "http-body 1.0.1", + "hyper 1.6.0", "ipnet", "libc", "percent-encoding", @@ -3324,6 +3744,24 @@ dependencies = [ "serde", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + [[package]] name = "integer-sqrt" version = "0.1.5" @@ -3423,6 +3861,28 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "js-sys" version = "0.3.77" @@ -3433,6 +3893,110 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json-patch" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec9ad60d674508f3ca8f380a928cfe7b096bc729c4e2dbfe3852bc45da3ab30b" +dependencies = [ + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "jsonpath-rust" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06cc127b7c3d270be504572364f9569761a180b981919dd0d87693a7f5fb7829" +dependencies = [ + "pest", + "pest_derive", + "regex", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "jsonrpsee" +version = "0.24.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b26c20e2178756451cfeb0661fb74c47dd5988cb7e3939de7e9241fd604d42" +dependencies = [ + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", + "jsonrpsee-ws-client", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.24.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bacb85abf4117092455e1573625e21b8f8ef4dec8aff13361140b2dc266cdff2" +dependencies = [ + "base64 0.22.1", + "futures-util", + "http 1.3.1", + "jsonrpsee-core", + "pin-project", + "rustls 0.23.27", + "rustls-pki-types", + "rustls-platform-verifier", + "soketto", + "thiserror 1.0.69", + "tokio", + "tokio-rustls 0.26.2", + "tokio-util", + "tracing", + "url", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.24.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456196007ca3a14db478346f58c7238028d55ee15c1df15115596e411ff27925" +dependencies = [ + "async-trait", + "futures-timer", + "futures-util", + "jsonrpsee-types", + "pin-project", + "rustc-hash", + "serde", + "serde_json", + "thiserror 1.0.69", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.24.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08a8e70baf945b6b5752fc8eb38c918a48f1234daf11355e07106d963f860089" +dependencies = [ + "http 1.3.1", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.24.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01b3323d890aa384f12148e8d2a1fd18eb66e9e7e825f9de4fa53bcc19b93eef" +dependencies = [ + "http 1.3.1", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", + "url", +] + [[package]] name = "k256" version = "0.13.4" @@ -3447,6 +4011,20 @@ dependencies = [ "sha2 0.10.9", ] +[[package]] +name = "k8s-openapi" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edc3606fd16aca7989db2f84bb25684d0270c6d6fa1dbcd0025af7b4130523a6" +dependencies = [ + "base64 0.21.7", + "bytes", + "chrono", + "serde", + "serde-value", + "serde_json", +] + [[package]] name = "keccak" version = "0.1.5" @@ -3466,6 +4044,109 @@ dependencies = [ "sha3-asm", ] +[[package]] +name = "keccak-hash" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e1b8590eb6148af2ea2d75f38e7d29f5ca970d5a4df456b3ef19b8b415d0264" +dependencies = [ + "primitive-types 0.13.1", + "tiny-keccak", +] + +[[package]] +name = "kube" +version = "0.87.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3499c8d60c763246c7a213f51caac1e9033f46026904cb89bc8951ae8601f26e" +dependencies = [ + "k8s-openapi", + "kube-client", + "kube-core", + "kube-runtime", +] + +[[package]] +name = "kube-client" +version = "0.87.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "033450dfa0762130565890dadf2f8835faedf749376ca13345bcd8ecd6b5f29f" +dependencies = [ + "base64 0.21.7", + "bytes", + "chrono", + "either", + "futures", + "home", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.32", + "hyper-rustls 0.24.2", + "hyper-timeout", + "jsonpath-rust", + "k8s-openapi", + "kube-core", + "pem", + "pin-project", + "rand 0.8.5", + "rustls 0.21.12", + "rustls-pemfile", + "secrecy 0.8.0", + "serde", + "serde_json", + "serde_yaml", + "thiserror 1.0.69", + "tokio", + "tokio-tungstenite 0.20.1", + "tokio-util", + "tower 0.4.13", + "tower-http 0.4.4", + "tracing", +] + +[[package]] +name = "kube-core" +version = "0.87.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5bba93d054786eba7994d03ce522f368ef7d48c88a1826faa28478d85fb63ae" +dependencies = [ + "chrono", + "form_urlencoded", + "http 0.2.12", + "json-patch", + "k8s-openapi", + "once_cell", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "kube-runtime" +version = "0.87.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d8893eb18fbf6bb6c80ef6ee7dd11ec32b1dc3c034c988ac1b3a84d46a230ae" +dependencies = [ + "ahash", + "async-trait", + "backoff", + "derivative", + "futures", + "hashbrown 0.14.5", + "json-patch", + "k8s-openapi", + "kube-client", + "parking_lot", + "pin-project", + "serde", + "serde_json", + "smallvec", + "thiserror 1.0.69", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "kv-log-macro" version = "1.0.7" @@ -3493,6 +4174,131 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" +[[package]] +name = "libp2p" +version = "0.54.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbe80f9c7e00526cd6b838075b9c171919404a4732cb2fa8ece0a093223bfc4" +dependencies = [ + "bytes", + "either", + "futures", + "futures-timer", + "getrandom 0.2.16", + "libp2p-allow-block-list", + "libp2p-connection-limits", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "multiaddr", + "pin-project", + "rw-stream-sink", + "thiserror 1.0.69", +] + +[[package]] +name = "libp2p-allow-block-list" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1027ccf8d70320ed77e984f273bc8ce952f623762cb9bf2d126df73caef8041" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] + +[[package]] +name = "libp2p-connection-limits" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d003540ee8baef0d254f7b6bfd79bac3ddf774662ca0abf69186d517ef82ad8" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] + +[[package]] +name = "libp2p-core" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a61f26c83ed111104cd820fe9bc3aaabbac5f1652a1d213ed6e900b7918a1298" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "libp2p-identity", + "multiaddr", + "multihash", + "multistream-select", + "once_cell", + "parking_lot", + "pin-project", + "quick-protobuf", + "rand 0.8.5", + "rw-stream-sink", + "smallvec", + "thiserror 1.0.69", + "tracing", + "unsigned-varint 0.8.0", + "void", + "web-time", +] + +[[package]] +name = "libp2p-identity" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3104e13b51e4711ff5738caa1fb54467c8604c2e94d607e27745bcf709068774" +dependencies = [ + "bs58", + "ed25519-dalek", + "hkdf", + "multihash", + "quick-protobuf", + "rand 0.8.5", + "sha2 0.10.9", + "thiserror 2.0.12", + "tracing", + "zeroize", +] + +[[package]] +name = "libp2p-swarm" +version = "0.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7dd6741793d2c1fb2088f67f82cf07261f25272ebe3c0b0c311e0c6b50e851a" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "libp2p-core", + "libp2p-identity", + "lru 0.12.5", + "multistream-select", + "once_cell", + "rand 0.8.5", + "smallvec", + "tracing", + "void", + "web-time", +] + +[[package]] +name = "libredox" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4488594b9328dee448adb906d8b126d9b7deb7cf5c22161ee591610bb1be83c0" +dependencies = [ + "bitflags 2.9.1", + "libc", + "redox_syscall", +] + [[package]] name = "libsecp256k1" version = "0.7.2" @@ -3585,6 +4391,15 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown 0.15.3", +] + [[package]] name = "lru" version = "0.13.0" @@ -3605,6 +4420,17 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "match-lookup" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1265724d8cb29dbbc2b0f06fffb8bf1a8c0cf73a78eede9ba73a4a66c52a981e" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "matchers" version = "0.1.0" @@ -3686,6 +4512,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", + "simd-adler32", ] [[package]] @@ -3718,6 +4545,67 @@ dependencies = [ "uuid", ] +[[package]] +name = "multi-stash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f" + +[[package]] +name = "multiaddr" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe6351f60b488e04c1d21bc69e56b89cb3f5e8f5d22557d6e8031bdfd79b6961" +dependencies = [ + "arrayref", + "byteorder", + "data-encoding", + "libp2p-identity", + "multibase", + "multihash", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint 0.8.0", + "url", +] + +[[package]] +name = "multibase" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8694bb4835f452b0e3bb06dbebb1d6fc5385b6ca1caf2e55fd165c042390ec77" +dependencies = [ + "base-x", + "base256emoji", + "data-encoding", + "data-encoding-macro", +] + +[[package]] +name = "multihash" +version = "0.19.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b430e7953c29dd6a09afc29ff0bb69c6e306329ee6794700aee27b76a1aea8d" +dependencies = [ + "core2", + "unsigned-varint 0.8.0", +] + +[[package]] +name = "multistream-select" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea0df8e5eec2298a62b326ee4f0d7fe1a6b90a09dfcf9df37b38f947a8c42f19" +dependencies = [ + "bytes", + "futures", + "log", + "pin-project", + "smallvec", + "unsigned-varint 0.7.2", +] + [[package]] name = "native-tls" version = "0.2.14" @@ -3730,17 +4618,44 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "tempfile", ] +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.9.1", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + [[package]] name = "nohash-hasher" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" +[[package]] +name = "nom" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" +dependencies = [ + "memchr", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -3773,7 +4688,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" dependencies = [ - "arrayvec", + "arrayvec 0.7.6", "itoa", ] @@ -3786,6 +4701,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -3911,6 +4837,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "ordered-float" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits", +] + [[package]] name = "overload" version = "0.1.1" @@ -3936,7 +4871,7 @@ version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" dependencies = [ - "arrayvec", + "arrayvec 0.7.6", "bitvec", "byte-slice-cast", "bytes", @@ -4018,9 +4953,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", + "hmac 0.12.1", "password-hash", ] +[[package]] +name = "pem" +version = "3.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3" +dependencies = [ + "base64 0.22.1", + "serde", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -4038,6 +4984,40 @@ dependencies = [ "ucd-trie", ] +[[package]] +name = "pest_derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "pest_meta" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" +dependencies = [ + "once_cell", + "pest", + "sha2 0.10.9", +] + [[package]] name = "pharos" version = "0.5.3" @@ -4159,6 +5139,17 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] + [[package]] name = "portable-atomic" version = "1.11.1" @@ -4299,6 +5290,15 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quick-protobuf" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +dependencies = [ + "byteorder", +] + [[package]] name = "quote" version = "1.0.40" @@ -4513,11 +5513,11 @@ dependencies = [ "encoding_rs", "futures-core", "h2", - "http", - "http-body", + "http 1.3.1", + "http-body 1.0.1", "http-body-util", - "hyper", - "hyper-rustls", + "hyper 1.6.0", + "hyper-rustls 0.27.6", "hyper-tls", "hyper-util", "ipnet", @@ -4535,8 +5535,8 @@ dependencies = [ "sync_wrapper", "tokio", "tokio-native-tls", - "tower", - "tower-http", + "tower 0.5.2", + "tower-http 0.6.4", "tower-service", "url", "wasm-bindgen", @@ -4672,8 +5672,9 @@ dependencies = [ "sp-runtime", "temp-dir", "tokio", - "tower", + "tower 0.5.2", "tracing", + "zombienet-sdk", ] [[package]] @@ -4854,20 +5855,66 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring", + "rustls-webpki 0.101.7", + "sct", +] + [[package]] name = "rustls" version = "0.23.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "730944ca083c1c233a75c09f199e973ca499344a2b7ba9e755c457e86fb4a321" dependencies = [ + "log", "once_cell", "ring", "rustls-pki-types", - "rustls-webpki", + "rustls-webpki 0.103.3", "subtle", "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework 2.11.1", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework 3.3.0", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + [[package]] name = "rustls-pki-types" version = "1.12.0" @@ -4877,6 +5924,43 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-platform-verifier" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19787cda76408ec5404443dc8b31795c87cd8fec49762dc75fa727740d34acc1" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls 0.23.27", + "rustls-native-certs 0.8.1", + "rustls-platform-verifier-android", + "rustls-webpki 0.103.3", + "security-framework 3.3.0", + "security-framework-sys", + "webpki-root-certs 0.26.11", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "rustls-webpki" version = "0.103.3" @@ -4906,12 +5990,38 @@ dependencies = [ "wait-timeout", ] +[[package]] +name = "ruzstd" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3640bec8aad418d7d03c72ea2de10d5c646a598f9883c7babc160d91e3c1b26c" + +[[package]] +name = "rw-stream-sink" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8c9026ff5d2f23da5e45bbc283f156383001bfb09c4e44256d02c1a685fe9a1" +dependencies = [ + "futures", + "pin-project", + "static_assertions", +] + [[package]] name = "ryu" version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher", +] + [[package]] name = "same-file" version = "1.0.6" @@ -4921,6 +6031,73 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scale-bits" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27243ab0d2d6235072b017839c5f0cd1a3b1ce45c0f7a715363b0c7d36c76c94" +dependencies = [ + "parity-scale-codec", + "scale-info", + "scale-type-resolver", + "serde", +] + +[[package]] +name = "scale-decode" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d78196772d25b90a98046794ce0fe2588b39ebdfbdc1e45b4c6c85dd43bebad" +dependencies = [ + "parity-scale-codec", + "primitive-types 0.13.1", + "scale-bits", + "scale-decode-derive", + "scale-type-resolver", + "smallvec", + "thiserror 2.0.12", +] + +[[package]] +name = "scale-decode-derive" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4b54a1211260718b92832b661025d1f1a4b6930fbadd6908e00edd265fa5f7" +dependencies = [ + "darling 0.20.11", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "scale-encode" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64901733157f9d25ef86843bd783eda439fac7efb0ad5a615d12d2cf3a29464b" +dependencies = [ + "parity-scale-codec", + "primitive-types 0.13.1", + "scale-bits", + "scale-encode-derive", + "scale-type-resolver", + "smallvec", + "thiserror 2.0.12", +] + +[[package]] +name = "scale-encode-derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78a3993a13b4eafa89350604672c8757b7ea84c7c5947d4b3691e3169c96379b" +dependencies = [ + "darling 0.20.11", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "scale-info" version = "2.11.6" @@ -4947,6 +6124,48 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "scale-type-resolver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0cded6518aa0bd6c1be2b88ac81bf7044992f0f154bfbabd5ad34f43512abcb" +dependencies = [ + "scale-info", + "smallvec", +] + +[[package]] +name = "scale-typegen" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c61b6b706a3eaad63b506ab50a1d2319f817ae01cf753adcc3f055f9f0fcd6" +dependencies = [ + "proc-macro2", + "quote", + "scale-info", + "syn 2.0.101", + "thiserror 2.0.12", +] + +[[package]] +name = "scale-value" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca8b26b451ecb7fd7b62b259fa28add63d12ec49bbcac0e01fcb4b5ae0c09aa" +dependencies = [ + "base58", + "blake2", + "either", + "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-encode", + "scale-type-resolver", + "serde", + "thiserror 2.0.12", + "yap", +] + [[package]] name = "schannel" version = "0.1.27" @@ -5013,7 +6232,7 @@ checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" dependencies = [ "aead", "arrayref", - "arrayvec", + "arrayvec 0.7.6", "curve25519-dalek", "getrandom_or_panic", "merlin", @@ -5036,6 +6255,28 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "scrypt" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" +dependencies = [ + "password-hash", + "pbkdf2", + "salsa20", + "sha2 0.10.9", +] + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "sec1" version = "0.7.3" @@ -5095,6 +6336,16 @@ name = "secrecy" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "serde", + "zeroize", +] + +[[package]] +name = "secrecy" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a" dependencies = [ "zeroize", ] @@ -5106,7 +6357,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags 2.9.1", - "core-foundation", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80fb1d92c5028aa318b4b8bd7302a5bfcf48be96a37fc6fc790f806b0004ee0c" +dependencies = [ + "bitflags 2.9.1", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -5165,6 +6429,16 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float", + "serde", +] + [[package]] name = "serde_bytes" version = "0.11.17" @@ -5281,6 +6555,19 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.10.0", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "serde_yaml_ng" version = "0.10.0" @@ -5404,12 +6691,24 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "simple-mermaid" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "620a1d43d70e142b1d46a929af51d44f383db9c7a2ec122de2cd992ccfcf3c18" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "slab" version = "0.4.9" @@ -5428,6 +6727,113 @@ dependencies = [ "serde", ] +[[package]] +name = "smol" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33bd3e260892199c3ccfc487c88b2da2265080acb316cd920da72fdfd7c599f" +dependencies = [ + "async-channel 2.5.0", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-net", + "async-process", + "blocking", + "futures-lite", +] + +[[package]] +name = "smoldot" +version = "0.19.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16e5723359f0048bf64bfdfba64e5732a56847d42c4fd3fe56f18280c813413" +dependencies = [ + "arrayvec 0.7.6", + "async-lock", + "atomic-take", + "base64 0.22.1", + "bip39", + "blake2-rfc", + "bs58", + "chacha20", + "crossbeam-queue", + "derive_more 2.0.1", + "ed25519-zebra", + "either", + "event-listener 5.4.1", + "fnv", + "futures-lite", + "futures-util", + "hashbrown 0.15.3", + "hex", + "hmac 0.12.1", + "itertools 0.14.0", + "libm", + "libsecp256k1", + "merlin", + "nom", + "num-bigint", + "num-rational", + "num-traits", + "pbkdf2", + "pin-project", + "poly1305", + "rand 0.8.5", + "rand_chacha 0.3.1", + "ruzstd", + "schnorrkel", + "serde", + "serde_json", + "sha2 0.10.9", + "sha3", + "siphasher", + "slab", + "smallvec", + "soketto", + "twox-hash 2.1.2", + "wasmi", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "smoldot-light" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bba9e591716567d704a8252feeb2f1261a286e1e2cbdd4e49e9197c34a14e2" +dependencies = [ + "async-channel 2.5.0", + "async-lock", + "base64 0.22.1", + "blake2-rfc", + "bs58", + "derive_more 2.0.1", + "either", + "event-listener 5.4.1", + "fnv", + "futures-channel", + "futures-lite", + "futures-util", + "hashbrown 0.15.3", + "hex", + "itertools 0.14.0", + "log", + "lru 0.12.5", + "parking_lot", + "pin-project", + "rand 0.8.5", + "rand_chacha 0.3.1", + "serde", + "serde_json", + "siphasher", + "slab", + "smol", + "smoldot", + "zeroize", +] + [[package]] name = "socket2" version = "0.5.10" @@ -5448,6 +6854,21 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "soketto" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e859df029d160cb88608f5d7df7fb4753fd20fdfb4de5644f3d8b8440841721" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures", + "httparse", + "log", + "rand 0.8.5", + "sha1", +] + [[package]] name = "sp-application-crypto" version = "40.1.0" @@ -5508,7 +6929,7 @@ dependencies = [ "scale-info", "schnorrkel", "secp256k1 0.28.2", - "secrecy", + "secrecy 0.8.0", "serde", "sp-crypto-hashing", "sp-debug-derive", @@ -5535,7 +6956,7 @@ dependencies = [ "digest 0.10.7", "sha2 0.10.9", "sha3", - "twox-hash", + "twox-hash 1.6.3", ] [[package]] @@ -5775,6 +7196,12 @@ dependencies = [ "sp-debug-derive", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "spki" version = "0.7.3" @@ -5889,6 +7316,202 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "subxt" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74791ddeaaa6de42e7cc8a715c83eb73303f513f90af701fd07eb2caad92ed84" +dependencies = [ + "async-trait", + "derive-where", + "either", + "frame-metadata", + "futures", + "hex", + "jsonrpsee", + "parity-scale-codec", + "primitive-types 0.13.1", + "scale-bits", + "scale-decode", + "scale-encode", + "scale-info", + "scale-value", + "serde", + "serde_json", + "sp-crypto-hashing", + "subxt-core", + "subxt-lightclient", + "subxt-macro", + "subxt-metadata", + "subxt-rpcs", + "thiserror 2.0.12", + "tokio", + "tokio-util", + "tracing", + "url", + "wasm-bindgen-futures", + "web-time", +] + +[[package]] +name = "subxt-codegen" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1728caecd9700391e78cc30dc298221d6f5ca0ea28258a452aa76b0b7c229842" +dependencies = [ + "heck", + "parity-scale-codec", + "proc-macro2", + "quote", + "scale-info", + "scale-typegen", + "subxt-metadata", + "syn 2.0.101", + "thiserror 2.0.12", +] + +[[package]] +name = "subxt-core" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25338dd11ae34293b8d0c5807064f2e00194ba1bd84cccfa694030c8d185b941" +dependencies = [ + "base58", + "blake2", + "derive-where", + "frame-decode", + "frame-metadata", + "hashbrown 0.14.5", + "hex", + "impl-serde", + "keccak-hash", + "parity-scale-codec", + "primitive-types 0.13.1", + "scale-bits", + "scale-decode", + "scale-encode", + "scale-info", + "scale-value", + "serde", + "serde_json", + "sp-crypto-hashing", + "subxt-metadata", + "thiserror 2.0.12", + "tracing", +] + +[[package]] +name = "subxt-lightclient" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9097ef356e534ce0b6a50b95233512afc394347b971a4f929c4830adc52bbc6f" +dependencies = [ + "futures", + "futures-util", + "serde", + "serde_json", + "smoldot-light", + "thiserror 2.0.12", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "subxt-macro" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69516e8ff0e9340a0f21b8398da7f997571af4734ee81deada5150a2668c8443" +dependencies = [ + "darling 0.20.11", + "parity-scale-codec", + "proc-macro-error2", + "quote", + "scale-typegen", + "subxt-codegen", + "subxt-metadata", + "subxt-utils-fetchmetadata", + "syn 2.0.101", +] + +[[package]] +name = "subxt-metadata" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c134068711c0c46906abc0e6e4911204420331530738e18ca903a5469364d9f" +dependencies = [ + "frame-decode", + "frame-metadata", + "hashbrown 0.14.5", + "parity-scale-codec", + "scale-info", + "sp-crypto-hashing", + "thiserror 2.0.12", +] + +[[package]] +name = "subxt-rpcs" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25de7727144780d780a6a7d78bbfd28414b8adbab68b05e87329c367d7705be4" +dependencies = [ + "derive-where", + "frame-metadata", + "futures", + "hex", + "impl-serde", + "jsonrpsee", + "parity-scale-codec", + "primitive-types 0.13.1", + "serde", + "serde_json", + "subxt-core", + "subxt-lightclient", + "thiserror 2.0.12", + "tokio-util", + "tracing", + "url", +] + +[[package]] +name = "subxt-signer" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a9bd240ae819f64ac6898d7ec99a88c8b838dba2fb9d83b843feb70e77e34c8" +dependencies = [ + "base64 0.22.1", + "bip39", + "cfg-if", + "crypto_secretbox", + "hex", + "hmac 0.12.1", + "parity-scale-codec", + "pbkdf2", + "regex", + "schnorrkel", + "scrypt", + "secp256k1 0.30.0", + "secrecy 0.10.3", + "serde", + "serde_json", + "sha2 0.10.9", + "sp-crypto-hashing", + "subxt-core", + "thiserror 2.0.12", + "zeroize", +] + +[[package]] +name = "subxt-utils-fetchmetadata" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c4fb8fd6b16ecd3537a29d70699f329a68c1e47f70ed1a46d64f76719146563" +dependencies = [ + "hex", + "parity-scale-codec", + "thiserror 2.0.12", +] + [[package]] name = "syn" version = "1.0.109" @@ -5950,7 +7573,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.9.1", - "core-foundation", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -5976,6 +7599,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "tar" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "temp-dir" version = "0.1.16" @@ -6139,6 +7773,7 @@ dependencies = [ "io-uring", "libc", "mio", + "parking_lot", "pin-project-lite", "signal-hook-registry", "slab", @@ -6147,6 +7782,16 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "tokio-io-timeout" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bd86198d9ee903fedd2f9a2e72014287c0d9167e4ae43b5853007205dda1b76" +dependencies = [ + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-macros" version = "2.5.0" @@ -6168,13 +7813,23 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.12", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" dependencies = [ - "rustls", + "rustls 0.23.27", "tokio", ] @@ -6190,6 +7845,18 @@ dependencies = [ "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", + "tokio", + "tungstenite 0.20.1", +] + [[package]] name = "tokio-tungstenite" version = "0.26.2" @@ -6198,11 +7865,11 @@ checksum = "7a9daff607c6d2bf6c16fd681ccb7eecc83e4e2cdc1ca067ffaadfca5de7f084" dependencies = [ "futures-util", "log", - "rustls", + "rustls 0.23.27", "rustls-pki-types", "tokio", - "tokio-rustls", - "tungstenite", + "tokio-rustls 0.26.2", + "tungstenite 0.26.2", "webpki-roots 0.26.11", ] @@ -6214,8 +7881,10 @@ checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" dependencies = [ "bytes", "futures-core", + "futures-io", "futures-sink", "pin-project-lite", + "slab", "tokio", ] @@ -6260,6 +7929,23 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076" +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower" version = "0.5.2" @@ -6277,6 +7963,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower-http" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +dependencies = [ + "base64 0.21.7", + "bitflags 2.9.1", + "bytes", + "futures-core", + "futures-util", + "http 0.2.12", + "http-body 0.4.6", + "http-range-header", + "mime", + "pin-project-lite", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower-http" version = "0.6.4" @@ -6286,11 +7993,11 @@ dependencies = [ "bitflags 2.9.1", "bytes", "futures-util", - "http", - "http-body", + "http 1.3.1", + "http-body 1.0.1", "iri-string", "pin-project-lite", - "tower", + "tower 0.5.2", "tower-layer", "tower-service", ] @@ -6422,6 +8129,25 @@ 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 0.8.5", + "sha1", + "thiserror 1.0.69", + "url", + "utf-8", +] + [[package]] name = "tungstenite" version = "0.26.2" @@ -6430,11 +8156,11 @@ checksum = "4793cb5e56680ecbb1d843515b23b6de9a75eb04b66643e256a396d43be33c13" dependencies = [ "bytes", "data-encoding", - "http", + "http 1.3.1", "httparse", "log", "rand 0.9.2", - "rustls", + "rustls 0.23.27", "rustls-pki-types", "sha1", "thiserror 2.0.12", @@ -6459,6 +8185,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "twox-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c" + [[package]] name = "typenum" version = "1.18.0" @@ -6516,6 +8248,12 @@ 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-width" version = "0.1.14" @@ -6528,12 +8266,34 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + [[package]] name = "unsafe-libyaml" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" +[[package]] +name = "unsigned-varint" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" + +[[package]] +name = "unsigned-varint" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" + [[package]] name = "untrusted" version = "0.9.0" @@ -6549,6 +8309,7 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] @@ -6605,6 +8366,12 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + [[package]] name = "w3f-bls" version = "0.1.9" @@ -6787,6 +8554,56 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "wasmi" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19af97fcb96045dd1d6b4d23e2b4abdbbe81723dbc5c9f016eb52145b320063" +dependencies = [ + "arrayvec 0.7.6", + "multi-stash", + "smallvec", + "spin", + "wasmi_collections", + "wasmi_core", + "wasmi_ir", + "wasmparser", +] + +[[package]] +name = "wasmi_collections" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e80d6b275b1c922021939d561574bf376613493ae2b61c6963b15db0e8813562" + +[[package]] +name = "wasmi_core" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8c51482cc32d31c2c7ff211cd2bedd73c5bd057ba16a2ed0110e7a96097c33" +dependencies = [ + "downcast-rs", + "libm", +] + +[[package]] +name = "wasmi_ir" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e431a14c186db59212a88516788bd68ed51f87aa1e08d1df742522867b5289a" +dependencies = [ + "wasmi_core", +] + +[[package]] +name = "wasmparser" +version = "0.221.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d06bfa36ab3ac2be0dee563380147a5b81ba10dd8885d7fbbc9eb574be67d185" +dependencies = [ + "bitflags 2.9.1", +] + [[package]] name = "wasmtimer" version = "0.4.1" @@ -6811,6 +8628,34 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-root-certs" +version = "0.26.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75c7f0ef91146ebfb530314f5f1d24528d7f0767efbfd31dce919275413e393e" +dependencies = [ + "webpki-root-certs 1.0.2", +] + +[[package]] +name = "webpki-root-certs" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4ffd8df1c57e87c325000a3d6ef93db75279dc3a231125aac571650f22b12a" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "webpki-roots" version = "0.26.11" @@ -6988,6 +8833,15 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" version = "0.52.0" @@ -7006,6 +8860,21 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-targets" version = "0.52.6" @@ -7047,6 +8916,12 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" @@ -7059,6 +8934,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" @@ -7071,6 +8952,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -7095,6 +8982,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.52.6" @@ -7107,6 +9000,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" @@ -7119,6 +9018,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" @@ -7131,6 +9036,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -7195,6 +9106,28 @@ dependencies = [ "tap", ] +[[package]] +name = "x25519-dalek" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" +dependencies = [ + "curve25519-dalek", + "rand_core 0.6.4", + "serde", + "zeroize", +] + +[[package]] +name = "xattr" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" +dependencies = [ + "libc", + "rustix", +] + [[package]] name = "xxhash-rust" version = "0.8.15" @@ -7207,6 +9140,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +[[package]] +name = "yap" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfe269e7b803a5e8e20cbd97860e136529cd83bf2c9c6d37b142467e7e1f051f" + [[package]] name = "yoke" version = "0.8.0" @@ -7324,3 +9263,133 @@ dependencies = [ "quote", "syn 2.0.101", ] + +[[package]] +name = "zombienet-configuration" +version = "0.3.13" +source = "git+https://github.com/paritytech/zombienet-sdk.git?rev=891f6554354ce466abd496366dbf8b4f82141241#891f6554354ce466abd496366dbf8b4f82141241" +dependencies = [ + "anyhow", + "lazy_static", + "multiaddr", + "regex", + "reqwest", + "serde", + "serde_json", + "thiserror 1.0.69", + "tokio", + "toml", + "tracing", + "url", + "zombienet-support", +] + +[[package]] +name = "zombienet-orchestrator" +version = "0.3.13" +source = "git+https://github.com/paritytech/zombienet-sdk.git?rev=891f6554354ce466abd496366dbf8b4f82141241#891f6554354ce466abd496366dbf8b4f82141241" +dependencies = [ + "anyhow", + "async-trait", + "fancy-regex", + "futures", + "glob-match", + "hex", + "libp2p", + "libsecp256k1", + "multiaddr", + "rand 0.8.5", + "regex", + "reqwest", + "serde", + "serde_json", + "sha2 0.10.9", + "sp-core", + "subxt", + "subxt-signer", + "thiserror 1.0.69", + "tokio", + "tracing", + "uuid", + "zombienet-configuration", + "zombienet-prom-metrics-parser", + "zombienet-provider", + "zombienet-support", +] + +[[package]] +name = "zombienet-prom-metrics-parser" +version = "0.3.13" +source = "git+https://github.com/paritytech/zombienet-sdk.git?rev=891f6554354ce466abd496366dbf8b4f82141241#891f6554354ce466abd496366dbf8b4f82141241" +dependencies = [ + "pest", + "pest_derive", + "thiserror 1.0.69", +] + +[[package]] +name = "zombienet-provider" +version = "0.3.13" +source = "git+https://github.com/paritytech/zombienet-sdk.git?rev=891f6554354ce466abd496366dbf8b4f82141241#891f6554354ce466abd496366dbf8b4f82141241" +dependencies = [ + "anyhow", + "async-trait", + "flate2", + "futures", + "hex", + "k8s-openapi", + "kube", + "nix", + "regex", + "reqwest", + "serde", + "serde_json", + "serde_yaml", + "sha2 0.10.9", + "tar", + "thiserror 1.0.69", + "tokio", + "tokio-util", + "tracing", + "url", + "uuid", + "zombienet-configuration", + "zombienet-support", +] + +[[package]] +name = "zombienet-sdk" +version = "0.3.13" +source = "git+https://github.com/paritytech/zombienet-sdk.git?rev=891f6554354ce466abd496366dbf8b4f82141241#891f6554354ce466abd496366dbf8b4f82141241" +dependencies = [ + "async-trait", + "futures", + "lazy_static", + "subxt", + "subxt-signer", + "tokio", + "zombienet-configuration", + "zombienet-orchestrator", + "zombienet-provider", + "zombienet-support", +] + +[[package]] +name = "zombienet-support" +version = "0.3.13" +source = "git+https://github.com/paritytech/zombienet-sdk.git?rev=891f6554354ce466abd496366dbf8b4f82141241#891f6554354ce466abd496366dbf8b4f82141241" +dependencies = [ + "anyhow", + "async-trait", + "futures", + "lazy_static", + "nix", + "rand 0.8.5", + "regex", + "reqwest", + "serde_json", + "thiserror 1.0.69", + "tokio", + "tracing", + "uuid", +] diff --git a/Cargo.toml b/Cargo.toml index b18c827..980866a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,6 +73,8 @@ revive-solc-json-interface = { git = "https://github.com/paritytech/revive", rev revive-common = { git = "https://github.com/paritytech/revive", rev = "3389865af7c3ff6f29a586d82157e8bc573c1a8e" } revive-differential = { git = "https://github.com/paritytech/revive", rev = "3389865af7c3ff6f29a586d82157e8bc573c1a8e" } +zombienet-sdk = { git = "https://github.com/paritytech/zombienet-sdk.git", rev ="891f6554354ce466abd496366dbf8b4f82141241" } + [workspace.dependencies.alloy] version = "1.0.37" default-features = false diff --git a/crates/common/src/types/identifiers.rs b/crates/common/src/types/identifiers.rs index 349081c..2dd8563 100644 --- a/crates/common/src/types/identifiers.rs +++ b/crates/common/src/types/identifiers.rs @@ -39,6 +39,10 @@ pub enum PlatformIdentifier { ReviveDevNodePolkavmResolc, /// The revive dev node with the REVM backend with the solc compiler. ReviveDevNodeRevmSolc, + /// A zombienet based Substrate/Polkadot node with the PolkaVM backend with the resolc compiler. + ZombienetPolkavmResolc, + /// A zombienet based Substrate/Polkadot node with the REVM backend with the solc compiler. + ZombienetRevmSolc, } /// An enum of the platform identifiers of all of the platforms supported by this framework. @@ -95,6 +99,8 @@ pub enum NodeIdentifier { Kitchensink, /// The revive dev node implementation. ReviveDevNode, + /// A zombienet spawned nodes + Zombienet, } /// An enum representing the identifiers of the supported VMs. diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index f7a4651..7e8814b 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -107,6 +107,16 @@ impl AsRef for Context { } } +impl AsRef for Context { + fn as_ref(&self) -> &PolkadotParachainConfiguration { + match self { + Self::Test(context) => context.as_ref().as_ref(), + Self::Benchmark(context) => context.as_ref().as_ref(), + Self::ExportJsonSchema => unreachable!(), + } + } +} + impl AsRef for Context { fn as_ref(&self) -> &KitchensinkConfiguration { match self { @@ -225,6 +235,10 @@ pub struct TestExecutionContext { #[clap(flatten, next_help_heading = "Resolc Configuration")] pub resolc_configuration: ResolcConfiguration, + /// Configuration parameters for the Polkadot Parachain. + #[clap(flatten, next_help_heading = "Polkadot Parachain Configuration")] + pub polkadot_parachain_configuration: PolkadotParachainConfiguration, + /// Configuration parameters for the geth node. #[clap(flatten, next_help_heading = "Geth Configuration")] pub geth_configuration: GethConfiguration, @@ -318,6 +332,10 @@ pub struct BenchmarkingContext { #[clap(flatten, next_help_heading = "Kitchensink Configuration")] pub kitchensink_configuration: KitchensinkConfiguration, + /// Configuration parameters for the Polkadot Parachain. + #[clap(flatten, next_help_heading = "Polkadot Parachain Configuration")] + pub polkadot_parachain_configuration: PolkadotParachainConfiguration, + /// Configuration parameters for the Revive Dev Node. #[clap(flatten, next_help_heading = "Revive Dev Node Configuration")] pub revive_dev_node_configuration: ReviveDevNodeConfiguration, @@ -379,6 +397,12 @@ impl AsRef for TestExecutionContext { } } +impl AsRef for TestExecutionContext { + fn as_ref(&self) -> &PolkadotParachainConfiguration { + &self.polkadot_parachain_configuration + } +} + impl AsRef for TestExecutionContext { fn as_ref(&self) -> &KurtosisConfiguration { &self.lighthouse_configuration @@ -475,6 +499,12 @@ impl AsRef for BenchmarkingContext { } } +impl AsRef for BenchmarkingContext { + fn as_ref(&self) -> &PolkadotParachainConfiguration { + &self.polkadot_parachain_configuration + } +} + impl AsRef for BenchmarkingContext { fn as_ref(&self) -> &KitchensinkConfiguration { &self.kitchensink_configuration @@ -545,6 +575,30 @@ pub struct ResolcConfiguration { pub path: PathBuf, } +/// A set of configuration parameters for Polkadot Parachain. +#[derive(Clone, Debug, Parser, Serialize)] +pub struct PolkadotParachainConfiguration { + /// Specifies the path of the polkadot-parachain node to be used by the tool. + /// + /// If this is not specified, then the tool assumes that it should use the polkadot-parachain binary + /// that's provided in the user's $PATH. + #[clap( + id = "polkadot-parachain.path", + long = "polkadot-parachain.path", + default_value = "polkadot-parachain" + )] + pub path: PathBuf, + + /// The amount of time to wait upon startup before considering that the node timed out. + #[clap( + id = "polkadot-parachain.start-timeout-ms", + long = "polkadot-parachain.start-timeout-ms", + default_value = "5000", + value_parser = parse_duration + )] + pub start_timeout_ms: Duration, +} + /// A set of configuration parameters for Geth. #[derive(Clone, Debug, Parser, Serialize)] pub struct GethConfiguration { @@ -893,4 +947,6 @@ pub enum TestingPlatform { Geth, /// The kitchensink runtime provides the PolkaVM (PVM) based node implementation. Kitchensink, + /// A polkadot/Substrate based network + Zombienet, } diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index 5550a80..41ab789 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -16,7 +16,7 @@ use revive_dt_config::*; use revive_dt_node::{ Node, node_implementations::geth::GethNode, node_implementations::lighthouse_geth::LighthouseGethNode, - node_implementations::substrate::SubstrateNode, + node_implementations::substrate::SubstrateNode, node_implementations::zombienet::ZombieNode, }; use revive_dt_node_interaction::EthereumNode; use tracing::info; @@ -359,6 +359,102 @@ impl Platform for ReviveDevNodeRevmSolcPlatform { } } +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Default, Hash)] +pub struct ZombienetPolkavmResolcPlatform; + +impl Platform for ZombienetPolkavmResolcPlatform { + fn platform_identifier(&self) -> PlatformIdentifier { + PlatformIdentifier::ZombienetPolkavmResolc + } + + fn node_identifier(&self) -> NodeIdentifier { + NodeIdentifier::Zombienet + } + + fn vm_identifier(&self) -> VmIdentifier { + VmIdentifier::PolkaVM + } + + fn compiler_identifier(&self) -> CompilerIdentifier { + CompilerIdentifier::Resolc + } + + fn new_node( + &self, + context: Context, + ) -> anyhow::Result>>> { + let genesis_configuration = AsRef::::as_ref(&context); + let polkadot_parachain_path = AsRef::::as_ref(&context) + .path + .clone(); + let genesis = genesis_configuration.genesis()?.clone(); + Ok(thread::spawn(move || { + let node = ZombieNode::new(polkadot_parachain_path, context); + let node = spawn_node(node, genesis)?; + Ok(Box::new(node) as Box<_>) + })) + } + + fn new_compiler( + &self, + context: Context, + version: Option, + ) -> Pin>>>> { + Box::pin(async move { + let compiler = Solc::new(context, version).await; + compiler.map(|compiler| Box::new(compiler) as Box) + }) + } +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Default, Hash)] +pub struct ZombienetRevmSolcPlatform; + +impl Platform for ZombienetRevmSolcPlatform { + fn platform_identifier(&self) -> PlatformIdentifier { + PlatformIdentifier::ZombienetRevmSolc + } + + fn node_identifier(&self) -> NodeIdentifier { + NodeIdentifier::Zombienet + } + + fn vm_identifier(&self) -> VmIdentifier { + VmIdentifier::Evm + } + + fn compiler_identifier(&self) -> CompilerIdentifier { + CompilerIdentifier::Solc + } + + fn new_node( + &self, + context: Context, + ) -> anyhow::Result>>> { + let genesis_configuration = AsRef::::as_ref(&context); + let polkadot_parachain_path = AsRef::::as_ref(&context) + .path + .clone(); + let genesis = genesis_configuration.genesis()?.clone(); + Ok(thread::spawn(move || { + let node = ZombieNode::new(polkadot_parachain_path, context); + let node = spawn_node(node, genesis)?; + Ok(Box::new(node) as Box<_>) + })) + } + + fn new_compiler( + &self, + context: Context, + version: Option, + ) -> Pin>>>> { + Box::pin(async move { + let compiler = Solc::new(context, version).await; + compiler.map(|compiler| Box::new(compiler) as Box) + }) + } +} + impl From for Box { fn from(value: PlatformIdentifier) -> Self { match value { @@ -378,6 +474,10 @@ impl From for Box { PlatformIdentifier::ReviveDevNodeRevmSolc => { Box::new(ReviveDevNodeRevmSolcPlatform) as Box<_> } + PlatformIdentifier::ZombienetPolkavmResolc => { + Box::new(ZombienetPolkavmResolcPlatform) as Box<_> + } + PlatformIdentifier::ZombienetRevmSolc => Box::new(ZombienetRevmSolcPlatform) as Box<_>, } } } @@ -401,6 +501,10 @@ impl From for &dyn Platform { PlatformIdentifier::ReviveDevNodeRevmSolc => { &ReviveDevNodeRevmSolcPlatform as &dyn Platform } + PlatformIdentifier::ZombienetPolkavmResolc => { + &ZombienetPolkavmResolcPlatform as &dyn Platform + } + PlatformIdentifier::ZombienetRevmSolc => &ZombienetRevmSolcPlatform as &dyn Platform, } } } diff --git a/crates/node/Cargo.toml b/crates/node/Cargo.toml index 8073c11..9030b86 100644 --- a/crates/node/Cargo.toml +++ b/crates/node/Cargo.toml @@ -29,6 +29,7 @@ serde_yaml_ng = { workspace = true } sp-core = { workspace = true } sp-runtime = { workspace = true } +zombienet-sdk = { workspace = true } [dev-dependencies] temp-dir = { workspace = true } diff --git a/crates/node/src/node_implementations/mod.rs b/crates/node/src/node_implementations/mod.rs index 83b8371..f44813a 100644 --- a/crates/node/src/node_implementations/mod.rs +++ b/crates/node/src/node_implementations/mod.rs @@ -1,3 +1,4 @@ pub mod geth; pub mod lighthouse_geth; pub mod substrate; +pub mod zombienet; diff --git a/crates/node/src/node_implementations/zombienet.rs b/crates/node/src/node_implementations/zombienet.rs new file mode 100644 index 0000000..9a43f40 --- /dev/null +++ b/crates/node/src/node_implementations/zombienet.rs @@ -0,0 +1,1137 @@ +//! # ZombieNode Implementation +//! +//! ## Required Binaries +//! This module requires the following binaries to be compiled and available in your PATH: +//! +//! 1. **polkadot-parachain**: +//! ```bash +//! git clone https://github.com/paritytech/polkadot-sdk.git +//! cd polkadot-sdk +//! cargo build --release --locked -p polkadot-parachain-bin --bin polkadot-parachain +//! ``` +//! +//! 2. **eth-rpc** (Revive EVM RPC server): +//! ```bash +//! git clone https://github.com/paritytech/polkadot-sdk.git +//! cd polkadot-sdk +//! cargo build --locked --profile production -p pallet-revive-eth-rpc --bin eth-rpc +//! ``` +//! +//! 3. **polkadot** (for the relay chain): +//! ```bash +//! # In polkadot-sdk directory +//! cargo build --locked --profile testnet --features fast-runtime --bin polkadot --bin polkadot-prepare-worker --bin polkadot-execute-worker +//! ``` +//! +//! Make sure to add the build output directories to your PATH or provide +//! the full paths in your configuration. + +use std::{ + fs::{create_dir_all, remove_dir_all}, + path::PathBuf, + pin::Pin, + process::{Command, Stdio}, + sync::{ + Arc, + atomic::{AtomicU32, Ordering}, + }, + time::Duration, +}; + +use alloy::{ + eips::BlockNumberOrTag, + genesis::{Genesis, GenesisAccount}, + network::{Ethereum, EthereumWallet, NetworkWallet}, + primitives::{Address, BlockHash, BlockNumber, BlockTimestamp, StorageKey, TxHash, U256}, + providers::{ + Provider, + ext::DebugApi, + fillers::{CachedNonceManager, ChainIdFiller, FillProvider, NonceFiller, TxFiller}, + }, + rpc::types::{ + EIP1186AccountProofResponse, TransactionReceipt, TransactionRequest, + trace::geth::{DiffMode, GethDebugTracingOptions, PreStateConfig, PreStateFrame}, + }, +}; + +use anyhow::Context as _; +use futures::{Stream, StreamExt}; +use revive_common::EVMVersion; +use revive_dt_common::fs::clear_directory; +use revive_dt_config::*; +use revive_dt_format::traits::ResolverApi; +use revive_dt_node_interaction::{EthereumNode, MinedBlockInformation}; +use serde_json::{Value as JsonValue, json}; +use sp_core::crypto::Ss58Codec; +use sp_runtime::AccountId32; +use tokio::sync::OnceCell; +use tracing::instrument; +use zombienet_sdk::{LocalFileSystem, NetworkConfigBuilder, NetworkConfigExt}; + +use crate::{ + Node, + constants::INITIAL_BALANCE, + helpers::{Process, ProcessReadinessWaitBehavior}, + node_implementations::substrate::ReviveNetwork, + provider_utils::{ConcreteProvider, FallbackGasFiller, construct_concurrency_limited_provider}, +}; + +static NODE_COUNT: AtomicU32 = AtomicU32::new(0); + +/// A Zombienet network where collator is `polkadot-parachain` node with `eth-rpc` +/// [`ZombieNode`] abstracts away the details of managing the zombienet network and provides +/// an interface to interact with the parachain's Ethereum RPC. +#[derive(Debug, Default)] +pub struct ZombieNode { + /* Node Identifier */ + id: u32, + connection_string: String, + node_rpc_port: Option, + + /* Directory Paths */ + base_directory: PathBuf, + logs_directory: PathBuf, + + /* Binary Paths & Timeouts */ + eth_proxy_binary: PathBuf, + polkadot_parachain_path: PathBuf, + + /* Spawned Processes */ + eth_rpc_process: Option, + + /* Zombienet Network */ + network_config: Option, + network: Option>, + + /* Provider Related Fields */ + wallet: Arc, + nonce_manager: CachedNonceManager, + + provider: OnceCell>>, +} + +impl ZombieNode { + const BASE_DIRECTORY: &str = "zombienet"; + const DATA_DIRECTORY: &str = "data"; + const LOGS_DIRECTORY: &str = "logs"; + + const NODE_BASE_RPC_PORT: u16 = 9946; + const PARACHAIN_ID: u32 = 100; + const ETH_RPC_BASE_PORT: u16 = 8545; + + const ETH_RPC_READY_MARKER: &str = "Running JSON-RPC server"; + + const EXPORT_CHAINSPEC_COMMAND: &str = "build-spec"; + const CHAIN_SPEC_JSON_FILE: &str = "template_chainspec.json"; + + pub fn new( + polkadot_parachain_path: PathBuf, + context: impl AsRef + + AsRef + + AsRef, + ) -> Self { + let eth_proxy_binary = AsRef::::as_ref(&context) + .path + .to_owned(); + let working_directory_path = AsRef::::as_ref(&context); + let id = NODE_COUNT.fetch_add(1, Ordering::SeqCst); + let base_directory = working_directory_path + .join(Self::BASE_DIRECTORY) + .join(id.to_string()); + let logs_directory = base_directory.join(Self::LOGS_DIRECTORY); + let wallet = AsRef::::as_ref(&context).wallet(); + + Self { + id, + base_directory, + logs_directory, + wallet, + polkadot_parachain_path, + eth_proxy_binary, + nonce_manager: CachedNonceManager::default(), + network_config: None, + network: None, + eth_rpc_process: None, + connection_string: String::new(), + node_rpc_port: None, + provider: Default::default(), + } + } + + fn init(&mut self, genesis: Genesis) -> anyhow::Result<&mut Self> { + let _ = clear_directory(&self.base_directory); + let _ = clear_directory(&self.logs_directory); + + create_dir_all(&self.base_directory) + .context("Failed to create base directory for zombie node")?; + create_dir_all(&self.logs_directory) + .context("Failed to create logs directory for zombie node")?; + + let template_chainspec_path = self.base_directory.join(Self::CHAIN_SPEC_JSON_FILE); + self.prepare_chainspec(template_chainspec_path.clone(), genesis)?; + let polkadot_parachain_path = self + .polkadot_parachain_path + .to_str() + .context("Invalid polkadot parachain path")?; + + let node_rpc_port = Self::NODE_BASE_RPC_PORT + self.id as u16; + + let network_config = NetworkConfigBuilder::new() + .with_relaychain(|r| { + r.with_chain("westend-local") + .with_default_command("polkadot") + .with_node(|node| node.with_name("alice")) + .with_node(|node| node.with_name("bob")) + }) + .with_global_settings(|g| g.with_base_dir(&self.base_directory)) + .with_parachain(|p| { + p.with_id(Self::PARACHAIN_ID) + .with_chain_spec_path(template_chainspec_path.to_str().unwrap()) + .with_chain("asset-hub-westend-local") + .with_collator(|n| { + n.with_name("Collator") + .with_command(polkadot_parachain_path) + .with_rpc_port(node_rpc_port) + }) + }) + .build() + .map_err(|e| anyhow::anyhow!("Failed to build zombienet network config: {e:?}"))?; + + self.node_rpc_port = Some(node_rpc_port); + self.network_config = Some(network_config); + + Ok(self) + } + + fn spawn_process(&mut self) -> anyhow::Result<()> { + let network_config = self + .network_config + .clone() + .context("Node not initialized, call init() first")?; + + let rt = tokio::runtime::Runtime::new().unwrap(); + let network = rt.block_on(async { + network_config + .spawn_native() + .await + .map_err(|e| anyhow::anyhow!("Failed to spawn zombienet network: {e:?}")) + })?; + + tracing::debug!("Zombienet network is up"); + + let node_url = format!("ws://localhost:{}", self.node_rpc_port.unwrap()); + let eth_rpc_port = Self::ETH_RPC_BASE_PORT + self.id as u16; + + let eth_rpc_process = Process::new( + "proxy", + self.logs_directory.as_path(), + self.eth_proxy_binary.as_path(), + |command, stdout_file, stderr_file| { + command + .arg("--node-rpc-url") + .arg(node_url) + .arg("--rpc-cors") + .arg("all") + .arg("--rpc-max-connections") + .arg(u32::MAX.to_string()) + .arg("--rpc-port") + .arg(eth_rpc_port.to_string()) + .stdout(stdout_file) + .stderr(stderr_file); + }, + ProcessReadinessWaitBehavior::TimeBoundedWaitFunction { + max_wait_duration: Duration::from_secs(30), + check_function: Box::new(|_, stderr_line| match stderr_line { + Some(line) => Ok(line.contains(Self::ETH_RPC_READY_MARKER)), + None => Ok(false), + }), + }, + ); + + match eth_rpc_process { + Ok(process) => self.eth_rpc_process = Some(process), + Err(err) => { + tracing::error!(?err, "Failed to start eth proxy, shutting down gracefully"); + self.shutdown() + .context("Failed to gracefully shutdown after eth proxy start error")?; + return Err(err); + } + } + + tracing::debug!("eth-rpc is up"); + + self.connection_string = format!("http://localhost:{}", eth_rpc_port); + self.network = Some(network); + + Ok(()) + } + + fn prepare_chainspec( + &mut self, + template_chainspec_path: PathBuf, + mut genesis: Genesis, + ) -> anyhow::Result<()> { + let mut cmd: Command = std::process::Command::new(&self.polkadot_parachain_path); + cmd.arg(Self::EXPORT_CHAINSPEC_COMMAND) + .arg("--chain") + .arg("asset-hub-westend-local"); + + let output = cmd.output().context("Failed to export the chain-spec")?; + + if !output.status.success() { + anyhow::bail!( + "Build chain-spec failed: {}", + String::from_utf8_lossy(&output.stderr) + ); + } + + let content = String::from_utf8(output.stdout) + .context("Failed to decode collators chain-spec output as UTF-8")?; + let mut chainspec_json: JsonValue = + serde_json::from_str(&content).context("Failed to parse collators chain spec JSON")?; + + let existing_chainspec_balances = + chainspec_json["genesis"]["runtimeGenesis"]["patch"]["balances"]["balances"] + .as_array() + .cloned() + .unwrap_or_default(); + + let mut merged_balances: Vec<(String, u128)> = existing_chainspec_balances + .into_iter() + .filter_map(|val| { + if let Some(arr) = val.as_array() { + if arr.len() == 2 { + let account = arr[0].as_str()?.to_string(); + let balance = arr[1].as_f64()? as u128; + return Some((account, balance)); + } + } + None + }) + .collect(); + + let mut eth_balances = { + for signer_address in + >::signer_addresses(&self.wallet) + { + // Note, the use of the entry API here means that we only modify the entries for any + // account that is not in the `alloc` field of the genesis state. + genesis + .alloc + .entry(signer_address) + .or_insert(GenesisAccount::default().with_balance(U256::from(INITIAL_BALANCE))); + } + self.extract_balance_from_genesis_file(&genesis) + .context("Failed to extract balances from EVM genesis JSON")? + }; + + merged_balances.append(&mut eth_balances); + + chainspec_json["genesis"]["runtimeGenesis"]["patch"]["balances"]["balances"] = + json!(merged_balances); + + let writer = std::fs::File::create(&template_chainspec_path) + .context("Failed to create template chainspec file")?; + + serde_json::to_writer_pretty(writer, &chainspec_json) + .context("Failed to write template chainspec JSON")?; + + Ok(()) + } + + fn extract_balance_from_genesis_file( + &self, + genesis: &Genesis, + ) -> anyhow::Result> { + genesis + .alloc + .iter() + .try_fold(Vec::new(), |mut vec, (address, acc)| { + let polkadot_address = Self::eth_to_polkadot_address(address); + let balance = acc.balance.try_into()?; + vec.push((polkadot_address, balance)); + Ok(vec) + }) + } + + fn eth_to_polkadot_address(address: &Address) -> String { + let eth_bytes = address.0.0; + + let mut padded = [0xEEu8; 32]; + padded[..20].copy_from_slice(ð_bytes); + + let account_id = AccountId32::from(padded); + account_id.to_ss58check() + } + + pub fn eth_rpc_version(&self) -> anyhow::Result { + let output = Command::new(&self.eth_proxy_binary) + .arg("--version") + .stdin(Stdio::null()) + .stdout(Stdio::piped()) + .stderr(Stdio::null()) + .spawn()? + .wait_with_output()? + .stdout; + + Ok(String::from_utf8_lossy(&output).trim().to_string()) + } + + async fn provider( + &self, + ) -> anyhow::Result>> { + self.provider + .get_or_try_init(|| async move { + construct_concurrency_limited_provider::( + self.connection_string.as_str(), + FallbackGasFiller::new(250_000_000, 5_000_000_000, 1_000_000_000), + ChainIdFiller::default(), // TODO: use CHAIN_ID constant + NonceFiller::new(self.nonce_manager.clone()), + self.wallet.clone(), + ) + .await + .context("Failed to construct the provider") + }) + .await + .cloned() + } +} + +impl EthereumNode for ZombieNode { + fn pre_transactions(&mut self) -> Pin> + '_>> { + Box::pin(async move { Ok(()) }) + } + + fn id(&self) -> usize { + self.id as _ + } + + fn connection_string(&self) -> &str { + &self.connection_string + } + + fn submit_transaction( + &self, + transaction: TransactionRequest, + ) -> Pin> + '_>> { + Box::pin(async move { + let provider = self + .provider() + .await + .context("Failed to create the provider for transaction submission")?; + let pending_transaction = provider + .send_transaction(transaction) + .await + .context("Failed to submit the transaction through the provider")?; + Ok(*pending_transaction.tx_hash()) + }) + } + + fn get_receipt( + &self, + tx_hash: TxHash, + ) -> Pin> + '_>> { + Box::pin(async move { + self.provider() + .await + .context("Failed to create provider for getting the receipt")? + .get_transaction_receipt(tx_hash) + .await + .context("Failed to get the receipt of the transaction")? + .context("Failed to get the receipt of the transaction") + }) + } + + fn execute_transaction( + &self, + transaction: alloy::rpc::types::TransactionRequest, + ) -> Pin> + '_>> { + Box::pin(async move { + let receipt = self + .provider() + .await + .context("Failed to create provider for transaction submission")? + .send_transaction(transaction) + .await + .context("Failed to submit transaction to proxy")? + .get_receipt() + .await + .context("Failed to fetch transaction receipt from proxy")?; + Ok(receipt) + }) + } + + fn trace_transaction( + &self, + tx_hash: TxHash, + trace_options: GethDebugTracingOptions, + ) -> Pin> + '_>> + { + Box::pin(async move { + self.provider() + .await + .context("Failed to create provider for debug tracing")? + .debug_trace_transaction(tx_hash, trace_options) + .await + .context("Failed to obtain debug trace from proxy") + }) + } + + fn state_diff( + &self, + tx_hash: TxHash, + ) -> Pin> + '_>> { + Box::pin(async move { + let trace_options = GethDebugTracingOptions::prestate_tracer(PreStateConfig { + diff_mode: Some(true), + disable_code: None, + disable_storage: None, + }); + match self + .trace_transaction(tx_hash, trace_options) + .await? + .try_into_pre_state_frame()? + { + PreStateFrame::Diff(diff) => Ok(diff), + _ => anyhow::bail!("expected a diff mode trace"), + } + }) + } + + fn balance_of( + &self, + address: Address, + ) -> Pin> + '_>> { + Box::pin(async move { + self.provider() + .await + .context("Failed to get the zombie provider")? + .get_balance(address) + .await + .map_err(Into::into) + }) + } + + fn latest_state_proof( + &self, + address: Address, + keys: Vec, + ) -> Pin> + '_>> { + Box::pin(async move { + self.provider() + .await + .context("Failed to get the zombie provider")? + .get_proof(address, keys) + .latest() + .await + .map_err(Into::into) + }) + } + + fn resolver( + &self, + ) -> Pin>> + '_>> { + Box::pin(async move { + let id = self.id; + let provider = self.provider().await?; + + Ok(Arc::new(ZombieNodeResolver { id, provider }) as Arc) + }) + } + + fn evm_version(&self) -> EVMVersion { + EVMVersion::Cancun + } + + fn subscribe_to_full_blocks_information( + &self, + ) -> Pin< + Box< + dyn Future>>>> + + '_, + >, + > { + Box::pin(async move { + let provider = self + .provider() + .await + .context("Failed to create the provider for block subscription")?; + let mut block_subscription = provider + .watch_full_blocks() + .await + .context("Failed to create the blocks stream")?; + block_subscription.set_channel_size(0xFFFF); + block_subscription.set_poll_interval(Duration::from_secs(1)); + let block_stream = block_subscription.into_stream(); + + let mined_block_information_stream = block_stream.filter_map(|block| async { + let block = block.ok()?; + Some(MinedBlockInformation { + block_number: block.number(), + block_timestamp: block.header.timestamp, + mined_gas: block.header.gas_used as _, + block_gas_limit: block.header.gas_limit, + transaction_hashes: block + .transactions + .into_hashes() + .as_hashes() + .expect("Must be hashes") + .to_vec(), + }) + }); + + Ok(Box::pin(mined_block_information_stream) + as Pin>>) + }) + } +} + +pub struct ZombieNodeResolver, P: Provider> { + id: u32, + provider: FillProvider, +} + +impl, P: Provider> ResolverApi + for ZombieNodeResolver +{ + #[instrument(level = "info", skip_all, fields(zombie_node_id = self.id))] + fn chain_id( + &self, + ) -> Pin> + '_>> { + Box::pin(async move { self.provider.get_chain_id().await.map_err(Into::into) }) + } + + #[instrument(level = "info", skip_all, fields(zombie_node_id = self.id))] + fn transaction_gas_price( + &self, + tx_hash: TxHash, + ) -> Pin> + '_>> { + Box::pin(async move { + self.provider + .get_transaction_receipt(tx_hash) + .await? + .context("Failed to get the transaction receipt") + .map(|receipt| receipt.effective_gas_price) + }) + } + + #[instrument(level = "info", skip_all, fields(zombie_node_id = self.id))] + fn block_gas_limit( + &self, + number: BlockNumberOrTag, + ) -> Pin> + '_>> { + Box::pin(async move { + self.provider + .get_block_by_number(number) + .await + .context("Failed to get the block")? + .context("Failed to get the block, perhaps the chain has no blocks?") + .map(|block| block.header.gas_limit as _) + }) + } + + #[instrument(level = "info", skip_all, fields(zombie_node_id = self.id))] + fn block_coinbase( + &self, + number: BlockNumberOrTag, + ) -> Pin> + '_>> { + Box::pin(async move { + self.provider + .get_block_by_number(number) + .await + .context("Failed to get the zombie block")? + .context("Failed to get the zombie block, perhaps the chain has no blocks?") + .map(|block| block.header.beneficiary) + }) + } + + #[instrument(level = "info", skip_all, fields(zombie_node_id = self.id))] + fn block_difficulty( + &self, + number: BlockNumberOrTag, + ) -> Pin> + '_>> { + Box::pin(async move { + self.provider + .get_block_by_number(number) + .await + .context("Failed to get the zombie block")? + .context("Failed to get the zombie block, perhaps the chain has no blocks?") + .map(|block| U256::from_be_bytes(block.header.mix_hash.0)) + }) + } + + #[instrument(level = "info", skip_all, fields(zombie_node_id = self.id))] + fn block_base_fee( + &self, + number: BlockNumberOrTag, + ) -> Pin> + '_>> { + Box::pin(async move { + self.provider + .get_block_by_number(number) + .await + .context("Failed to get the zombie block")? + .context("Failed to get the zombie block, perhaps the chain has no blocks?") + .and_then(|block| { + block + .header + .base_fee_per_gas + .context("Failed to get the base fee per gas") + }) + }) + } + + #[instrument(level = "info", skip_all, fields(zombie_node_id = self.id))] + fn block_hash( + &self, + number: BlockNumberOrTag, + ) -> Pin> + '_>> { + Box::pin(async move { + self.provider + .get_block_by_number(number) + .await + .context("Failed to get the zombie block")? + .context("Failed to get the zombie block, perhaps the chain has no blocks?") + .map(|block| block.header.hash) + }) + } + + #[instrument(level = "info", skip_all, fields(zombie_node_id = self.id))] + fn block_timestamp( + &self, + number: BlockNumberOrTag, + ) -> Pin> + '_>> { + Box::pin(async move { + self.provider + .get_block_by_number(number) + .await + .context("Failed to get the zombie block")? + .context("Failed to get the zombie block, perhaps the chain has no blocks?") + .map(|block| block.header.timestamp) + }) + } + + #[instrument(level = "info", skip_all, fields(zombie_node_id = self.id))] + fn last_block_number(&self) -> Pin> + '_>> { + Box::pin(async move { self.provider.get_block_number().await.map_err(Into::into) }) + } +} + +impl Node for ZombieNode { + fn shutdown(&mut self) -> anyhow::Result<()> { + // Kill the eth_rpc process + drop(self.eth_rpc_process.take()); + + // Destroy the network + if let Some(network) = self.network.take() { + // Handle network cleanup here + tokio::task::spawn_blocking(move || { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + if let Err(e) = network.destroy().await { + tracing::warn!("Failed to destroy zombienet network: {e:?}"); + } + }) + }); + } + + // Remove the database directory + if let Err(e) = remove_dir_all(self.base_directory.join(Self::DATA_DIRECTORY)) { + tracing::warn!("Failed to remove database directory: {e:?}"); + } + + Ok(()) + } + + fn spawn(&mut self, genesis: Genesis) -> anyhow::Result<()> { + self.init(genesis)?.spawn_process() + } + + fn version(&self) -> anyhow::Result { + let output = Command::new(&self.polkadot_parachain_path) + .arg("--version") + .stdin(Stdio::null()) + .stdout(Stdio::piped()) + .stderr(Stdio::null()) + .spawn() + .context("Failed execute --version")? + .wait_with_output() + .context("Failed to wait --version")? + .stdout; + Ok(String::from_utf8_lossy(&output).into()) + } +} + +impl Drop for ZombieNode { + fn drop(&mut self) { + let _ = self.shutdown(); + } +} + +#[cfg(test)] +mod tests { + use alloy::rpc::types::TransactionRequest; + + use crate::node_implementations::zombienet::tests::utils::shared_node; + + use super::*; + + mod utils { + use super::*; + + use std::sync::Arc; + use tokio::sync::OnceCell; + + pub fn test_config() -> TestExecutionContext { + TestExecutionContext::default() + } + + pub async fn new_node() -> (TestExecutionContext, ZombieNode) { + let context = test_config(); + let mut node = ZombieNode::new( + context.polkadot_parachain_configuration.path.clone(), + &context, + ); + let genesis = context.genesis_configuration.genesis().unwrap().clone(); + node.init(genesis).unwrap(); + + // Run spawn_process in a blocking thread + let node = tokio::task::spawn_blocking(move || { + node.spawn_process().unwrap(); + node + }) + .await + .expect("Failed to spawn process"); + + (context, node) + } + + pub async fn shared_state() -> &'static (TestExecutionContext, Arc) { + static NODE: OnceCell<(TestExecutionContext, Arc)> = OnceCell::const_new(); + + NODE.get_or_init(|| async { + let (context, node) = new_node().await; + (context, Arc::new(node)) + }) + .await + } + + pub async fn shared_node() -> &'static Arc { + &shared_state().await.1 + } + } + use utils::{new_node, test_config}; + + #[tokio::test] + async fn test_transfer_transaction_should_return_receipt() { + let (ctx, node) = new_node().await; + + let provider = node.provider().await.expect("Failed to create provider"); + let account_address = ctx.wallet_configuration.wallet().default_signer().address(); + let transaction = TransactionRequest::default() + .to(account_address) + .value(U256::from(100_000_000_000_000u128)); + + let receipt = provider.send_transaction(transaction).await; + let _ = receipt + .expect("Failed to send the transfer transaction") + .get_receipt() + .await + .expect("Failed to get the receipt for the transfer"); + } + + #[tokio::test] + async fn test_init_generates_chainspec_with_balances() { + let genesis_content = r#" + { + "alloc": { + "90F8bf6A479f320ead074411a4B0e7944Ea8c9C1": { + "balance": "1000000000000000000" + }, + "Ab8483F64d9C6d1EcF9b849Ae677dD3315835cb2": { + "balance": "2000000000000000000" + } + } + } + "#; + + let context = test_config(); + let mut node = ZombieNode::new( + context.polkadot_parachain_configuration.path.clone(), + &context, + ); + + // Call `init()` + node.init(serde_json::from_str(genesis_content).unwrap()) + .expect("init failed"); + + // Check that the patched chainspec file was generated + let final_chainspec_path = node.base_directory.join(ZombieNode::CHAIN_SPEC_JSON_FILE); + assert!(final_chainspec_path.exists(), "Chainspec file should exist"); + + let contents = + std::fs::read_to_string(&final_chainspec_path).expect("Failed to read chainspec"); + + // Validate that the Polkadot addresses derived from the Ethereum addresses are in the file + let first_eth_addr = ZombieNode::eth_to_polkadot_address( + &"90F8bf6A479f320ead074411a4B0e7944Ea8c9C1".parse().unwrap(), + ); + let second_eth_addr = ZombieNode::eth_to_polkadot_address( + &"Ab8483F64d9C6d1EcF9b849Ae677dD3315835cb2".parse().unwrap(), + ); + + assert!( + contents.contains(&first_eth_addr), + "Chainspec should contain Polkadot address for first Ethereum account" + ); + assert!( + contents.contains(&second_eth_addr), + "Chainspec should contain Polkadot address for second Ethereum account" + ); + } + + #[tokio::test] + async fn test_parse_genesis_alloc() { + // Create test genesis file + let genesis_json = r#" + { + "alloc": { + "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1": { "balance": "1000000000000000000" }, + "0x0000000000000000000000000000000000000000": { "balance": "0xDE0B6B3A7640000" }, + "0xffffffffffffffffffffffffffffffffffffffff": { "balance": "123456789" } + } + } + "#; + + let context = test_config(); + let node = ZombieNode::new( + context.polkadot_parachain_configuration.path.clone(), + &context, + ); + + let result = node + .extract_balance_from_genesis_file(&serde_json::from_str(genesis_json).unwrap()) + .unwrap(); + + let result_map: std::collections::HashMap<_, _> = result.into_iter().collect(); + + assert_eq!( + result_map.get("5FLneRcWAfk3X3tg6PuGyLNGAquPAZez5gpqvyuf3yUK8VaV"), + Some(&1_000_000_000_000_000_000u128) + ); + + assert_eq!( + result_map.get("5C4hrfjw9DjXZTzV3MwzrrAr9P1MLDHajjSidz9bR544LEq1"), + Some(&1_000_000_000_000_000_000u128) + ); + + assert_eq!( + result_map.get("5HrN7fHLXWcFiXPwwtq2EkSGns9eMmoUQnbVKweNz3VVr6N4"), + Some(&123_456_789u128) + ); + } + + #[test] + fn print_eth_to_polkadot_mappings() { + let eth_addresses = vec![ + "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1", + "0xffffffffffffffffffffffffffffffffffffffff", + "90F8bf6A479f320ead074411a4B0e7944Ea8c9C1", + ]; + + for eth_addr in eth_addresses { + let ss58 = ZombieNode::eth_to_polkadot_address(ð_addr.parse().unwrap()); + + println!("Ethereum: {eth_addr} -> Polkadot SS58: {ss58}"); + } + } + + #[test] + fn test_eth_to_polkadot_address() { + let cases = vec![ + ( + "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1", + "5FLneRcWAfk3X3tg6PuGyLNGAquPAZez5gpqvyuf3yUK8VaV", + ), + ( + "90F8bf6A479f320ead074411a4B0e7944Ea8c9C1", + "5FLneRcWAfk3X3tg6PuGyLNGAquPAZez5gpqvyuf3yUK8VaV", + ), + ( + "0x0000000000000000000000000000000000000000", + "5C4hrfjw9DjXZTzV3MwzrrAr9P1MLDHajjSidz9bR544LEq1", + ), + ( + "0xffffffffffffffffffffffffffffffffffffffff", + "5HrN7fHLXWcFiXPwwtq2EkSGns9eMmoUQnbVKweNz3VVr6N4", + ), + ]; + + for (eth_addr, expected_ss58) in cases { + let result = ZombieNode::eth_to_polkadot_address(ð_addr.parse().unwrap()); + assert_eq!( + result, expected_ss58, + "Mismatch for Ethereum address {eth_addr}" + ); + } + } + + #[test] + fn eth_rpc_version_works() { + // Arrange + let context = test_config(); + let node = ZombieNode::new( + context.polkadot_parachain_configuration.path.clone(), + &context, + ); + + // Act + let version = node.eth_rpc_version().unwrap(); + + // Assert + assert!( + version.starts_with("pallet-revive-eth-rpc"), + "Expected eth-rpc version string, got: {version}" + ); + } + + #[test] + fn version_works() { + // Arrange + let context = test_config(); + let node = ZombieNode::new( + context.polkadot_parachain_configuration.path.clone(), + &context, + ); + + // Act + let version = node.version().unwrap(); + + // Assert + assert!( + version.starts_with("polkadot-parachain"), + "Expected Polkadot-parachain version string, got: {version}" + ); + } + + #[tokio::test] + #[ignore = "Ignored since they take a long time to run"] + async fn get_chain_id_from_node_should_succeed() { + // Arrange + let node = shared_node().await; + + // Act + let chain_id = node + .resolver() + .await + .expect("Failed to create resolver") + .chain_id() + .await + .expect("Failed to get chain id"); + + // Assert + assert!(chain_id > 0, "Chain ID should be greater than zero"); + } + + #[tokio::test] + #[ignore = "Ignored since they take a long time to run"] + async fn can_get_gas_limit_from_node() { + // Arrange + let node = shared_node().await; + + // Act + let gas_limit = node + .resolver() + .await + .unwrap() + .block_gas_limit(BlockNumberOrTag::Latest) + .await; + + // Assert + let _ = gas_limit.expect("Failed to get the gas limit"); + } + + #[tokio::test] + #[ignore = "Ignored since they take a long time to run"] + async fn can_get_coinbase_from_node() { + // Arrange + let node = shared_node().await; + + // Act + let coinbase = node + .resolver() + .await + .unwrap() + .block_coinbase(BlockNumberOrTag::Latest) + .await; + + // Assert + let _ = coinbase.expect("Failed to get the coinbase"); + } + + #[tokio::test] + #[ignore = "Ignored since they take a long time to run"] + async fn can_get_block_difficulty_from_node() { + // Arrange + let node = shared_node().await; + + // Act + let block_difficulty = node + .resolver() + .await + .unwrap() + .block_difficulty(BlockNumberOrTag::Latest) + .await; + + // Assert + let _ = block_difficulty.expect("Failed to get the block difficulty"); + } + + #[tokio::test] + #[ignore = "Ignored since they take a long time to run"] + async fn can_get_block_hash_from_node() { + // Arrange + let node = shared_node().await; + + // Act + let block_hash = node + .resolver() + .await + .unwrap() + .block_hash(BlockNumberOrTag::Latest) + .await; + + // Assert + let _ = block_hash.expect("Failed to get the block hash"); + } + + #[tokio::test] + #[ignore = "Ignored since they take a long time to run"] + async fn can_get_block_timestamp_from_node() { + // Arrange + let node = shared_node().await; + + // Act + let block_timestamp = node + .resolver() + .await + .unwrap() + .block_timestamp(BlockNumberOrTag::Latest) + .await; + + // Assert + let _ = block_timestamp.expect("Failed to get the block timestamp"); + } + + #[tokio::test] + #[ignore = "Ignored since they take a long time to run"] + async fn can_get_block_number_from_node() { + // Arrange + let node = shared_node().await; + + // Act + let block_number = node.resolver().await.unwrap().last_block_number().await; + + // Assert + let _ = block_number.expect("Failed to get the block number"); + } +}