diff --git a/Cargo.lock b/Cargo.lock index 54355f3e3b160..44df236069147 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -979,6 +979,12 @@ dependencies = [ "syn 2.0.104", ] +[[package]] +name = "always-assert" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4436e0292ab1bb631b42973c61205e704475fe8126af845c8d923c0996328127" + [[package]] name = "ammonia" version = "4.1.2" @@ -3147,6 +3153,15 @@ dependencies = [ "serde", ] +[[package]] +name = "bounded-vec" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68534a48cbf63a4b1323c433cf21238c9ec23711e0df13b08c33e5c2082663ce" +dependencies = [ + "thiserror 1.0.69", +] + [[package]] name = "boxcar" version = "0.2.13" @@ -3976,6 +3991,17 @@ dependencies = [ "cc", ] +[[package]] +name = "coarsetime" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91849686042de1b41cd81490edc83afbcb0abe5a9b6f2c4114f23ce8cca1bcf4" +dependencies = [ + "libc", + "wasix", + "wasm-bindgen", +] + [[package]] name = "cobs" version = "0.3.0" @@ -4341,6 +4367,16 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "cpu-time" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9e393a7668fe1fad3075085b86c781883000b4ede868f43627b34a87c8b7ded" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "cpufeatures" version = "0.2.17" @@ -4691,6 +4727,223 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "cumulus-client-bootnodes" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "array-bytes", + "async-channel 1.9.0", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "futures", + "hex", + "ip_network", + "log", + "num-traits", + "parity-scale-codec", + "prost 0.12.6", + "prost-build 0.13.5", + "sc-network", + "sc-service", + "sp-consensus-babe", + "sp-runtime", + "tokio", +] + +[[package]] +name = "cumulus-client-cli" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "clap", + "parity-scale-codec", + "sc-chain-spec", + "sc-cli", + "sc-client-api", + "sc-service", + "sp-blockchain", + "sp-core", + "sp-runtime", + "url", +] + +[[package]] +name = "cumulus-client-collator" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "cumulus-client-consensus-common", + "cumulus-client-network", + "cumulus-primitives-core", + "futures", + "parity-scale-codec", + "parking_lot 0.12.4", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "sc-client-api", + "sp-api", + "sp-consensus", + "sp-core", + "sp-runtime", + "tracing", +] + +[[package]] +name = "cumulus-client-consensus-common" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "cumulus-client-pov-recovery", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "cumulus-relay-chain-streams", + "dyn-clone", + "futures", + "log", + "parity-scale-codec", + "polkadot-primitives", + "sc-client-api", + "sc-consensus", + "sc-consensus-babe", + "sc-network", + "schnellru", + "sp-blockchain", + "sp-consensus", + "sp-consensus-slots", + "sp-core", + "sp-runtime", + "sp-timestamp", + "sp-trie", + "sp-version", + "substrate-prometheus-endpoint", + "tracing", +] + +[[package]] +name = "cumulus-client-network" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "cumulus-relay-chain-interface", + "futures", + "futures-timer", + "parity-scale-codec", + "parking_lot 0.12.4", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-primitives-test-helpers", + "sc-client-api", + "sc-network", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-version", + "tracing", +] + +[[package]] +name = "cumulus-client-parachain-inherent" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-relay-chain-interface", + "cumulus-test-relay-sproof-builder", + "parity-scale-codec", + "sc-client-api", + "sc-consensus-babe", + "sc-network-types", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?branch=master)", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "sp-storage", + "tracing", +] + +[[package]] +name = "cumulus-client-pov-recovery" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "cumulus-relay-chain-streams", + "futures", + "futures-timer", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "rand 0.8.5", + "sc-client-api", + "sc-consensus", + "sc-network", + "sp-api", + "sp-consensus", + "sp-maybe-compressed-blob", + "sp-runtime", + "sp-version", + "tracing", +] + +[[package]] +name = "cumulus-client-service" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-channel 1.9.0", + "cumulus-client-cli", + "cumulus-client-collator", + "cumulus-client-consensus-common", + "cumulus-client-network", + "cumulus-client-pov-recovery", + "cumulus-primitives-core", + "cumulus-primitives-proof-size-hostfunction", + "cumulus-relay-chain-inprocess-interface", + "cumulus-relay-chain-interface", + "cumulus-relay-chain-minimal-node", + "cumulus-relay-chain-streams", + "futures", + "polkadot-overseer", + "polkadot-primitives", + "prometheus", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-sync", + "sc-network-transactions", + "sc-rpc", + "sc-service", + "sc-sysinfo", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "sc-utils", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-io", + "sp-runtime", + "sp-transaction-pool", + "sp-trie", +] + [[package]] name = "cumulus-pallet-aura-ext" version = "0.7.0" @@ -4972,42 +5225,173 @@ dependencies = [ ] [[package]] -name = "cumulus-test-relay-sproof-builder" +name = "cumulus-relay-chain-inprocess-interface" version = "0.7.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" dependencies = [ + "async-channel 1.9.0", + "async-trait", + "cumulus-client-bootnodes", "cumulus-primitives-core", - "parity-scale-codec", + "cumulus-relay-chain-interface", + "futures", + "futures-timer", + "polkadot-cli", "polkadot-primitives", + "polkadot-service", + "sc-cli", + "sc-client-api", + "sc-network", + "sc-sysinfo", + "sc-telemetry", + "sc-tracing", + "sp-api", + "sp-consensus", + "sp-core", "sp-runtime", "sp-state-machine", - "sp-trie", ] [[package]] -name = "curve25519-dalek" -version = "4.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +name = "cumulus-relay-chain-interface" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" dependencies = [ - "cfg-if", - "cpufeatures", - "curve25519-dalek-derive", - "digest 0.10.7", - "fiat-crypto", - "rustc_version 0.4.1", - "subtle 2.6.1", - "zeroize", + "async-trait", + "cumulus-primitives-core", + "futures", + "jsonrpsee-core", + "parity-scale-codec", + "polkadot-overseer", + "sc-client-api", + "sc-network", + "sp-api", + "sp-blockchain", + "sp-state-machine", + "sp-version", + "thiserror 1.0.69", ] [[package]] -name = "curve25519-dalek-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +name = "cumulus-relay-chain-minimal-node" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" dependencies = [ - "proc-macro2", - "quote", + "array-bytes", + "async-channel 1.9.0", + "async-trait", + "cumulus-client-bootnodes", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "cumulus-relay-chain-rpc-interface", + "futures", + "polkadot-core-primitives", + "polkadot-network-bridge", + "polkadot-node-network-protocol", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "polkadot-service", + "sc-authority-discovery", + "sc-client-api", + "sc-network", + "sc-network-common", + "sc-service", + "sc-tracing", + "sc-utils", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-runtime", + "substrate-prometheus-endpoint", + "tracing", +] + +[[package]] +name = "cumulus-relay-chain-rpc-interface" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "futures", + "futures-timer", + "jsonrpsee", + "parity-scale-codec", + "polkadot-overseer", + "prometheus", + "sc-client-api", + "sc-rpc-api", + "sc-service", + "schnellru", + "serde", + "serde_json", + "sp-authority-discovery", + "sp-consensus-babe", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-storage", + "sp-version", + "substrate-prometheus-endpoint", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "cumulus-relay-chain-streams" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "cumulus-relay-chain-interface", + "futures", + "polkadot-node-subsystem", + "polkadot-primitives", + "sp-api", + "sp-consensus", + "tracing", +] + +[[package]] +name = "cumulus-test-relay-sproof-builder" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "cumulus-primitives-core", + "parity-scale-codec", + "polkadot-primitives", + "sp-runtime", + "sp-state-machine", + "sp-trie", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "rustc_version 0.4.1", + "subtle 2.6.1", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", "syn 2.0.104", ] @@ -5609,6 +5993,27 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" +[[package]] +name = "dyn-clonable" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a36efbb9bfd58e1723780aa04b61aba95ace6a05d9ffabfdb0b43672552f0805" +dependencies = [ + "dyn-clonable-impl", + "dyn-clone", +] + +[[package]] +name = "dyn-clonable-impl" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8671d54058979a37a26f3511fbf8d198ba1aa35ffb202c42587d918d77213a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "dyn-clone" version = "1.0.19" @@ -6129,6 +6534,30 @@ dependencies = [ "bytes", ] +[[package]] +name = "fatality" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec6f82451ff7f0568c6181287189126d492b5654e30a788add08027b6363d019" +dependencies = [ + "fatality-proc-macro", + "thiserror 1.0.69", +] + +[[package]] +name = "fatality-proc-macro" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb42427514b063d97ce21d5199f36c0c307d981434a6be32582bc79fe5bd2303" +dependencies = [ + "expander", + "indexmap 2.10.0", + "proc-macro-crate 3.3.0", + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "fd-lock" version = "4.0.4" @@ -6242,6 +6671,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "fixedbitset" version = "0.5.7" @@ -7277,6 +7712,71 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "frame-benchmarking-cli" +version = "32.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "Inflector", + "array-bytes", + "chrono", + "clap", + "comfy-table", + "cumulus-client-parachain-inherent", + "cumulus-primitives-proof-size-hostfunction", + "env_filter", + "frame-benchmarking", + "frame-storage-access-test-runtime", + "frame-support", + "frame-system", + "gethostname", + "handlebars 5.1.2", + "itertools 0.11.0", + "linked-hash-map", + "log", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-primitives", + "rand 0.8.5", + "rand_pcg", + "sc-block-builder", + "sc-chain-spec", + "sc-cli", + "sc-client-api", + "sc-client-db", + "sc-executor", + "sc-executor-common", + "sc-executor-wasmtime", + "sc-runtime-utilities", + "sc-service", + "sc-sysinfo", + "serde", + "serde_json", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core", + "sp-database", + "sp-externalities", + "sp-genesis-builder", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-runtime-interface", + "sp-state-machine", + "sp-storage", + "sp-timestamp", + "sp-transaction-pool", + "sp-trie", + "sp-version", + "sp-wasm-interface", + "subxt", + "subxt-signer", + "thiserror 1.0.69", + "thousands", +] + [[package]] name = "frame-benchmarking-pallet-pov" version = "18.0.0" @@ -7379,6 +7879,20 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "frame-storage-access-test-runtime" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "cumulus-pallet-parachain-system", + "parity-scale-codec", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-trie", + "substrate-wasm-builder", +] + [[package]] name = "frame-support" version = "28.0.0" @@ -7535,6 +8049,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "fs4" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29f9df8a11882c4e3335eb2d18a0137c505d9ca927470b0cac9c6f0ae07d28f7" +dependencies = [ + "rustix 0.38.44", + "windows-sys 0.48.0", +] + [[package]] name = "fs4" version = "0.13.1" @@ -7811,6 +8335,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "getrandom" version = "0.2.16" @@ -8036,6 +8570,20 @@ dependencies = [ "crunchy", ] +[[package]] +name = "handlebars" +version = "5.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08485b96a0e6393e9e4d1b8d48cf74ad6c063cd905eb33f42c1ce3f0377539b" +dependencies = [ + "log", + "pest", + "pest_derive", + "serde", + "serde_json", + "thiserror 1.0.69", +] + [[package]] name = "handlebars" version = "6.3.2" @@ -8970,6 +9518,15 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "is_executable" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baabb8b4867b26294d818bf3f651a454b6901431711abb96e296245888d6e8c4" +dependencies = [ + "windows-sys 0.60.2", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -9465,7 +10022,7 @@ dependencies = [ "ena", "itertools 0.14.0", "lalrpop-util", - "petgraph", + "petgraph 0.7.1", "regex", "regex-syntax", "sha3", @@ -9485,6 +10042,17 @@ dependencies = [ "rustversion", ] +[[package]] +name = "landlock" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9baa9eeb6e315942429397e617a190f4fdc696ef1ee0342939d641029cbb4ea7" +dependencies = [ + "enumflags2", + "libc", + "thiserror 1.0.69", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -10471,7 +11039,7 @@ dependencies = [ "clap_complete", "elasticlunr-rs", "env_logger", - "handlebars", + "handlebars 6.3.2", "hex", "log", "memchr", @@ -10662,6 +11230,40 @@ dependencies = [ "zeroize", ] +[[package]] +name = "mmr-gadget" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "futures", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-offchain", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-consensus-beefy", + "sp-core", + "sp-mmr-primitives", + "sp-runtime", +] + +[[package]] +name = "mmr-rpc" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "jsonrpsee", + "parity-scale-codec", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-mmr-primitives", + "sp-runtime", +] + [[package]] name = "mockall" version = "0.13.1" @@ -10847,6 +11449,12 @@ dependencies = [ "rand 0.8.5", ] +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" + [[package]] name = "netlink-packet-core" version = "0.7.0" @@ -11463,6 +12071,39 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "orchestra" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19051f0b0512402f5d52d6776999f55996f01887396278aeeccbbdfbc83eef2d" +dependencies = [ + "async-trait", + "dyn-clonable", + "futures", + "futures-timer", + "orchestra-proc-macro", + "pin-project 1.1.10", + "prioritized-metered-channel", + "thiserror 1.0.69", + "tracing", +] + +[[package]] +name = "orchestra-proc-macro" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43dfaf083aef571385fccfdc3a2f8ede8d0a1863160455d4f2b014d8f7d04a3f" +dependencies = [ + "expander", + "indexmap 2.10.0", + "itertools 0.11.0", + "petgraph 0.6.5", + "proc-macro-crate 3.3.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "outref" version = "0.5.2" @@ -13378,6 +14019,22 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-transaction-payment-rpc" +version = "30.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "jsonrpsee", + "pallet-transaction-payment-rpc-runtime-api", + "parity-scale-codec", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-rpc", + "sp-runtime", + "sp-weights", +] + [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "28.0.0" @@ -13917,13 +14574,23 @@ dependencies = [ "sha2 0.10.9", ] +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset 0.4.2", + "indexmap 2.10.0", +] + [[package]] name = "petgraph" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ - "fixedbitset", + "fixedbitset 0.5.7", "indexmap 2.10.0", ] @@ -14086,6 +14753,85 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +[[package]] +name = "polkadot-approval-distribution" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "futures", + "futures-timer", + "itertools 0.11.0", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-bitfield-distribution" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "futures", + "futures-timer", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-distribution" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "fatality", + "futures", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "sc-network", + "schnellru", + "sp-core", + "sp-keystore", + "thiserror 1.0.69", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-recovery" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "fatality", + "futures", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "sc-network", + "schnellru", + "thiserror 1.0.69", + "tokio", + "tracing-gum", +] + [[package]] name = "polkadot-ckb-merkle-mountain-range" version = "0.8.1" @@ -14097,130 +14843,791 @@ dependencies = [ ] [[package]] -name = "polkadot-core-primitives" +name = "polkadot-cli" version = "7.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" dependencies = [ - "parity-scale-codec", - "scale-info", + "clap", + "frame-benchmarking-cli", + "futures", + "log", + "polkadot-node-metrics", + "polkadot-node-primitives", + "polkadot-service", + "sc-cli", + "sc-network-types", + "sc-service", + "sc-storage-monitor", + "sc-sysinfo", + "sc-tracing", "sp-core", + "sp-keyring", "sp-runtime", + "substrate-build-script-utils", + "thiserror 1.0.69", ] [[package]] -name = "polkadot-parachain-primitives" -version = "6.0.0" +name = "polkadot-collator-protocol" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "bitvec", + "fatality", + "futures", + "futures-timer", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "schnellru", + "sp-core", + "sp-keystore", + "sp-runtime", + "thiserror 1.0.69", + "tokio-util", + "tracing-gum", +] + +[[package]] +name = "polkadot-core-primitives" +version = "7.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" dependencies = [ - "array-bytes", - "bounded-collections 0.3.2", - "derive_more 0.99.20", "parity-scale-codec", - "polkadot-core-primitives", "scale-info", - "serde", "sp-core", "sp-runtime", - "sp-weights", ] [[package]] -name = "polkadot-primitives" +name = "polkadot-dispute-distribution" version = "7.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" dependencies = [ - "bitvec", - "bounded-collections 0.3.2", - "hex-literal", - "log", + "fatality", + "futures", + "futures-timer", + "indexmap 2.10.0", "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-parachain-primitives", - "scale-info", - "serde", - "sp-api", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sc-network", "sp-application-crypto", - "sp-arithmetic", - "sp-authority-discovery", - "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-io", "sp-keystore", - "sp-runtime", - "sp-staking", - "sp-std", "thiserror 1.0.69", + "tracing-gum", ] [[package]] -name = "polkadot-runtime-common" +name = "polkadot-erasure-coding" version = "7.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" dependencies = [ - "bitvec", - "frame-benchmarking", - "frame-election-provider-support", - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "libsecp256k1", - "log", - "pallet-asset-rate", - "pallet-authorship", - "pallet-balances", - "pallet-broker", - "pallet-election-provider-multi-phase", - "pallet-fast-unstake", - "pallet-identity", - "pallet-session", - "pallet-staking", - "pallet-staking-reward-fn", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-treasury", - "pallet-vesting", "parity-scale-codec", + "polkadot-node-primitives", "polkadot-primitives", - "polkadot-runtime-parachains", - "rustc-hex", - "scale-info", - "serde", - "slot-range-helper", - "sp-api", + "reed-solomon-novelpoly", "sp-core", - "sp-inherents", - "sp-io", - "sp-keyring", - "sp-npos-elections", - "sp-runtime", - "sp-session", - "sp-staking", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", - "static_assertions", + "sp-trie", + "thiserror 1.0.69", ] [[package]] -name = "polkadot-runtime-metrics" +name = "polkadot-gossip-support" version = "7.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" dependencies = [ - "bs58", - "frame-benchmarking", - "parity-scale-codec", + "futures", + "futures-timer", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-tracing", + "rand 0.8.5", + "rand_chacha 0.3.1", + "sc-network", + "sp-application-crypto", + "sp-core", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?branch=master)", + "sp-keystore", + "tracing-gum", ] [[package]] -name = "polkadot-runtime-parachains" +name = "polkadot-network-bridge" version = "7.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" dependencies = [ - "bitflags 1.3.2", - "bitvec", + "always-assert", + "async-trait", + "bytes", + "fatality", + "futures", + "parity-scale-codec", + "parking_lot 0.12.4", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "sc-network", + "sp-consensus", + "thiserror 1.0.69", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-collation-generation" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "futures", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "schnellru", + "sp-core", + "thiserror 1.0.69", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-approval-voting" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "bitvec", + "derive_more 0.99.20", + "futures", + "futures-timer", + "itertools 0.11.0", + "merlin", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "sc-keystore", + "schnellru", + "schnorrkel 0.11.5", + "sp-application-crypto", + "sp-consensus", + "sp-consensus-slots", + "sp-runtime", + "thiserror 1.0.69", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-approval-voting-parallel" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "futures", + "itertools 0.11.0", + "polkadot-approval-distribution", + "polkadot-node-core-approval-voting", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "rand 0.8.5", + "rand_core 0.6.4", + "sc-keystore", + "sp-consensus", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-av-store" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "bitvec", + "futures", + "futures-timer", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-consensus", + "thiserror 1.0.69", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-backing" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "bitvec", + "fatality", + "futures", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-statement-table", + "schnellru", + "sp-keystore", + "thiserror 1.0.69", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-bitfield-signing" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "futures", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-keystore", + "thiserror 1.0.69", + "tracing-gum", + "wasm-timer", +] + +[[package]] +name = "polkadot-node-core-candidate-validation" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "parity-scale-codec", + "polkadot-node-core-pvf", + "polkadot-node-metrics", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-parachain-primitives", + "polkadot-primitives", + "sp-application-crypto", + "sp-keystore", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-chain-api" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "futures", + "polkadot-node-metrics", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "sc-client-api", + "sc-consensus-babe", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-chain-selection" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "futures", + "futures-timer", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror 1.0.69", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-dispute-coordinator" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "fatality", + "futures", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sc-keystore", + "schnellru", + "thiserror 1.0.69", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-parachains-inherent" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "sp-blockchain", + "sp-inherents", + "thiserror 1.0.69", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-prospective-parachains" +version = "6.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "fatality", + "futures", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror 1.0.69", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-provisioner" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "bitvec", + "fatality", + "futures", + "futures-timer", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sc-consensus-slots", + "schnellru", + "thiserror 1.0.69", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-pvf" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "always-assert", + "array-bytes", + "futures", + "futures-timer", + "parity-scale-codec", + "pin-project 1.1.10", + "polkadot-node-core-pvf-common", + "polkadot-node-metrics", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-parachain-primitives", + "polkadot-primitives", + "rand 0.8.5", + "sc-tracing", + "slotmap", + "sp-core", + "strum 0.26.3", + "tempfile", + "thiserror 1.0.69", + "tokio", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-pvf-checker" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "futures", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-keystore", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-pvf-common" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "cpu-time", + "futures", + "landlock", + "libc", + "nix 0.29.0", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-parachain-primitives", + "polkadot-primitives", + "sc-executor", + "sc-executor-common", + "sc-executor-wasmtime", + "seccompiler", + "sp-core", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?branch=master)", + "sp-externalities", + "sp-io", + "sp-tracing", + "thiserror 1.0.69", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-runtime-api" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "futures", + "polkadot-node-metrics", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "polkadot-primitives", + "schnellru", + "sp-consensus-babe", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-metrics" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "bs58", + "futures", + "futures-timer", + "parity-scale-codec", + "polkadot-primitives", + "prioritized-metered-channel", + "sc-cli", + "sc-service", + "sc-tracing", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "polkadot-node-network-protocol" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-channel 1.9.0", + "async-trait", + "bitvec", + "derive_more 0.99.20", + "fatality", + "futures", + "hex", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-primitives", + "rand 0.8.5", + "sc-authority-discovery", + "sc-network", + "sc-network-types", + "sp-runtime", + "strum 0.26.3", + "thiserror 1.0.69", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-primitives" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "bitvec", + "bounded-vec", + "futures", + "futures-timer", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-primitives", + "sc-keystore", + "schnorrkel 0.11.5", + "serde", + "sp-application-crypto", + "sp-consensus-babe", + "sp-consensus-slots", + "sp-keystore", + "sp-maybe-compressed-blob", + "thiserror 1.0.69", + "zstd 0.12.4", +] + +[[package]] +name = "polkadot-node-subsystem" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "polkadot-node-subsystem-types", + "polkadot-overseer", +] + +[[package]] +name = "polkadot-node-subsystem-types" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "derive_more 0.99.20", + "fatality", + "futures", + "orchestra", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-primitives", + "polkadot-statement-table", + "sc-client-api", + "sc-network", + "sc-network-types", + "sc-transaction-pool-api", + "smallvec", + "sp-api", + "sp-authority-discovery", + "sp-blockchain", + "sp-consensus-babe", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", +] + +[[package]] +name = "polkadot-node-subsystem-util" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "fatality", + "futures", + "itertools 0.11.0", + "kvdb", + "parity-db", + "parity-scale-codec", + "parking_lot 0.12.4", + "polkadot-erasure-coding", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "polkadot-overseer", + "polkadot-primitives", + "prioritized-metered-channel", + "rand 0.8.5", + "schnellru", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "thiserror 1.0.69", + "tracing-gum", +] + +[[package]] +name = "polkadot-overseer" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "orchestra", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem-types", + "polkadot-primitives", + "sc-client-api", + "sp-core", + "tikv-jemalloc-ctl", + "tracing-gum", +] + +[[package]] +name = "polkadot-parachain-primitives" +version = "6.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "array-bytes", + "bounded-collections 0.3.2", + "derive_more 0.99.20", + "parity-scale-codec", + "polkadot-core-primitives", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "polkadot-primitives" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "bitvec", + "bounded-collections 0.3.2", + "hex-literal", + "log", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-authority-discovery", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-staking", + "sp-std", + "thiserror 1.0.69", +] + +[[package]] +name = "polkadot-primitives-test-helpers" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "parity-scale-codec", + "polkadot-primitives", + "rand 0.8.5", + "scale-info", + "sp-application-crypto", + "sp-core", + "sp-keyring", + "sp-runtime", +] + +[[package]] +name = "polkadot-rpc" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "jsonrpsee", + "mmr-rpc", + "pallet-transaction-payment-rpc", + "polkadot-primitives", + "sc-chain-spec", + "sc-client-api", + "sc-consensus-babe", + "sc-consensus-babe-rpc", + "sc-consensus-beefy", + "sc-consensus-beefy-rpc", + "sc-consensus-grandpa", + "sc-consensus-grandpa-rpc", + "sc-rpc", + "sc-sync-state-rpc", + "sc-transaction-pool-api", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-keystore", + "sp-runtime", + "substrate-frame-rpc-system", + "substrate-state-trie-migration-rpc", +] + +[[package]] +name = "polkadot-runtime-common" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "libsecp256k1", + "log", + "pallet-asset-rate", + "pallet-authorship", + "pallet-balances", + "pallet-broker", + "pallet-election-provider-multi-phase", + "pallet-fast-unstake", + "pallet-identity", + "pallet-session", + "pallet-staking", + "pallet-staking-reward-fn", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-treasury", + "pallet-vesting", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info", + "serde", + "slot-range-helper", + "sp-api", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keyring", + "sp-npos-elections", + "sp-runtime", + "sp-session", + "sp-staking", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "static_assertions", +] + +[[package]] +name = "polkadot-runtime-metrics" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "bs58", + "frame-benchmarking", + "parity-scale-codec", + "polkadot-primitives", + "sp-tracing", +] + +[[package]] +name = "polkadot-runtime-parachains" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "bitflags 1.3.2", + "bitvec", "frame-benchmarking", "frame-election-provider-support", "frame-support", @@ -14281,6 +15688,8 @@ dependencies = [ "bridge-hub-common", "bridge-hub-test-utils", "bridge-runtime-common", + "cumulus-client-parachain-inherent", + "cumulus-client-service", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -14572,6 +15981,142 @@ dependencies = [ "sp-version", ] +[[package]] +name = "polkadot-service" +version = "7.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "frame-benchmarking", + "frame-benchmarking-cli", + "frame-system", + "frame-system-rpc-runtime-api", + "futures", + "is_executable", + "kvdb", + "kvdb-rocksdb", + "log", + "mmr-gadget", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "parity-db", + "parity-scale-codec", + "parking_lot 0.12.4", + "polkadot-approval-distribution", + "polkadot-availability-bitfield-distribution", + "polkadot-availability-distribution", + "polkadot-availability-recovery", + "polkadot-collator-protocol", + "polkadot-core-primitives", + "polkadot-dispute-distribution", + "polkadot-gossip-support", + "polkadot-network-bridge", + "polkadot-node-collation-generation", + "polkadot-node-core-approval-voting", + "polkadot-node-core-approval-voting-parallel", + "polkadot-node-core-av-store", + "polkadot-node-core-backing", + "polkadot-node-core-bitfield-signing", + "polkadot-node-core-candidate-validation", + "polkadot-node-core-chain-api", + "polkadot-node-core-chain-selection", + "polkadot-node-core-dispute-coordinator", + "polkadot-node-core-parachains-inherent", + "polkadot-node-core-prospective-parachains", + "polkadot-node-core-provisioner", + "polkadot-node-core-pvf", + "polkadot-node-core-pvf-checker", + "polkadot-node-core-runtime-api", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "polkadot-rpc", + "polkadot-runtime-parachains", + "polkadot-statement-distribution", + "sc-authority-discovery", + "sc-basic-authorship", + "sc-chain-spec", + "sc-client-api", + "sc-consensus", + "sc-consensus-babe", + "sc-consensus-beefy", + "sc-consensus-grandpa", + "sc-consensus-slots", + "sc-executor", + "sc-keystore", + "sc-network", + "sc-network-sync", + "sc-offchain", + "sc-service", + "sc-sync-state-rpc", + "sc-sysinfo", + "sc-telemetry", + "sc-transaction-pool", + "sc-transaction-pool-api", + "serde", + "serde_json", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", + "sp-core", + "sp-genesis-builder", + "sp-inherents", + "sp-io", + "sp-keyring", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-timestamp", + "sp-transaction-pool", + "sp-version", + "sp-weights", + "staging-xcm", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", + "tracing-gum", + "xcm-runtime-apis", +] + +[[package]] +name = "polkadot-statement-distribution" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "bitvec", + "fatality", + "futures", + "futures-timer", + "parity-scale-codec", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-keystore", + "thiserror 1.0.69", + "tracing-gum", +] + +[[package]] +name = "polkadot-statement-table" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "parity-scale-codec", + "polkadot-primitives", + "tracing-gum", +] + [[package]] name = "polkavm" version = "0.30.0" @@ -14826,6 +16371,22 @@ dependencies = [ "uint 0.10.0", ] +[[package]] +name = "prioritized-metered-channel" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a172e6cc603231f2cf004232eabcecccc0da53ba576ab286ef7baa0cfc7927ad" +dependencies = [ + "coarsetime", + "crossbeam-queue", + "derive_more 0.99.20", + "futures", + "futures-timer", + "nanorand", + "thiserror 1.0.69", + "tracing", +] + [[package]] name = "proc-macro-crate" version = "1.1.3" @@ -15047,7 +16608,7 @@ dependencies = [ "log", "multimap", "once_cell", - "petgraph", + "petgraph 0.7.1", "prettyplease", "prost 0.13.5", "prost-types 0.13.5", @@ -15067,7 +16628,7 @@ dependencies = [ "log", "multimap", "once_cell", - "petgraph", + "petgraph 0.7.1", "prettyplease", "prost 0.14.1", "prost-types 0.14.1", @@ -15570,6 +17131,18 @@ dependencies = [ "thiserror 2.0.12", ] +[[package]] +name = "reed-solomon-novelpoly" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87413ebb313323d431e85d0afc5a68222aaed972843537cbfe5f061cf1b4bcab" +dependencies = [ + "derive_more 0.99.20", + "fs-err", + "static_init", + "thiserror 1.0.69", +] + [[package]] name = "ref-cast" version = "1.0.24" @@ -16523,7 +18096,7 @@ dependencies = [ "clap", "const-hex", "dirs 6.0.0", - "fs4", + "fs4 0.13.1", "indicatif", "reqwest", "semver 1.0.26", @@ -16607,6 +18180,38 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "sc-authority-discovery" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "ip_network", + "linked_hash_set", + "log", + "parity-scale-codec", + "prost 0.12.6", + "prost-build 0.13.5", + "rand 0.8.5", + "sc-client-api", + "sc-network", + "sc-network-types", + "sc-service", + "serde", + "serde_json", + "sp-api", + "sp-authority-discovery", + "sp-blockchain", + "sp-core", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", + "tokio", +] + [[package]] name = "sc-basic-authorship" version = "0.34.0" @@ -16769,116 +18374,256 @@ dependencies = [ "sp-arithmetic", "sp-blockchain", "sp-core", - "sp-database", + "sp-database", + "sp-runtime", + "sp-state-machine", + "sp-trie", + "substrate-prometheus-endpoint", + "sysinfo", +] + +[[package]] +name = "sc-consensus" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "futures", + "log", + "mockall", + "parking_lot 0.12.4", + "sc-client-api", + "sc-network-types", + "sc-utils", + "serde", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "sp-state-machine", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", +] + +[[package]] +name = "sc-consensus-aura" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "fork-tree", + "futures", + "log", + "parity-scale-codec", + "parking_lot 0.12.4", + "sc-block-builder", + "sc-client-api", + "sc-consensus", + "sc-consensus-slots", + "sc-telemetry", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-aura", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", +] + +[[package]] +name = "sc-consensus-babe" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "async-trait", + "fork-tree", + "futures", + "log", + "num-bigint", + "num-rational", + "num-traits", + "parity-scale-codec", + "parking_lot 0.12.4", + "sc-client-api", + "sc-consensus", + "sc-consensus-epochs", + "sc-consensus-slots", + "sc-telemetry", + "sc-transaction-pool-api", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-slots", + "sp-core", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?branch=master)", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "sp-timestamp", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", +] + +[[package]] +name = "sc-consensus-babe-rpc" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "futures", + "jsonrpsee", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-rpc-api", + "serde", + "sp-api", + "sp-application-crypto", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-core", + "sp-keystore", "sp-runtime", - "sp-state-machine", - "sp-trie", - "substrate-prometheus-endpoint", - "sysinfo", + "thiserror 1.0.69", ] [[package]] -name = "sc-consensus" -version = "0.33.0" +name = "sc-consensus-beefy" +version = "13.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" dependencies = [ + "array-bytes", + "async-channel 1.9.0", "async-trait", "futures", "log", - "mockall", + "parity-scale-codec", "parking_lot 0.12.4", "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-gossip", + "sc-network-sync", "sc-network-types", "sc-utils", - "serde", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", "sp-blockchain", "sp-consensus", + "sp-consensus-beefy", "sp-core", + "sp-keystore", "sp-runtime", - "sp-state-machine", "substrate-prometheus-endpoint", "thiserror 1.0.69", + "tokio", + "wasm-timer", ] [[package]] -name = "sc-consensus-aura" -version = "0.34.0" +name = "sc-consensus-beefy-rpc" +version = "13.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" dependencies = [ - "async-trait", - "fork-tree", "futures", + "jsonrpsee", "log", "parity-scale-codec", "parking_lot 0.12.4", - "sc-block-builder", - "sc-client-api", - "sc-consensus", - "sc-consensus-slots", - "sc-telemetry", - "sp-api", + "sc-consensus-beefy", + "sc-rpc", + "serde", "sp-application-crypto", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-aura", - "sp-consensus-slots", + "sp-consensus-beefy", "sp-core", - "sp-inherents", - "sp-keystore", "sp-runtime", - "substrate-prometheus-endpoint", "thiserror 1.0.69", ] [[package]] -name = "sc-consensus-babe" -version = "0.34.0" +name = "sc-consensus-epochs" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "fork-tree", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sp-blockchain", + "sp-runtime", +] + +[[package]] +name = "sc-consensus-grandpa" +version = "0.19.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" dependencies = [ + "ahash 0.8.12", + "array-bytes", "async-trait", + "dyn-clone", + "finality-grandpa", "fork-tree", "futures", + "futures-timer", "log", - "num-bigint", - "num-rational", - "num-traits", "parity-scale-codec", "parking_lot 0.12.4", + "rand 0.8.5", + "sc-block-builder", + "sc-chain-spec", "sc-client-api", "sc-consensus", - "sc-consensus-epochs", - "sc-consensus-slots", + "sc-network", + "sc-network-common", + "sc-network-gossip", + "sc-network-sync", + "sc-network-types", "sc-telemetry", "sc-transaction-pool-api", + "sc-utils", + "serde_json", "sp-api", "sp-application-crypto", - "sp-block-builder", + "sp-arithmetic", "sp-blockchain", "sp-consensus", - "sp-consensus-babe", - "sp-consensus-slots", + "sp-consensus-grandpa", "sp-core", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?branch=master)", - "sp-inherents", "sp-keystore", "sp-runtime", - "sp-timestamp", "substrate-prometheus-endpoint", "thiserror 1.0.69", ] [[package]] -name = "sc-consensus-epochs" -version = "0.33.0" +name = "sc-consensus-grandpa-rpc" +version = "0.19.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" dependencies = [ - "fork-tree", + "finality-grandpa", + "futures", + "jsonrpsee", + "log", "parity-scale-codec", "sc-client-api", - "sc-consensus", + "sc-consensus-grandpa", + "sc-rpc", + "serde", "sp-blockchain", + "sp-core", "sp-runtime", + "thiserror 1.0.69", ] [[package]] @@ -17120,6 +18865,25 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "sc-network-gossip" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "ahash 0.8.12", + "futures", + "futures-timer", + "log", + "sc-network", + "sc-network-common", + "sc-network-sync", + "sc-network-types", + "schnellru", + "sp-runtime", + "substrate-prometheus-endpoint", + "tracing", +] + [[package]] name = "sc-network-light" version = "0.33.0" @@ -17216,6 +18980,40 @@ dependencies = [ "zeroize", ] +[[package]] +name = "sc-offchain" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "bytes", + "fnv", + "futures", + "futures-timer", + "http-body-util", + "hyper 1.6.0", + "hyper-rustls", + "hyper-util", + "num_cpus", + "once_cell", + "parity-scale-codec", + "parking_lot 0.12.4", + "rand 0.8.5", + "rustls", + "sc-client-api", + "sc-network", + "sc-network-types", + "sc-transaction-pool-api", + "sc-utils", + "sp-api", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-offchain", + "sp-runtime", + "threadpool", + "tracing", +] + [[package]] name = "sc-proposer-metrics" version = "0.17.0" @@ -17424,6 +19222,38 @@ dependencies = [ "sp-core", ] +[[package]] +name = "sc-storage-monitor" +version = "0.16.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "clap", + "fs4 0.7.0", + "log", + "sp-core", + "thiserror 1.0.69", + "tokio", +] + +[[package]] +name = "sc-sync-state-rpc" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "jsonrpsee", + "parity-scale-codec", + "sc-chain-spec", + "sc-client-api", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-consensus-grandpa", + "serde", + "serde_json", + "sp-blockchain", + "sp-runtime", + "thiserror 1.0.69", +] + [[package]] name = "sc-sysinfo" version = "27.0.0" @@ -17860,6 +19690,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "seccompiler" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345a3e4dddf721a478089d4697b83c6c0a8f5bf16086f6c13397e4534eb6e2e5" +dependencies = [ + "libc", +] + [[package]] name = "secp256k1" version = "0.27.0" @@ -18466,6 +20305,15 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "slotmap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038" +dependencies = [ + "version_check", +] + [[package]] name = "smallvec" version = "1.15.1" @@ -20201,6 +22049,11 @@ dependencies = [ "rustc-hex", ] +[[package]] +name = "substrate-build-script-utils" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" + [[package]] name = "substrate-frame-rpc-support" version = "29.0.0" @@ -20273,6 +22126,23 @@ dependencies = [ "serde_json", ] +[[package]] +name = "substrate-state-trie-migration-rpc" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "jsonrpsee", + "parity-scale-codec", + "sc-client-api", + "sc-rpc-api", + "serde", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-trie", + "trie-db", +] + [[package]] name = "substrate-wasm-builder" version = "17.0.0" @@ -20877,6 +22747,12 @@ dependencies = [ "syn 2.0.104", ] +[[package]] +name = "thousands" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" + [[package]] name = "thread_local" version = "1.1.9" @@ -20895,6 +22771,17 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "tikv-jemalloc-ctl" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f21f216790c8df74ce3ab25b534e0718da5a1916719771d3fec23315c99e468b" +dependencies = [ + "libc", + "paste", + "tikv-jemalloc-sys", +] + [[package]] name = "tikv-jemalloc-sys" version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" @@ -21352,6 +23239,29 @@ dependencies = [ "tracing", ] +[[package]] +name = "tracing-gum" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "coarsetime", + "polkadot-primitives", + "tracing", + "tracing-gum-proc-macro", +] + +[[package]] +name = "tracing-gum-proc-macro" +version = "5.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=master#cf129b7ee727ee7996a82503a83fece35e63e33d" +dependencies = [ + "expander", + "proc-macro-crate 3.3.0", + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "tracing-log" version = "0.2.0" @@ -22037,6 +23947,15 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" +[[package]] +name = "wasix" +version = "0.12.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1fbb4ef9bbca0c1170e0b00dd28abc9e3b68669821600cad1caaed606583c6d" +dependencies = [ + "wasi 0.11.1+wasi-snapshot-preview1", +] + [[package]] name = "wasm-bindgen" version = "0.2.100" diff --git a/crates/anvil-polkadot/Cargo.toml b/crates/anvil-polkadot/Cargo.toml index 8bed82796c440..d4ca0c2367d77 100644 --- a/crates/anvil-polkadot/Cargo.toml +++ b/crates/anvil-polkadot/Cargo.toml @@ -67,6 +67,10 @@ polkadot-sdk = { git = "https://github.com/paritytech/polkadot-sdk.git", branch "substrate-frame-rpc-system", "substrate-rpc-client", "substrate-wasm-builder", + + "cumulus-client-service", + "cumulus-client-parachain-inherent", + "polkadot-primitives", ] } anvil.workspace = true anvil-core.workspace = true @@ -160,3 +164,4 @@ op-alloy-rpc-types.workspace = true [features] default = [] asm-keccak = ["alloy-primitives/asm-keccak"] +forking-tests = [] \ No newline at end of file diff --git a/crates/anvil-polkadot/src/api_server/server.rs b/crates/anvil-polkadot/src/api_server/server.rs index bc67e76fa4749..d9e9b79267c2a 100644 --- a/crates/anvil-polkadot/src/api_server/server.rs +++ b/crates/anvil-polkadot/src/api_server/server.rs @@ -77,6 +77,8 @@ use polkadot_sdk::{ sc_service::{InPoolTransaction, SpawnTaskHandle, TransactionPool}, sp_api::{Metadata as _, ProvideRuntimeApi}, sp_blockchain::Info, + sp_consensus_aura::AuraApi, + sp_consensus_slots::Slot, sp_core::{self, Hasher, keccak_256}, sp_runtime::{FixedU128, traits::BlakeTwo256}, }; @@ -110,6 +112,13 @@ pub struct ApiServer { instance_id: B256, /// Tracks all active filters filters: Filters, + hardcoded_chain_id: u64, +} + +/// Fetch the chain ID from the substrate chain. +async fn chain_id_from_metadata(api: &OnlineClient) -> Result { + let query = subxt_client::constants().revive().chain_id(); + api.constants().at(&query).map_err(|err| err.into()) } impl ApiServer { @@ -138,6 +147,16 @@ impl ApiServer { ) .await?; + let backend = BackendWithOverlay::new( + substrate_service.backend.clone(), + substrate_service.storage_overrides.clone(), + ); + + // When forking we need to use the chain ID of the forked network, but for non-forking we do + // not want to use this as we allow for the chain_id to be customized. So we will + // not write this to the backend, but cache it to use if we are forking. + let chain_id = chain_id_from_metadata(&api).await?; + let filters_clone = filters.clone(); substrate_service.spawn_handle.spawn("filter-eviction-task", "None", async move { eviction_task(filters_clone).await; @@ -146,10 +165,7 @@ impl ApiServer { block_provider, req_receiver, logging_manager, - backend: BackendWithOverlay::new( - substrate_service.backend.clone(), - substrate_service.storage_overrides.clone(), - ), + backend, client: substrate_service.client.clone(), mining_engine: substrate_service.mining_engine.clone(), eth_rpc_client, @@ -159,6 +175,7 @@ impl ApiServer { wallet: DevSigner::new(signers)?, instance_id: B256::random(), filters, + hardcoded_chain_id: chain_id, }) } @@ -589,6 +606,14 @@ impl ApiServer { // Inject the new time if the timestamp precedes last block time if time_ms < last_block_timestamp { self.backend.inject_timestamp(latest_block, time_ms); + let current_aura_slot = self.backend.read_aura_current_slot(latest_block)?; + let updated_aura_slot = time_ms + .saturating_div(self.client.runtime_api().slot_duration(latest_block)?.as_millis()); + if current_aura_slot > updated_aura_slot { + self.backend.inject_aura_current_slot(latest_block, Slot::from(updated_aura_slot)); + self.backend + .inject_relay_slot_info(latest_block, (Slot::from(updated_aura_slot), 0)); + } } Ok(self.mining_engine.set_time(Duration::from_secs(time))) } @@ -613,7 +638,11 @@ impl ApiServer { } fn chain_id(&self, at: Hash) -> u64 { - self.backend.read_chain_id(at).expect("Chain ID is populated on genesis") + self.backend + .read_chain_id(at) + // If chain_id is not found in the backend, we are forking so use the cached chain_id + // from the forked network + .unwrap_or(self.hardcoded_chain_id) } // Eth RPCs diff --git a/crates/anvil-polkadot/src/lib.rs b/crates/anvil-polkadot/src/lib.rs index 413a9ed4b1545..455c9bd832c3a 100644 --- a/crates/anvil-polkadot/src/lib.rs +++ b/crates/anvil-polkadot/src/lib.rs @@ -119,6 +119,7 @@ pub async fn spawn( // Spawn the substrate node. let (substrate_service, task_manager) = substrate_node::service::new(&anvil_config, substrate_config) + .await .map_err(sc_cli::Error::Service)?; let revert_manager = RevertManager::new(substrate_service.client.clone(), substrate_service.backend.clone()); diff --git a/crates/anvil-polkadot/src/substrate_node/service/backend.rs b/crates/anvil-polkadot/src/substrate_node/service/backend.rs index 89cb5b522c4f5..c99fb6a7c57d0 100644 --- a/crates/anvil-polkadot/src/substrate_node/service/backend.rs +++ b/crates/anvil-polkadot/src/substrate_node/service/backend.rs @@ -13,6 +13,7 @@ use polkadot_sdk::{ parachains_common::{AccountId, Hash, opaque::Block}, sc_client_api::{Backend as BackendT, StateBackend, TrieCacheContext}, sp_blockchain, + sp_consensus_slots::Slot, sp_core::{H160, H256}, sp_io::hashing::blake2_256, sp_runtime::FixedU128, @@ -39,6 +40,12 @@ pub enum BackendError { MissingNextFeeMultiplier, #[error("Could not find block number in the state")] MissingBlockNumber, + #[error("Could not find relay slot info in the state")] + MissingRelaySlotInfo, + #[error("Could not find last relay block number in the state")] + MissingLastRelayBlockNumber, + #[error("Could not find aura current slot in the state")] + MissingAuraCurrentSlot, #[error("Unable to decode total issuance {0}")] DecodeTotalIssuance(codec::Error), #[error("Unable to decode chain id {0}")] @@ -59,6 +66,12 @@ pub enum BackendError { DecodeAuraAuthorities(codec::Error), #[error("Unable to decode the next fee multiplier: {0}")] DecodeNextFeeMultiplier(codec::Error), + #[error("Unable to decode relay slot info: {0}")] + DecodeRelaySlotInfo(codec::Error), + #[error("Unable to decode last relay block number: {0}")] + DecodeLastRelayBlockNumber(codec::Error), + #[error("Unable to decode aura current slot: {0}")] + DecodeAuraCurrentSlot(codec::Error), } type Result = std::result::Result; @@ -85,6 +98,31 @@ impl BackendWithOverlay { u64::decode(&mut &value[..]).map_err(BackendError::DecodeTimestamp) } + pub fn read_relay_slot_info(&self, hash: Hash) -> Result<(Slot, u32)> { + let key = well_known_keys::RELAY_SLOT_INFO; + + let value = + self.read_top_state(hash, key.to_vec())?.ok_or(BackendError::MissingRelaySlotInfo)?; + <(Slot, u32)>::decode(&mut &value[..]).map_err(BackendError::DecodeRelaySlotInfo) + } + + pub fn read_last_relay_chain_block_number(&self, hash: Hash) -> Result { + let key = well_known_keys::LAST_RELAY_CHAIN_BLOCK_NUMBER; + + let value = self + .read_top_state(hash, key.to_vec())? + .ok_or(BackendError::MissingLastRelayBlockNumber)?; + u32::decode(&mut &value[..]).map_err(BackendError::DecodeLastRelayBlockNumber) + } + + pub fn read_aura_current_slot(&self, hash: Hash) -> Result { + let key = well_known_keys::CURRENT_SLOT; + + let value = + self.read_top_state(hash, key.to_vec())?.ok_or(BackendError::MissingAuraCurrentSlot)?; + Slot::decode(&mut &value[..]).map_err(BackendError::DecodeAuraCurrentSlot) + } + pub fn read_block_number(&self, hash: Hash) -> Result { let key = well_known_keys::BLOCK_NUMBER_KEY; let value = @@ -174,6 +212,21 @@ impl BackendWithOverlay { overrides.set_timestamp(at, timestamp); } + pub fn inject_relay_slot_info(&self, at: Hash, slot_info: (Slot, u32)) { + let mut overrides = self.overrides.lock(); + overrides.set_relay_slot_info(at, slot_info); + } + + pub fn inject_last_relay_chain_block_number(&self, at: Hash, number: u32) { + let mut overrides = self.overrides.lock(); + overrides.set_last_relay_chain_block_number(at, number); + } + + pub fn inject_aura_current_slot(&self, at: Hash, slot: Slot) { + let mut overrides = self.overrides.lock(); + overrides.set_aura_current_slot(at, slot); + } + pub fn inject_chain_id(&self, at: Hash, chain_id: u64) { let mut overrides = self.overrides.lock(); overrides.set_chain_id(at, chain_id); @@ -273,6 +326,29 @@ impl StorageOverrides { self.add(latest_block, changeset); } + fn set_relay_slot_info(&mut self, latest_block: Hash, slot_info: (Slot, u32)) { + let mut changeset = BlockOverrides::default(); + changeset.top.insert(well_known_keys::RELAY_SLOT_INFO.to_vec(), Some(slot_info.encode())); + + self.add(latest_block, changeset); + } + + fn set_last_relay_chain_block_number(&mut self, latest_block: Hash, number: u32) { + let mut changeset = BlockOverrides::default(); + changeset + .top + .insert(well_known_keys::LAST_RELAY_CHAIN_BLOCK_NUMBER.to_vec(), Some(number.encode())); + + self.add(latest_block, changeset); + } + + fn set_aura_current_slot(&mut self, latest_block: Hash, slot: Slot) { + let mut changeset = BlockOverrides::default(); + changeset.top.insert(well_known_keys::CURRENT_SLOT.to_vec(), Some(slot.encode())); + + self.add(latest_block, changeset); + } + fn set_coinbase(&mut self, latest_block: Hash, aura_authority: AccountId) { let mut changeset = BlockOverrides::default(); changeset.top.insert( diff --git a/crates/anvil-polkadot/src/substrate_node/service/client.rs b/crates/anvil-polkadot/src/substrate_node/service/client.rs index ecff6892757e4..d6bc9df303779 100644 --- a/crates/anvil-polkadot/src/substrate_node/service/client.rs +++ b/crates/anvil-polkadot/src/substrate_node/service/client.rs @@ -1,6 +1,5 @@ use crate::{ AnvilNodeConfig, - config::ForkChoice, substrate_node::{ genesis::DevelopmentGenesisBlockBuilder, lazy_loading::{ @@ -25,10 +24,7 @@ use polkadot_sdk::{ sp_blockchain, sp_core::storage::well_known_keys::CODE, sp_keystore::KeystorePtr, - sp_runtime::{ - generic::SignedBlock, - traits::{Block as BlockT, Header as HeaderT}, - }, + sp_runtime::generic::SignedBlock, sp_storage::StorageKey, }; use std::{collections::HashMap, sync::Arc, time::Duration}; @@ -41,10 +37,11 @@ pub fn new_client( config: &mut sc_service::Configuration, executor: WasmExecutor, storage_overrides: Arc>, + genesis_num: u64, ) -> Result<(Arc, Arc, KeystorePtr, TaskManager), sc_service::error::Error> { let fork_config: Option<(Arc>, Block)> = if let Some(fork_url) = &anvil_config.eth_rpc_url { - let (rpc_client, checkpoint_block) = setup_fork(anvil_config, config, fork_url)?; + let (rpc_client, checkpoint_block) = setup_fork(config, fork_url, genesis_num)?; Some((rpc_client, checkpoint_block)) } else { None @@ -125,50 +122,11 @@ pub fn new_client( Ok((Arc::new(client), backend, keystore_container.keystore(), task_manager)) } -/// Resolves the block number to fork from, handling both positive and negative block numbers. -/// Negative numbers are subtracted from the latest block number. -fn resolve_fork_block_number( - rpc_client: &Rpc, - fork_choice: &ForkChoice, -) -> Result { - match fork_choice { - ForkChoice::Block(block_number) => { - if *block_number < 0 { - // Get the latest block from the chain header - let latest_header = rpc_client - .header(None) - .map_err(|e| { - sp_blockchain::Error::Backend(format!("failed to fetch latest header: {e}")) - })? - .ok_or_else(|| { - sp_blockchain::Error::Backend("latest header not found".into()) - })?; - - let latest_number: u32 = *latest_header.number(); - - let offset: u32 = block_number.abs().try_into().map_err(|_| { - sp_blockchain::Error::Backend(format!( - "Block number offset too large: {block_number}" - )) - })?; - - Ok(latest_number.saturating_sub(offset)) - } else { - (*block_number).try_into().map_err(|_| { - sp_blockchain::Error::Backend(format!( - "Invalid fork block number: {block_number}" - )) - }) - } - } - } -} - /// Fetches the checkpoint block and sets up the chain spec for forking fn setup_fork( - anvil_config: &AnvilNodeConfig, config: &mut sc_service::Configuration, fork_url: &str, + genesis_num: u64, ) -> Result<(Arc>, Block), sc_service::error::Error> { let http_client = jsonrpsee::http_client::HttpClientBuilder::default() .max_request_size(u32::MAX) @@ -188,35 +146,17 @@ fn setup_fork( sp_blockchain::Error::Backend(format!("failed to fetch system_properties: {e}")) })?; - // Get block hash from fork_choice config - // If no fork_choice is specified, we need to fetch the latest block and use its hash - // for all subsequent requests to avoid inconsistencies if a new block is mined between calls. - let block_hash: ::Hash = if let Some(fork_choice) = &anvil_config.fork_choice { - let block_num = resolve_fork_block_number(&rpc_client, fork_choice)?; - rpc_client - .block_hash(Some(block_num)) - .map_err(|e| { - sp_blockchain::Error::Backend(format!( - "failed to fetch block hash for block {block_num}: {e}" - )) - })? - .ok_or_else(|| { - sp_blockchain::Error::Backend(format!("block hash not found for block {block_num}")) - })? - } else { - // No fork_choice specified, fetch the latest block header and use its hash - let latest_header = rpc_client - .header(None) - .map_err(|e| { - sp_blockchain::Error::Backend(format!( - "failed to fetch latest header for fork: {e}" - )) - })? - .ok_or_else(|| { - sp_blockchain::Error::Backend("latest header not found for fork".into()) - })?; - latest_header.hash() - }; + let block_num = genesis_num as u32; + let block_hash = rpc_client + .block_hash(Some(block_num)) + .map_err(|e| { + sp_blockchain::Error::Backend(format!( + "failed to fetch block hash for block {block_num}: {e}" + )) + })? + .ok_or_else(|| { + sp_blockchain::Error::Backend(format!("block hash not found for block {block_num}")) + })?; let wasm_binary = rpc_client .storage(StorageKey(CODE.to_vec()), Some(block_hash)) diff --git a/crates/anvil-polkadot/src/substrate_node/service/consensus.rs b/crates/anvil-polkadot/src/substrate_node/service/consensus.rs deleted file mode 100644 index 7e0f058970932..0000000000000 --- a/crates/anvil-polkadot/src/substrate_node/service/consensus.rs +++ /dev/null @@ -1,57 +0,0 @@ -use polkadot_sdk::{ - sc_consensus::BlockImportParams, - sc_consensus_aura::CompatibleDigestItem, - sc_consensus_manual_seal::{ConsensusDataProvider, Error}, - sp_consensus_aura::ed25519::AuthoritySignature, - sp_consensus_babe::Slot, - sp_inherents::InherentData, - sp_runtime::{Digest, DigestItem, traits::Block as BlockT}, -}; -use std::marker::PhantomData; - -/// Consensus data provider for Aura. This will always use slot 0 (used to determine the -/// index of the AURA authority from the authorities set by AURA runtimes) for the aura -/// digest since anvil-polkadot node will be the sole block author and AURA will pick -/// only its configured address, residing at index 0 in the AURA authorities set. When -/// forking from an assethub chain, we expect an assethub runtime based on AURA, -/// which will pick the author based on the slot given through the digest, which will -/// also result in picking the AURA authority from index 0. -pub struct SameSlotConsensusDataProvider { - _phantom: PhantomData<(B, P)>, -} - -impl SameSlotConsensusDataProvider { - pub fn new() -> Self { - Self { _phantom: PhantomData } - } -} - -impl ConsensusDataProvider for SameSlotConsensusDataProvider -where - B: BlockT, - P: Send + Sync, -{ - type Proof = P; - - fn create_digest( - &self, - _parent: &B::Header, - _inherents: &InherentData, - ) -> Result { - let digest_item = >::aura_pre_digest( - Slot::default(), - ); - - Ok(Digest { logs: vec![digest_item] }) - } - - fn append_block_import( - &self, - _parent: &B::Header, - _params: &mut BlockImportParams, - _inherents: &InherentData, - _proof: Self::Proof, - ) -> Result<(), Error> { - Ok(()) - } -} diff --git a/crates/anvil-polkadot/src/substrate_node/service/executor.rs b/crates/anvil-polkadot/src/substrate_node/service/executor.rs index cadcb075ba450..58b0491b95369 100644 --- a/crates/anvil-polkadot/src/substrate_node/service/executor.rs +++ b/crates/anvil-polkadot/src/substrate_node/service/executor.rs @@ -4,13 +4,14 @@ use crate::substrate_node::{ }; use parking_lot::Mutex; use polkadot_sdk::{ + cumulus_client_service::ParachainHostFunctions, parachains_common::{Hash, opaque::Block}, sc_client_api::{Backend as _, CallExecutor, execution_extensions::ExecutionExtensions}, sc_executor::{self, RuntimeVersion, RuntimeVersionOf}, sc_service, sp_api::{CallContext, ProofRecorder}, sp_blockchain::{self, HeaderBackend}, - sp_core, sp_externalities, sp_io, + sp_core, sp_externalities, sp_runtime::{generic::BlockId, traits::HashingFor}, sp_state_machine::{OverlayedChanges, StorageProof}, sp_storage::ChildInfo, @@ -22,7 +23,7 @@ use std::{cell::RefCell, sync::Arc}; /// Wasm executor which overrides the signature checking host functions for impersonation. pub type WasmExecutor = sc_executor::WasmExecutor< ExtendedHostFunctions< - ExtendedHostFunctions, + ExtendedHostFunctions, PublicKeyToHashOverride, >, >; diff --git a/crates/anvil-polkadot/src/substrate_node/service/mod.rs b/crates/anvil-polkadot/src/substrate_node/service/mod.rs index 73fc44142f79e..a9feb66db3a94 100644 --- a/crates/anvil-polkadot/src/substrate_node/service/mod.rs +++ b/crates/anvil-polkadot/src/substrate_node/service/mod.rs @@ -1,33 +1,44 @@ use crate::{ AnvilNodeConfig, + config::ForkChoice, substrate_node::{ lazy_loading::backend::Backend as LazyLoadingBackend, mining_engine::{MiningEngine, MiningMode, run_mining_engine}, rpc::spawn_rpc_server, - service::consensus::SameSlotConsensusDataProvider, }, }; use anvil::eth::backend::time::TimeManager; +use codec::Encode; use parking_lot::Mutex; use polkadot_sdk::{ - parachains_common::opaque::Block, + cumulus_client_parachain_inherent::MockValidationDataInherentDataProvider, + cumulus_primitives_core::{GetParachainInfo, relay_chain}, + parachains_common::{Hash, opaque::Block}, + polkadot_primitives::HeadData, sc_basic_authorship, sc_consensus, - sc_consensus_manual_seal::{self}, + sc_consensus_manual_seal::{ + ManualSealParams, consensus::aura::AuraConsensusDataProvider, run_manual_seal, + }, sc_service::{ self, Configuration, RpcHandlers, SpawnTaskHandle, TaskManager, error::Error as ServiceError, }, - sc_transaction_pool, sp_timestamp, + sc_transaction_pool, + sp_api::ProvideRuntimeApi, + sp_arithmetic::traits::UniqueSaturatedInto, + sp_consensus_aura::{AuraApi, Slot}, + sp_timestamp, }; use std::sync::Arc; use tokio_stream::wrappers::ReceiverStream; +use subxt::PolkadotConfig; + pub use backend::{BackendError, BackendWithOverlay, StorageOverrides}; pub use client::Client; mod backend; mod client; -mod consensus; mod executor; pub mod storage; @@ -49,17 +60,191 @@ pub struct Service { pub genesis_block_number: u64, } +type CreateInherentDataProviders = Box< + dyn Fn( + Hash, + (), + ) -> futures::future::Ready< + Result< + (sp_timestamp::InherentDataProvider, MockValidationDataInherentDataProvider<()>), + Box, + >, + > + Send + + Sync, +>; + +fn create_manual_seal_inherent_data_providers( + backend: BackendWithOverlay, + client: Arc, + time_manager: Arc, +) -> CreateInherentDataProviders { + Box::new(move |block: Hash, ()| { + let current_para_head = client + .header(block) + .expect("Header lookup should succeed") + .expect("Header passed in as parent should be present in backend."); + + let current_para_block_head = Some(HeadData(current_para_head.encode())); + + let next_block_number = + UniqueSaturatedInto::::unique_saturated_into(current_para_head.number) + 1; + + let duration = client.runtime_api().slot_duration(current_para_head.hash()).map_err(|e| { + ServiceError::Other(format!("retrieving slot duration from runtime: {e}")) + }); + let slot_duration = match duration { + Ok(duration) => duration, + Err(e) => return futures::future::ready(Err(Box::new(e))), + }; + + let id = client + .runtime_api() + .parachain_id(current_para_head.hash()) + .map_err(|e| ServiceError::Other(format!("retrieving para id from runtime: {e}"))); + let para_id = match id { + Ok(id) => id, + Err(e) => return futures::future::ready(Err(Box::new(e))), + }; + + let next_time = time_manager.next_timestamp(); + let parachain_slot = next_time.saturating_div(slot_duration.as_millis()); + + let slot_info = backend.read_relay_slot_info(current_para_head.hash()); + let slot_in_state = match slot_info { + Ok(slot) => slot.0, + Err(_) => Slot::from(0), // For starting from genesis + }; + + let last_block_number = backend + .read_last_relay_chain_block_number(current_para_head.hash()) + .map_err(|e| ServiceError::Other(format!("reading last relay block number: {e}"))); + let last_rc_block_number = last_block_number.unwrap_or_default(); + + // Used to set the relay chain slot provided via the proof (which is represented + // by a set of relay chain state keys). The slot is read from the proof at the moment + // we call consensus hook to perform validations of the relay chain state. We will + // check: + // - Ensures blocks are not produced faster than the specified velocity `V` (however, given + // the nature of the anvil-polkadot mining strategies, we'll hack the check to never fail) + // - Verifies parachain slot alignment with relay chain slot (meaning time passes similarly + // on both chains, and the additional key values set below ensures it) + let additional_key_values = vec![( + relay_chain::well_known_keys::CURRENT_SLOT.to_vec(), + Slot::from(parachain_slot).encode(), + )]; + + // This helps with allowing greater block production velocity per relay chain slot. + backend.inject_relay_slot_info(current_para_head.hash(), (slot_in_state, 0)); + + // Read the DMQ MQC head from parachain storage to avoid "DMQ head mismatch" errors + // The storage key is: twox_128("ParachainSystem") + twox_128("LastDmqMqcHead") + let pallet_prefix = polkadot_sdk::sp_core::twox_128(b"ParachainSystem"); + let storage_prefix = polkadot_sdk::sp_core::twox_128(b"LastDmqMqcHead"); + let mut dmq_storage_key = Vec::new(); + dmq_storage_key.extend_from_slice(&pallet_prefix); + dmq_storage_key.extend_from_slice(&storage_prefix); + + // Read the MessageQueueChain from storage and extract its head hash + use polkadot_sdk::sc_client_api::StorageProvider; + let dmq_mqc_head = client + .storage( + current_para_head.hash(), + &polkadot_sdk::sc_client_api::StorageKey(dmq_storage_key), + ) + .ok() + .flatten() + .and_then(|encoded_data| { + // MessageQueueChain is just a wrapper around a Hash, decode it + // The MessageQueueChain stores the head as the last 32 bytes + if encoded_data.0.len() >= 32 { + let mut hash_bytes = [0u8; 32]; + hash_bytes.copy_from_slice(&encoded_data.0[encoded_data.0.len() - 32..]); + Some(polkadot_sdk::cumulus_primitives_core::relay_chain::Hash::from(hash_bytes)) + } else { + None + } + }) + .unwrap_or_default(); // Use default (zeros) if we can't read it + + let mocked_parachain = MockValidationDataInherentDataProvider::<()> { + current_para_block: next_block_number, + para_id, + // This is used behind the scenes to set the relay parent number + // on top of which we build this block. The new last rc block number + // known by the parachain will be set to the value bellow when the parachain + // block is finalized. + relay_offset: last_rc_block_number + 1, + current_para_block_head, + additional_key_values: Some(additional_key_values), + xcm_config: polkadot_sdk::cumulus_client_parachain_inherent::MockXcmConfig { + starting_dmq_mqc_head: dmq_mqc_head, + ..Default::default() + }, + ..Default::default() + }; + + let timestamp_provider = sp_timestamp::InherentDataProvider::new(next_time.into()); + + futures::future::ready(Ok((timestamp_provider, mocked_parachain))) + }) +} + /// Builds a new service for a full client. -pub fn new( +pub async fn new( anvil_config: &AnvilNodeConfig, mut config: Configuration, ) -> Result<(Service, TaskManager), ServiceError> { + let mut genesis_block_number = anvil_config.get_genesis_number(); + if let Some(ref fork_url) = anvil_config.eth_rpc_url { + // Convert HTTP(S) URL to WebSocket URL for Substrate RPC + // http:// -> ws:// (local/zombienet), https:// -> wss:// (production) + let ws_url = fork_url.replacen("https://", "wss://", 1).replacen("http://", "ws://", 1); + let fork_choice = anvil_config.fork_choice; + + let client = subxt::client::OnlineClient::::from_url(ws_url) + .await + .map_err(|e| ServiceError::Other(format!("fork connection failed: {e}")))?; + + let finalized_block_ref = client + .backend() + .latest_finalized_block_ref() + .await + .map_err(|e| ServiceError::Other(format!("failed to get finalized block: {e}")))?; + let finalized_head_header = client + .backend() + .block_header(finalized_block_ref.hash()) + .await + .map_err(|e| ServiceError::Other(format!("failed to get block header: {e}")))? + .ok_or_else(|| ServiceError::Other("finalized block header not found".into()))?; + let finalized_block_number: u64 = finalized_head_header.number.into(); + + // Apply fork_choice if specified + genesis_block_number = match fork_choice { + Some(ForkChoice::Block(block_num)) => { + if block_num < 0 { + // Negative offset from latest finalized block + let offset = (-block_num) as u64; + finalized_block_number.saturating_sub(offset) + } else { + // Specific block number + block_num as u64 + } + } + None => finalized_block_number, + }; + } + let storage_overrides = Arc::new(Mutex::new(StorageOverrides::new(anvil_config.revive_rpc_block_limit))); let executor = sc_service::new_wasm_executor(&config.executor); - let (client, backend, keystore, mut task_manager) = - client::new_client(anvil_config, &mut config, executor, storage_overrides.clone())?; + let (client, backend, keystore, mut task_manager) = client::new_client( + anvil_config, + &mut config, + executor, + storage_overrides.clone(), + genesis_block_number, + )?; let transaction_pool = Arc::from( sc_transaction_pool::Builder::new( @@ -101,7 +286,7 @@ pub fn new( )); let rpc_handlers = spawn_rpc_server( - anvil_config.get_genesis_number(), + genesis_block_number, &mut task_manager, client.clone(), config, @@ -124,24 +309,25 @@ pub fn new( None, ); - let create_inherent_data_providers = { - move |_, ()| { - let next_timestamp = time_manager.next_timestamp(); - async move { Ok(sp_timestamp::InherentDataProvider::new(next_timestamp.into())) } - } - }; + let aura_digest_provider = AuraConsensusDataProvider::new(client.clone()); + let backend_with_overlay = BackendWithOverlay::new(backend.clone(), storage_overrides.clone()); + let create_inherent_data_providers = create_manual_seal_inherent_data_providers( + backend_with_overlay, + client.clone(), + time_manager, + ); - let params = sc_consensus_manual_seal::ManualSealParams { + let params = ManualSealParams { block_import: client.clone(), env: proposer, client: client.clone(), pool: transaction_pool.clone(), select_chain: SelectChain::new(backend.clone()), commands_stream: Box::pin(commands_stream), - consensus_data_provider: Some(Box::new(SameSlotConsensusDataProvider::new())), + consensus_data_provider: Some(Box::new(aura_digest_provider)), create_inherent_data_providers, }; - let authorship_future = sc_consensus_manual_seal::run_manual_seal(params); + let authorship_future = run_manual_seal(params); task_manager.spawn_essential_handle().spawn_blocking( "manual-seal", @@ -158,7 +344,7 @@ pub fn new( rpc_handlers, mining_engine, storage_overrides, - genesis_block_number: anvil_config.get_genesis_number(), + genesis_block_number, }, task_manager, )) diff --git a/crates/anvil-polkadot/src/substrate_node/service/storage.rs b/crates/anvil-polkadot/src/substrate_node/service/storage.rs index a6553cead52c8..a9c491b99ccbe 100644 --- a/crates/anvil-polkadot/src/substrate_node/service/storage.rs +++ b/crates/anvil-polkadot/src/substrate_node/service/storage.rs @@ -54,6 +54,24 @@ pub mod well_known_keys { 223, 56, 29, 235, 227, 49, 171, 116, 70, 173, 223, 220, ]; + //twox_128(b"AuraExt") + twox_128(b"RelaySlotInfo") + pub const RELAY_SLOT_INFO: [u8; 32] = [ + 60, 49, 29, 87, 212, 218, 245, 41, 4, 97, 108, 246, 150, 72, 8, 30, 75, 249, 42, 122, 69, + 229, 192, 87, 48, 249, 93, 62, 96, 159, 163, 11, + ]; + + //twox_128(b"Aura") + twox_128(b"CurrentSlot") + pub const CURRENT_SLOT: [u8; 32] = [ + 87, 248, 220, 47, 90, 176, 148, 103, 137, 111, 71, 48, 15, 4, 36, 56, 6, 21, 91, 60, 217, + 168, 201, 229, 233, 162, 63, 213, 220, 19, 165, 237, + ]; + + //twox_128(b"ParachainSystem") + twox_128(b"LastRelayChainBlockNumber") + pub const LAST_RELAY_CHAIN_BLOCK_NUMBER: [u8; 32] = [ + 69, 50, 61, 247, 204, 71, 21, 11, 57, 48, 226, 102, 107, 10, 163, 19, 162, 188, 161, 144, + 211, 107, 216, 52, 204, 115, 163, 143, 194, 19, 236, 189, + ]; + pub fn system_account_info(account_id: AccountId) -> Vec { let mut key = Vec::new(); key.extend_from_slice(&twox_128("System".as_bytes())); diff --git a/crates/anvil-polkadot/substrate-runtime/Cargo.toml b/crates/anvil-polkadot/substrate-runtime/Cargo.toml index 308a5822fed0b..208f64debeb36 100644 --- a/crates/anvil-polkadot/substrate-runtime/Cargo.toml +++ b/crates/anvil-polkadot/substrate-runtime/Cargo.toml @@ -24,6 +24,7 @@ polkadot-sdk = { git = "https://github.com/paritytech/polkadot-sdk.git", branch "runtime", "sp-consensus-aura", "with-tracing", + "cumulus-primitives-core", ] } scale-info = { version = "2.11.6", default-features = false } serde_json = { version = "1.0", default-features = false, features = ["alloc"] } diff --git a/crates/anvil-polkadot/substrate-runtime/src/lib.rs b/crates/anvil-polkadot/substrate-runtime/src/lib.rs index 3299e2e9e513f..51f215ec8dab1 100644 --- a/crates/anvil-polkadot/substrate-runtime/src/lib.rs +++ b/crates/anvil-polkadot/substrate-runtime/src/lib.rs @@ -24,9 +24,9 @@ use pallet_revive::{ }; use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use polkadot_sdk::{ + cumulus_primitives_core::ParaId, parachains_common::{ - AccountId, AssetHubPolkadotAuraId as AuraId, BlockNumber, Hash as CommonHash, Header, - Nonce, Signature, + AccountId, AuraId, BlockNumber, Hash as CommonHash, Header, Nonce, Signature, }, polkadot_runtime_common::SlowAdjustingFeeUpdate, polkadot_sdk_frame::{ @@ -451,4 +451,11 @@ pallet_revive::impl_runtime_apis_plus_revive_traits!( } } + impl cumulus_primitives_core::GetParachainInfo for Runtime { + fn parachain_id() -> ParaId { + // The usual paraId for assethub + ParaId::new(1000) + } + } + ); diff --git a/crates/anvil-polkadot/tests/it/forking.rs b/crates/anvil-polkadot/tests/it/forking.rs index b9ae25d68d4c5..d8bd824fa325a 100644 --- a/crates/anvil-polkadot/tests/it/forking.rs +++ b/crates/anvil-polkadot/tests/it/forking.rs @@ -14,6 +14,12 @@ use anvil_polkadot::{ }; use polkadot_sdk::pallet_revive::evm::Account; +/// Westend Asset Hub zombienet local URL for forking tests +/// This URL should point to a running zombienet instance, +/// so running the tests depending on it should be preceded +/// by setting up a zombienet network with a running RPC. +const WESTEND_ASSET_HUB_URL: &str = "http://127.0.0.1:63982"; + /// Tests that forking preserves state from the source chain and allows local modifications #[tokio::test(flavor = "multi_thread")] async fn test_fork_preserves_state_and_allows_modifications() { @@ -591,3 +597,483 @@ async fn test_fork_with_contract_deployment() { "Fork should have the same contract 3 state (300) as source" ); } + +// ============================================================================= +// Tests forking from external Westend Asset Hub zombienet +// These tests require a running zombienet instance at WESTEND_ASSET_HUB_URL +// ============================================================================= + +/// Helper to create a fork config pointing to Westend Asset Hub zombienet +fn westend_fork_config() -> AnvilNodeConfig { + AnvilNodeConfig::test_config() + .with_port(0) + .with_eth_rpc_url(Some(WESTEND_ASSET_HUB_URL.to_string())) +} + +/// Tests that we can fork from Westend Asset Hub and get balance of addresses +#[tokio::test(flavor = "multi_thread")] +async fn test_fork_eth_get_balance_from_westend() { + let fork_config = westend_fork_config(); + let fork_substrate_config = SubstrateNodeConfig::new(&fork_config); + let mut fork_node = TestNode::new(fork_config.clone(), fork_substrate_config).await.unwrap(); + + // Get dev account + let alith = Account::from(subxt_signer::eth::dev::alith()); + + // Get balance from forked state + let alith_balance = fork_node.get_balance(alith.address(), None).await; + + // Mine a block and verify we can still get balances + unwrap_response::<()>(fork_node.eth_rpc(EthRequest::Mine(None, None)).await.unwrap()).unwrap(); + + let alith_balance_after_mine = fork_node.get_balance(alith.address(), None).await; + + // Balance should be the same (no transactions were made) + assert_eq!( + alith_balance, alith_balance_after_mine, + "Balance should not change after mining empty block" + ); +} + +/// Tests that we can get code of contracts from the forked Westend Asset Hub state +#[tokio::test(flavor = "multi_thread")] +async fn test_fork_eth_get_code_from_westend() { + let fork_config = westend_fork_config(); + let fork_substrate_config = SubstrateNodeConfig::new(&fork_config); + let mut fork_node = TestNode::new(fork_config.clone(), fork_substrate_config).await.unwrap(); + + // Test getting code of random addresses (should be empty for EOAs) + for _ in 0..5 { + let random_addr = Address::random(); + let code = unwrap_response::( + fork_node.eth_rpc(EthRequest::EthGetCodeAt(random_addr, None)).await.unwrap(), + ) + .unwrap(); + assert!(code.is_empty(), "Random address should have no code"); + } + + // Mine a block and verify we can still get code + unwrap_response::<()>(fork_node.eth_rpc(EthRequest::Mine(None, None)).await.unwrap()).unwrap(); + + // Set balance for alith to deploy contract (may not have balance in the forked chain) + let alith = Account::from(subxt_signer::eth::dev::alith()); + let alith_address = Address::from(ReviveAddress::new(alith.address())); + let initial_balance = U256::from(1e20 as u128); // 100 ether + unwrap_response::<()>( + fork_node.eth_rpc(EthRequest::SetBalance(alith_address, initial_balance)).await.unwrap(), + ) + .unwrap(); + + // Deploy a contract on the fork + let contract_code = get_contract_code("SimpleStorage"); + let tx_hash = fork_node.deploy_contract(&contract_code.init, alith.address()).await; + unwrap_response::<()>(fork_node.eth_rpc(EthRequest::Mine(None, None)).await.unwrap()).unwrap(); + + let receipt = fork_node.get_transaction_receipt(tx_hash).await; + assert_eq!( + receipt.status, + Some(polkadot_sdk::pallet_revive::U256::from(1)), + "Contract deployment should succeed" + ); + let contract_address = receipt.contract_address.expect("Contract address should exist"); + + // Get code of deployed contract + let deployed_code = unwrap_response::( + fork_node + .eth_rpc(EthRequest::EthGetCodeAt( + Address::from(ReviveAddress::new(contract_address)), + None, + )) + .await + .unwrap(), + ) + .unwrap(); + assert!(!deployed_code.is_empty(), "Deployed contract should have code"); + + // Deploy another contract to verify chain continues working + let tx_hash2 = fork_node.deploy_contract(&contract_code.init, alith.address()).await; + unwrap_response::<()>(fork_node.eth_rpc(EthRequest::Mine(None, None)).await.unwrap()).unwrap(); + + let receipt2 = fork_node.get_transaction_receipt(tx_hash2).await; + assert_eq!( + receipt2.status, + Some(polkadot_sdk::pallet_revive::U256::from(1)), + "Second contract deployment should succeed" + ); +} + +/// Tests that we can get nonce (transaction count) from the forked Westend Asset Hub state +#[tokio::test(flavor = "multi_thread")] +async fn test_fork_eth_get_nonce_from_westend() { + let fork_config = westend_fork_config(); + let fork_substrate_config = SubstrateNodeConfig::new(&fork_config); + let mut fork_node = TestNode::new(fork_config.clone(), fork_substrate_config).await.unwrap(); + + let alith = Account::from(subxt_signer::eth::dev::alith()); + let alith_address = Address::from(ReviveAddress::new(alith.address())); + + // Set balance for alith (may not have balance in the forked chain) + let initial_balance = U256::from(1e20 as u128); // 100 ether + unwrap_response::<()>( + fork_node.eth_rpc(EthRequest::SetBalance(alith_address, initial_balance)).await.unwrap(), + ) + .unwrap(); + + // Get initial nonce from forked state + let initial_nonce = fork_node.get_nonce(alith_address).await; + + // Send a transaction to increase nonce + let baltathar = Account::from(subxt_signer::eth::dev::baltathar()); + let baltathar_address = ReviveAddress::new(baltathar.address()); + let transfer_amount = U256::from(1e18 as u128); // 1 ether + + let transaction = TransactionRequest::default() + .value(transfer_amount) + .from(alith_address) + .to(Address::from(baltathar_address)); + + fork_node.send_transaction(transaction).await.unwrap(); + unwrap_response::<()>(fork_node.eth_rpc(EthRequest::Mine(None, None)).await.unwrap()).unwrap(); + + // Nonce should have increased by 1 + let nonce_after_tx = fork_node.get_nonce(alith_address).await; + assert_eq!( + nonce_after_tx, + initial_nonce + U256::from(1), + "Nonce should increase by 1 after sending transaction" + ); + + // Random addresses should have nonce 0 + for _ in 0..3 { + let random_addr = Address::random(); + let nonce = unwrap_response::( + fork_node.eth_rpc(EthRequest::EthGetTransactionCount(random_addr, None)).await.unwrap(), + ) + .unwrap(); + assert_eq!(nonce, U256::ZERO, "Random address should have nonce 0"); + } +} + +/// Tests state snapshotting and reverting on a forked Westend Asset Hub node +#[tokio::test(flavor = "multi_thread")] +async fn test_fork_state_snapshotting_from_westend() { + let fork_config = westend_fork_config(); + let fork_substrate_config = SubstrateNodeConfig::new(&fork_config); + let mut fork_node = TestNode::new(fork_config.clone(), fork_substrate_config).await.unwrap(); + + let alith = Account::from(subxt_signer::eth::dev::alith()); + let baltathar = Account::from(subxt_signer::eth::dev::baltathar()); + let alith_address = Address::from(ReviveAddress::new(alith.address())); + let baltathar_address = Address::from(ReviveAddress::new(baltathar.address())); + + // Set initial balances for dev accounts (they may not have balance in the forked chain) + let set_balance = U256::from(1e20 as u128); // 100 ether + unwrap_response::<()>( + fork_node.eth_rpc(EthRequest::SetBalance(alith_address, set_balance)).await.unwrap(), + ) + .unwrap(); + unwrap_response::<()>( + fork_node.eth_rpc(EthRequest::SetBalance(baltathar_address, set_balance)).await.unwrap(), + ) + .unwrap(); + + // Get initial state + let initial_alith_balance = fork_node.get_balance(alith.address(), None).await; + let initial_baltathar_balance = fork_node.get_balance(baltathar.address(), None).await; + let initial_alith_nonce = fork_node.get_nonce(alith_address).await; + + // Create a snapshot + let snapshot_id = U256::from_str_radix( + unwrap_response::(fork_node.eth_rpc(EthRequest::EvmSnapshot(())).await.unwrap()) + .unwrap() + .trim_start_matches("0x"), + 16, + ) + .unwrap(); + + // Perform a transaction that modifies state + let transfer_amount = U256::from(5e18 as u128); // 5 ether + let transaction = TransactionRequest::default() + .value(transfer_amount) + .from(alith_address) + .to(baltathar_address); + + fork_node.send_transaction(transaction).await.unwrap(); + unwrap_response::<()>(fork_node.eth_rpc(EthRequest::Mine(None, None)).await.unwrap()).unwrap(); + + // Verify state changed + let alith_balance_after = fork_node.get_balance(alith.address(), None).await; + let baltathar_balance_after = fork_node.get_balance(baltathar.address(), None).await; + let nonce_after = fork_node.get_nonce(alith_address).await; + + assert!( + alith_balance_after < initial_alith_balance, + "Alith balance should decrease after transfer" + ); + assert_eq!( + baltathar_balance_after, + initial_baltathar_balance + transfer_amount, + "Baltathar should receive transfer amount" + ); + assert_eq!(nonce_after, initial_alith_nonce + U256::from(1), "Nonce should increase"); + + // Revert to snapshot + let reverted = unwrap_response::( + fork_node.eth_rpc(EthRequest::EvmRevert(snapshot_id)).await.unwrap(), + ) + .unwrap(); + assert!(reverted, "Revert should succeed"); + + // Verify state is back to snapshot point + let alith_balance_reverted = fork_node.get_balance(alith.address(), None).await; + let baltathar_balance_reverted = fork_node.get_balance(baltathar.address(), None).await; + let nonce_reverted = fork_node.get_nonce(alith_address).await; + + assert_eq!( + alith_balance_reverted, initial_alith_balance, + "Alith balance should be restored after revert" + ); + assert_eq!( + baltathar_balance_reverted, initial_baltathar_balance, + "Baltathar balance should be restored after revert" + ); + assert_eq!(nonce_reverted, initial_alith_nonce, "Nonce should be restored after revert"); +} + +/// Tests sending transactions on a forked Westend Asset Hub node +#[tokio::test(flavor = "multi_thread")] +async fn test_fork_can_send_tx_from_westend() { + let fork_config = westend_fork_config(); + let fork_substrate_config = SubstrateNodeConfig::new(&fork_config); + let mut fork_node = TestNode::new(fork_config.clone(), fork_substrate_config).await.unwrap(); + + let initial_block = fork_node.best_block_number().await; + + let alith = Account::from(subxt_signer::eth::dev::alith()); + let baltathar = Account::from(subxt_signer::eth::dev::baltathar()); + let alith_address = Address::from(ReviveAddress::new(alith.address())); + let baltathar_address = Address::from(ReviveAddress::new(baltathar.address())); + + // Set initial balances for dev accounts (they may not have balance in the forked chain) + let initial_balance = U256::from(1e20 as u128); // 100 ether + unwrap_response::<()>( + fork_node.eth_rpc(EthRequest::SetBalance(alith_address, initial_balance)).await.unwrap(), + ) + .unwrap(); + unwrap_response::<()>( + fork_node + .eth_rpc(EthRequest::SetBalance(baltathar_address, initial_balance)) + .await + .unwrap(), + ) + .unwrap(); + + // Get balances after setting + let initial_alith_balance = fork_node.get_balance(alith.address(), None).await; + let initial_baltathar_balance = fork_node.get_balance(baltathar.address(), None).await; + + assert_eq!(initial_alith_balance, initial_balance, "Alith balance should be set"); + assert_eq!(initial_baltathar_balance, initial_balance, "Baltathar balance should be set"); + + // Send a simple ETH transfer + let transfer_amount = U256::from(1e18 as u128); // 1 ether + let transaction = TransactionRequest::default() + .value(transfer_amount) + .from(alith_address) + .to(baltathar_address); + + let tx_hash = fork_node.send_transaction(transaction).await.unwrap(); + + // Mine the transaction + unwrap_response::<()>(fork_node.eth_rpc(EthRequest::Mine(None, None)).await.unwrap()).unwrap(); + + // Get receipt and verify transaction succeeded + let receipt = fork_node.get_transaction_receipt(tx_hash).await; + assert_eq!( + receipt.status, + Some(polkadot_sdk::pallet_revive::U256::from(1)), + "Transaction should succeed" + ); + + // Verify balances changed + let final_alith_balance = fork_node.get_balance(alith.address(), None).await; + let final_baltathar_balance = fork_node.get_balance(baltathar.address(), None).await; + + assert!( + final_alith_balance < initial_alith_balance, + "Alith balance should decrease (transfer + gas)" + ); + assert_eq!( + final_baltathar_balance, + initial_baltathar_balance + transfer_amount, + "Baltathar should receive exact transfer amount" + ); + + // Send another transaction to verify chain continues working + let second_transfer = U256::from(5e17 as u128); // 0.5 ether + let transaction2 = TransactionRequest::default() + .value(second_transfer) + .from(baltathar_address) + .to(alith_address); + + let tx_hash2 = fork_node.send_transaction(transaction2).await.unwrap(); + unwrap_response::<()>(fork_node.eth_rpc(EthRequest::Mine(None, None)).await.unwrap()).unwrap(); + + let receipt2 = fork_node.get_transaction_receipt(tx_hash2).await; + assert_eq!( + receipt2.status, + Some(polkadot_sdk::pallet_revive::U256::from(1)), + "Second transaction should succeed" + ); + + // Verify block number increased (2 transactions = 2 blocks mined) + let final_block = fork_node.best_block_number().await; + assert_eq!( + final_block, + initial_block + 2, + "Block number should increase by 2 after two mined transactions" + ); +} + +/// Tests impersonating an account on a forked chain +#[tokio::test(flavor = "multi_thread")] +async fn test_fork_impersonate_account_from_westend() { + let fork_config = westend_fork_config(); + let fork_substrate_config = SubstrateNodeConfig::new(&fork_config); + let mut fork_node = TestNode::new(fork_config.clone(), fork_substrate_config).await.unwrap(); + + // Create a random address to impersonate + let impersonated_addr = Address::random(); + let recipient_addr = Address::random(); + + // Set balance for the impersonated account + let balance = U256::from(1e20 as u128); // 100 ether + unwrap_response::<()>( + fork_node.eth_rpc(EthRequest::SetBalance(impersonated_addr, balance)).await.unwrap(), + ) + .unwrap(); + + // Enable impersonation + unwrap_response::<()>( + fork_node.eth_rpc(EthRequest::ImpersonateAccount(impersonated_addr)).await.unwrap(), + ) + .unwrap(); + + // Send transaction from impersonated account + let transfer_amount = U256::from(1e18 as u128); // 1 ether + let transaction = TransactionRequest::default() + .value(transfer_amount) + .from(impersonated_addr) + .to(recipient_addr); + + let tx_hash = fork_node.send_transaction(transaction).await.unwrap(); + unwrap_response::<()>(fork_node.eth_rpc(EthRequest::Mine(None, None)).await.unwrap()).unwrap(); + + let receipt = fork_node.get_transaction_receipt(tx_hash).await; + assert_eq!( + receipt.status, + Some(polkadot_sdk::pallet_revive::U256::from(1)), + "Impersonated transaction should succeed" + ); + + // Verify recipient received the funds + let recipient_balance = + fork_node.get_balance(subxt::utils::H160::from(recipient_addr.0.0), None).await; + assert_eq!(recipient_balance, transfer_amount, "Recipient should receive transfer"); + + // Stop impersonation + unwrap_response::<()>( + fork_node.eth_rpc(EthRequest::StopImpersonatingAccount(impersonated_addr)).await.unwrap(), + ) + .unwrap(); +} + +/// Tests setting balance and code on a forked chain +#[tokio::test(flavor = "multi_thread")] +async fn test_fork_set_balance_and_code_from_westend() { + let fork_config = westend_fork_config(); + let fork_substrate_config = SubstrateNodeConfig::new(&fork_config); + let mut fork_node = TestNode::new(fork_config.clone(), fork_substrate_config).await.unwrap(); + + let test_addr = Address::random(); + + // Initially should have no balance and no code + let initial_balance = + fork_node.get_balance(subxt::utils::H160::from(test_addr.0.0), None).await; + let initial_code = unwrap_response::( + fork_node.eth_rpc(EthRequest::EthGetCodeAt(test_addr, None)).await.unwrap(), + ) + .unwrap(); + + assert_eq!(initial_balance, U256::ZERO); + assert!(initial_code.is_empty()); + + // Set balance + let new_balance = U256::from(12345678u64); + unwrap_response::<()>( + fork_node.eth_rpc(EthRequest::SetBalance(test_addr, new_balance)).await.unwrap(), + ) + .unwrap(); + + let updated_balance = + fork_node.get_balance(subxt::utils::H160::from(test_addr.0.0), None).await; + assert_eq!(updated_balance, new_balance, "Balance should be updated"); + + // Set code + let new_code = Bytes::from(vec![0x60, 0x60, 0x60, 0x40]); // Simple bytecode + unwrap_response::<()>( + fork_node.eth_rpc(EthRequest::SetCode(test_addr, new_code.clone())).await.unwrap(), + ) + .unwrap(); + + let updated_code = unwrap_response::( + fork_node.eth_rpc(EthRequest::EthGetCodeAt(test_addr, None)).await.unwrap(), + ) + .unwrap(); + assert_eq!(updated_code, new_code, "Code should be updated"); + + // Set code to empty (clear code) + unwrap_response::<()>( + fork_node.eth_rpc(EthRequest::SetCode(test_addr, Bytes::new())).await.unwrap(), + ) + .unwrap(); + + let cleared_code = unwrap_response::( + fork_node.eth_rpc(EthRequest::EthGetCodeAt(test_addr, None)).await.unwrap(), + ) + .unwrap(); + assert!(cleared_code.is_empty(), "Code should be cleared"); +} + +/// Tests that block number increases correctly after mining on a fork +#[tokio::test(flavor = "multi_thread")] +async fn test_fork_block_number_after_mine_from_westend() { + let fork_config = westend_fork_config(); + let fork_substrate_config = SubstrateNodeConfig::new(&fork_config); + let mut fork_node = TestNode::new(fork_config.clone(), fork_substrate_config).await.unwrap(); + + let initial_block = fork_node.best_block_number().await; + + // Mine a block + unwrap_response::<()>(fork_node.eth_rpc(EthRequest::Mine(None, None)).await.unwrap()).unwrap(); + + let block_after_mine1 = fork_node.best_block_number().await; + assert_eq!( + block_after_mine1, + initial_block + 1, + "Block number should increase by 1 after mining" + ); + + // Mine multiple blocks + unwrap_response::<()>( + fork_node.eth_rpc(EthRequest::Mine(Some(U256::from(5)), None)).await.unwrap(), + ) + .unwrap(); + + let block_after_mine5 = fork_node.best_block_number().await; + assert_eq!( + block_after_mine5, + block_after_mine1 + 5, + "Block number should increase by 5 after mining 5 blocks" + ); +} diff --git a/crates/anvil-polkadot/tests/it/main.rs b/crates/anvil-polkadot/tests/it/main.rs index cb5d9793dfcb5..dbc0fbf290c9e 100644 --- a/crates/anvil-polkadot/tests/it/main.rs +++ b/crates/anvil-polkadot/tests/it/main.rs @@ -1,5 +1,6 @@ mod abi; mod filters; +#[cfg(feature = "forking-tests")] mod forking; mod gas; mod genesis; diff --git a/crates/anvil-polkadot/tests/it/utils.rs b/crates/anvil-polkadot/tests/it/utils.rs index f93f9dec52a48..332a2169e0a3f 100644 --- a/crates/anvil-polkadot/tests/it/utils.rs +++ b/crates/anvil-polkadot/tests/it/utils.rs @@ -47,7 +47,9 @@ use std::{fmt::Debug, time::Duration}; use subxt::utils::H160; use tempfile::TempDir; -use crate::abi::{Multicall, SimpleStorage}; +use crate::abi::Multicall; +#[cfg(feature = "forking-tests")] +use crate::abi::SimpleStorage; pub struct BlockWaitTimeout { pub block_number: u32, @@ -226,6 +228,7 @@ impl TestNode { self.eth_best_block().await.number.as_u32() } + #[cfg(feature = "forking-tests")] pub fn substrate_rpc_port(&self) -> u16 { self.service .rpc_handlers @@ -537,6 +540,7 @@ pub fn to_hex_string(value: u64) -> String { } /// Helper function to call getValue() on a SimpleStorage contract +#[cfg(feature = "forking-tests")] pub async fn simplestorage_get_value( node: &mut TestNode, contract_address: polkadot_sdk::pallet_revive::H160,