diff --git a/polkadot/Cargo.lock b/polkadot/Cargo.lock index ea0e92648c1f271a4eef8c976a3bd429bb8f8171..a19b80b2f4d74ebd114ec8dfc9c482c7693ec737 100644 --- a/polkadot/Cargo.lock +++ b/polkadot/Cargo.lock @@ -1773,7 +1773,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parity-scale-codec", ] @@ -1791,7 +1791,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "3.1.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "frame-system", @@ -1810,7 +1810,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "Inflector", "chrono", @@ -1833,7 +1833,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "frame-system", @@ -1846,7 +1846,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "frame-system", @@ -1862,7 +1862,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "13.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parity-scale-codec", "serde", @@ -1873,7 +1873,7 @@ dependencies = [ [[package]] name = "frame-support" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "bitflags", "frame-metadata", @@ -1899,7 +1899,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -1911,7 +1911,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.0.0", @@ -1923,7 +1923,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "proc-macro2", "quote", @@ -1933,7 +1933,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-metadata", "frame-support", @@ -1954,7 +1954,7 @@ dependencies = [ [[package]] name = "frame-system" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -1971,7 +1971,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -1985,7 +1985,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parity-scale-codec", "sp-api", @@ -1994,7 +1994,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "parity-scale-codec", @@ -3020,13 +3020,14 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.2.0-alpha.2" +version = "0.2.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f1d8440e2617bdebdf45114e90f65aed3f14bf73e23d874dde8e4b764676fe9" +checksum = "9b15fc3a0ef2e02d770aa1a221d3412443dcaedc43e27d80c957dd5bbd65321b" dependencies = [ "async-trait", "futures 0.3.13", "hyper 0.13.9", + "hyper-rustls", "jsonrpsee-types", "jsonrpsee-utils", "log", @@ -3039,9 +3040,9 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.2.0-alpha.2" +version = "0.2.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb3f732ccbeafd15cefb59c7c7b5ac6c553c2653613b63e5e7feb7f06a219e9" +checksum = "6bb4afbda476e2ee11cc6245055c498c116fc8002d2d60fe8338b6ee15d84c3a" dependencies = [ "Inflector", "proc-macro2", @@ -3051,9 +3052,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.2.0-alpha.2" +version = "0.2.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a8cd20c190e75dc56f7543b9d5713c3186351b301b5507ea6b85d8c403aac78" +checksum = "c42a82588b5f7830e94341bb7e79d15f46070ab6f64dde1e3b3719721b61c5bf" dependencies = [ "async-trait", "futures 0.3.13", @@ -3066,9 +3067,9 @@ dependencies = [ [[package]] name = "jsonrpsee-utils" -version = "0.2.0-alpha.2" +version = "0.2.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51670a3b56e5fb0d325920ce317c76184b8afabfd7bc5009831229cfef0732b" +checksum = "e65c77838fce96bc554b4a3a159d0b9a2497319ae9305c66ee853998c7ed2fd3" dependencies = [ "futures 0.3.13", "globset", @@ -4375,7 +4376,7 @@ checksum = "13370dae44474229701bb69b90b4f4dca6404cb0357a2d50d635f1171dc3aa7b" [[package]] name = "pallet-authority-discovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "frame-system", @@ -4391,7 +4392,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "frame-system", @@ -4406,7 +4407,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -4430,7 +4431,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -4460,7 +4461,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -4475,7 +4476,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -4492,7 +4493,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -4507,7 +4508,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4528,7 +4529,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -4544,7 +4545,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -4566,7 +4567,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4582,7 +4583,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -4602,7 +4603,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -4619,7 +4620,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "frame-system", @@ -4633,7 +4634,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -4651,7 +4652,7 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "frame-system", @@ -4667,7 +4668,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4685,7 +4686,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -4701,7 +4702,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "frame-system", @@ -4715,7 +4716,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "frame-system", @@ -4731,7 +4732,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4753,7 +4754,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -4769,7 +4770,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "frame-system", @@ -4782,7 +4783,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "enumflags2", "frame-support", @@ -4797,7 +4798,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -4813,7 +4814,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "frame-system", @@ -4833,7 +4834,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -4849,7 +4850,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "frame-system", @@ -4863,7 +4864,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4887,7 +4888,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -4898,7 +4899,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "frame-system", @@ -4912,7 +4913,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -4931,7 +4932,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -4946,7 +4947,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-support", "frame-system", @@ -4962,7 +4963,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4979,7 +4980,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -4990,7 +4991,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -5006,7 +5007,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-benchmarking", "frame-support", @@ -5022,7 +5023,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5684,6 +5685,7 @@ name = "polkadot-node-collation-generation" version = "0.1.0" dependencies = [ "futures 0.3.13", + "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -5691,6 +5693,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "sp-core", + "sp-maybe-compressed-blob", "thiserror", "tracing", ] @@ -5830,6 +5833,7 @@ dependencies = [ "polkadot-primitives", "sp-core", "sp-keyring", + "sp-maybe-compressed-blob", "tracing", ] @@ -5954,6 +5958,7 @@ dependencies = [ "sp-consensus-babe", "sp-consensus-vrf", "sp-core", + "sp-maybe-compressed-blob", "sp-runtime", "thiserror", "zstd", @@ -7203,7 +7208,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "env_logger 0.8.2", "hex-literal", @@ -7429,6 +7434,16 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd" +[[package]] +name = "ruzstd" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d425143485a37727c7a46e689bbe3b883a00f42b4a52c4ac0f44855c1009b00" +dependencies = [ + "byteorder", + "twox-hash", +] + [[package]] name = "rw-stream-sink" version = "0.2.1" @@ -7476,7 +7491,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "async-trait", "derive_more", @@ -7504,7 +7519,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", @@ -7527,7 +7542,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -7543,7 +7558,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -7564,7 +7579,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -7575,7 +7590,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "chrono", "fdlimit", @@ -7613,7 +7628,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "derive_more", "fnv", @@ -7647,7 +7662,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "blake2-rfc", "hash-db", @@ -7677,7 +7692,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parking_lot 0.11.1", "sc-client-api", @@ -7689,7 +7704,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "async-trait", "derive_more", @@ -7736,7 +7751,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "derive_more", "futures 0.3.13", @@ -7760,7 +7775,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "fork-tree", "parity-scale-codec", @@ -7773,7 +7788,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "async-trait", "futures 0.3.13", @@ -7800,7 +7815,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "log", "sc-client-api", @@ -7814,7 +7829,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "derive_more", "lazy_static", @@ -7830,6 +7845,7 @@ dependencies = [ "sp-core", "sp-externalities", "sp-io", + "sp-maybe-compressed-blob", "sp-panic-handler", "sp-runtime-interface", "sp-serializer", @@ -7843,11 +7859,12 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "derive_more", "parity-scale-codec", "parity-wasm 0.41.0", + "pwasm-utils", "sp-allocator", "sp-core", "sp-serializer", @@ -7859,7 +7876,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "log", "parity-scale-codec", @@ -7874,7 +7891,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "log", "parity-scale-codec", @@ -7892,7 +7909,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "async-trait", "derive_more", @@ -7932,7 +7949,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "derive_more", "finality-grandpa", @@ -7956,7 +7973,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-warp-sync" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "derive_more", "futures 0.3.13", @@ -7977,7 +7994,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "ansi_term 0.12.1", "futures 0.3.13", @@ -7995,7 +8012,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "async-trait", "derive_more", @@ -8015,7 +8032,7 @@ dependencies = [ [[package]] name = "sc-light" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "hash-db", "lazy_static", @@ -8034,7 +8051,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "async-std", "async-trait", @@ -8087,7 +8104,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", @@ -8104,7 +8121,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "bytes 0.5.6", "fnv", @@ -8132,7 +8149,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "futures 0.3.13", "libp2p", @@ -8145,7 +8162,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8154,7 +8171,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "futures 0.3.13", "hash-db", @@ -8188,7 +8205,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "derive_more", "futures 0.3.13", @@ -8212,7 +8229,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "futures 0.1.29", "jsonrpc-core", @@ -8230,7 +8247,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "async-trait", "directories", @@ -8294,7 +8311,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "log", "parity-scale-codec", @@ -8309,7 +8326,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -8329,7 +8346,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "chrono", "futures 0.3.13", @@ -8349,7 +8366,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "ansi_term 0.12.1", "atty", @@ -8376,7 +8393,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -8387,7 +8404,7 @@ dependencies = [ [[package]] name = "sc-transaction-graph" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "derive_more", "futures 0.3.13", @@ -8409,7 +8426,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "futures 0.3.13", "futures-diagnose", @@ -8835,7 +8852,7 @@ dependencies = [ [[package]] name = "sp-allocator" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "log", "sp-core", @@ -8847,7 +8864,7 @@ dependencies = [ [[package]] name = "sp-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "hash-db", "log", @@ -8864,7 +8881,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "blake2-rfc", "proc-macro-crate 1.0.0", @@ -8876,7 +8893,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parity-scale-codec", "serde", @@ -8888,7 +8905,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "integer-sqrt", "num-traits", @@ -8901,7 +8918,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parity-scale-codec", "sp-api", @@ -8913,7 +8930,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parity-scale-codec", "sp-inherents", @@ -8924,7 +8941,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parity-scale-codec", "sp-api", @@ -8936,7 +8953,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "futures 0.3.13", "log", @@ -8954,7 +8971,7 @@ dependencies = [ [[package]] name = "sp-chain-spec" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "serde", "serde_json", @@ -8963,7 +8980,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "async-trait", "futures 0.3.13", @@ -8990,7 +9007,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "merlin", "parity-scale-codec", @@ -9011,7 +9028,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parity-scale-codec", "sp-arithmetic", @@ -9021,7 +9038,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -9033,7 +9050,7 @@ dependencies = [ [[package]] name = "sp-core" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "base58", "blake2-rfc", @@ -9077,7 +9094,7 @@ dependencies = [ [[package]] name = "sp-database" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -9086,7 +9103,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "proc-macro2", "quote", @@ -9096,7 +9113,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "environmental", "parity-scale-codec", @@ -9107,7 +9124,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "finality-grandpa", "log", @@ -9124,7 +9141,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parity-scale-codec", "parking_lot 0.11.1", @@ -9136,7 +9153,7 @@ dependencies = [ [[package]] name = "sp-io" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "futures 0.3.13", "hash-db", @@ -9160,7 +9177,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "lazy_static", "sp-core", @@ -9171,7 +9188,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "async-trait", "derive_more", @@ -9185,10 +9202,19 @@ dependencies = [ "sp-externalities", ] +[[package]] +name = "sp-maybe-compressed-blob" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" +dependencies = [ + "ruzstd", + "zstd", +] + [[package]] name = "sp-npos-elections" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parity-scale-codec", "serde", @@ -9201,7 +9227,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-compact" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -9212,7 +9238,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "sp-api", "sp-core", @@ -9222,7 +9248,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "backtrace", ] @@ -9230,7 +9256,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "serde", "sp-core", @@ -9239,7 +9265,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "either", "hash256-std-hasher", @@ -9260,7 +9286,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9277,7 +9303,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "Inflector", "proc-macro-crate 1.0.0", @@ -9289,7 +9315,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "serde", "serde_json", @@ -9298,7 +9324,7 @@ dependencies = [ [[package]] name = "sp-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parity-scale-codec", "sp-api", @@ -9311,7 +9337,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -9321,7 +9347,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "hash-db", "log", @@ -9343,12 +9369,12 @@ dependencies = [ [[package]] name = "sp-std" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" [[package]] name = "sp-storage" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9361,7 +9387,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "log", "sp-core", @@ -9374,7 +9400,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "parity-scale-codec", "sp-api", @@ -9387,7 +9413,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "log", "parity-scale-codec", @@ -9400,7 +9426,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "derive_more", "futures 0.3.13", @@ -9416,7 +9442,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "hash-db", "memory-db", @@ -9430,7 +9456,7 @@ dependencies = [ [[package]] name = "sp-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "futures 0.3.13", "futures-core", @@ -9442,7 +9468,7 @@ dependencies = [ [[package]] name = "sp-version" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9454,7 +9480,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9611,7 +9637,7 @@ dependencies = [ [[package]] name = "substrate-browser-utils" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "chrono", "console_error_panic_hook", @@ -9637,7 +9663,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "platforms", ] @@ -9645,7 +9671,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.13", @@ -9668,7 +9694,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "async-std", "derive_more", @@ -9682,7 +9708,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "async-trait", "futures 0.1.29", @@ -9711,7 +9737,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "futures 0.3.13", "substrate-test-utils-derive", @@ -9721,7 +9747,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "proc-macro-crate 1.0.0", "quote", @@ -10462,7 +10488,7 @@ checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" [[package]] name = "try-runtime-cli" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#14b3030f92546ad2cece4f1d060cbcf6edfd21e5" +source = "git+https://github.com/paritytech/substrate#6c5b63a76a3b444e8de1a9ef601b30b61ba9f393" dependencies = [ "frame-try-runtime", "log", @@ -10502,7 +10528,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" dependencies = [ "cfg-if 0.1.10", - "rand 0.3.23", + "rand 0.7.3", "static_assertions", ] diff --git a/polkadot/node/collation-generation/Cargo.toml b/polkadot/node/collation-generation/Cargo.toml index fdcfa6ae1fd76d6ac764e73cf86e5d7282659804..fc76ed07ed9a993add1840ed3dc9ddb46660ae48 100644 --- a/polkadot/node/collation-generation/Cargo.toml +++ b/polkadot/node/collation-generation/Cargo.toml @@ -13,7 +13,9 @@ polkadot-node-subsystem = { path = "../subsystem" } polkadot-node-subsystem-util = { path = "../subsystem-util" } polkadot-primitives = { path = "../../primitives" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-maybe-compressed-blob = { git = "https://github.com/paritytech/substrate", branch = "master" } thiserror = "1.0.23" +parity-scale-codec = { version = "2.0.0", default-features = false, features = ["bit-vec", "derive"] } [dev-dependencies] polkadot-node-subsystem-test-helpers = { path = "../subsystem-test-helpers" } diff --git a/polkadot/node/collation-generation/src/lib.rs b/polkadot/node/collation-generation/src/lib.rs index 67b758de3a6e3d5908fa0f9fab156c81a543d9c0..d1adcc32dd706c60e586c1465c17f6baec975323 100644 --- a/polkadot/node/collation-generation/src/lib.rs +++ b/polkadot/node/collation-generation/src/lib.rs @@ -26,7 +26,9 @@ use futures::{ sink::SinkExt, stream::StreamExt, }; -use polkadot_node_primitives::{CollationGenerationConfig, AvailableData, PoV}; +use polkadot_node_primitives::{ + CollationGenerationConfig, AvailableData, PoV, +}; use polkadot_node_subsystem::{ messages::{AllMessages, CollationGenerationMessage, CollatorProtocolMessage}, FromOverseer, SpawnedSubsystem, Subsystem, SubsystemContext, SubsystemResult, @@ -41,6 +43,7 @@ use polkadot_primitives::v1::{ CandidateDescriptor, CandidateReceipt, CoreState, Hash, OccupiedCoreAssumption, PersistedValidationData, }; +use parity_scale_codec::Encode; use sp_core::crypto::Pair; use std::sync::Arc; @@ -313,7 +316,32 @@ async fn handle_new_activations<Context: SubsystemContext>( } }; - let pov_hash = collation.proof_of_validity.hash(); + // Apply compression to the block data. + let pov = { + let pov = polkadot_node_primitives::maybe_compress_pov(collation.proof_of_validity); + let encoded_size = pov.encoded_size(); + + // As long as `POV_BOMB_LIMIT` is at least `max_pov_size`, this ensures + // that honest collators never produce a PoV which is uncompressed. + // + // As such, honest collators never produce an uncompressed PoV which starts with + // a compression magic number, which would lead validators to reject the collation. + if encoded_size > validation_data.max_pov_size as usize { + tracing::debug!( + target: LOG_TARGET, + para_id = %scheduled_core.para_id, + size = encoded_size, + max_size = validation_data.max_pov_size, + "PoV exceeded maximum size" + ); + + return + } + + pov + }; + + let pov_hash = pov.hash(); let signature_payload = collator_signature_payload( &relay_parent, @@ -326,7 +354,7 @@ async fn handle_new_activations<Context: SubsystemContext>( let erasure_root = match erasure_root( n_validators, validation_data, - collation.proof_of_validity.clone(), + pov.clone(), ) { Ok(erasure_root) => erasure_root, Err(err) => { @@ -375,7 +403,7 @@ async fn handle_new_activations<Context: SubsystemContext>( metrics.on_collation_generated(); if let Err(err) = task_sender.send(AllMessages::CollatorProtocol( - CollatorProtocolMessage::DistributeCollation(ccr, collation.proof_of_validity, result_sender) + CollatorProtocolMessage::DistributeCollation(ccr, pov, result_sender) )).await { tracing::warn!( target: LOG_TARGET, @@ -492,7 +520,7 @@ mod tests { task::{Context as FuturesContext, Poll}, Future, }; - use polkadot_node_primitives::{Collation, CollationResult, BlockData, PoV}; + use polkadot_node_primitives::{Collation, CollationResult, BlockData, PoV, POV_BOMB_LIMIT}; use polkadot_node_subsystem::messages::{ AllMessages, RuntimeApiMessage, RuntimeApiRequest, }; @@ -500,8 +528,7 @@ mod tests { subsystem_test_harness, TestSubsystemContextHandle, }; use polkadot_primitives::v1::{ - BlockNumber, CollatorPair, Id as ParaId, - PersistedValidationData, ScheduledCore, ValidationCode, + CollatorPair, Id as ParaId, PersistedValidationData, ScheduledCore, ValidationCode, }; use std::pin::Pin; @@ -519,6 +546,24 @@ mod tests { } } + fn test_collation_compressed() -> Collation { + let mut collation = test_collation(); + let compressed = PoV { + block_data: BlockData(sp_maybe_compressed_blob::compress( + &collation.proof_of_validity.block_data.0, + POV_BOMB_LIMIT, + ).unwrap()) + }; + collation.proof_of_validity = compressed; + collation + } + + fn test_validation_data() -> PersistedValidationData { + let mut persisted_validation_data: PersistedValidationData = Default::default(); + persisted_validation_data.max_pov_size = 1024; + persisted_validation_data + } + // Box<dyn Future<Output = Collation> + Unpin + Send struct TestCollator; @@ -715,7 +760,7 @@ mod tests { tx, ), ))) => { - tx.send(Ok(Some(Default::default()))).unwrap(); + tx.send(Ok(Some(test_validation_data()))).unwrap(); } Some(AllMessages::RuntimeApi(RuntimeApiMessage::Request( _hash, @@ -766,9 +811,8 @@ mod tests { // we expect a single message to be sent, containing a candidate receipt. // we don't care too much about the commitments_hash right now, but let's ensure that we've calculated the // correct descriptor - let expect_pov_hash = test_collation().proof_of_validity.hash(); - let expect_validation_data_hash - = PersistedValidationData::<Hash, BlockNumber>::default().hash(); + let expect_pov_hash = test_collation_compressed().proof_of_validity.hash(); + let expect_validation_data_hash = test_validation_data().hash(); let expect_relay_parent = Hash::repeat_byte(4); let expect_validation_code_hash = ValidationCode(vec![1, 2, 3]).hash(); let expect_payload = collator_signature_payload( diff --git a/polkadot/node/core/candidate-validation/Cargo.toml b/polkadot/node/core/candidate-validation/Cargo.toml index 8a40f3a4750088de496ceac233118827a0f31cdb..e4d2c5ba80ba1da77d6ee4c353ff37000f5730a0 100644 --- a/polkadot/node/core/candidate-validation/Cargo.toml +++ b/polkadot/node/core/candidate-validation/Cargo.toml @@ -9,6 +9,7 @@ futures = "0.3.12" tracing = "0.1.25" sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate", branch = "master" } +sp-maybe-compressed-blob = { package = "sp-maybe-compressed-blob", git = "https://github.com/paritytech/substrate", branch = "master" } parity-scale-codec = { version = "2.0.0", default-features = false, features = ["bit-vec", "derive"] } polkadot-primitives = { path = "../../../primitives" } diff --git a/polkadot/node/core/candidate-validation/src/lib.rs b/polkadot/node/core/candidate-validation/src/lib.rs index b00e46a59aae302e6e30db9b407beaa04c70f81c..573b2f1c7110d4a328712697fe1af35f3549bca3 100644 --- a/polkadot/node/core/candidate-validation/src/lib.rs +++ b/polkadot/node/core/candidate-validation/src/lib.rs @@ -33,7 +33,9 @@ use polkadot_subsystem::{ }; use polkadot_node_subsystem_util::metrics::{self, prometheus}; use polkadot_subsystem::errors::RuntimeApiError; -use polkadot_node_primitives::{ValidationResult, InvalidCandidate, PoV}; +use polkadot_node_primitives::{ + VALIDATION_CODE_BOMB_LIMIT, POV_BOMB_LIMIT, ValidationResult, InvalidCandidate, PoV, BlockData, +}; use polkadot_primitives::v1::{ ValidationCode, CandidateDescriptor, PersistedValidationData, OccupiedCoreAssumption, Hash, CandidateCommitments, @@ -368,12 +370,12 @@ fn perform_basic_checks( pov: &PoV, validation_code: &ValidationCode, ) -> Result<(), InvalidCandidate> { - let encoded_pov = pov.encode(); let pov_hash = pov.hash(); let validation_code_hash = validation_code.hash(); - if encoded_pov.len() > max_pov_size as usize { - return Err(InvalidCandidate::ParamsTooLarge(encoded_pov.len() as u64)); + let encoded_pov_size = pov.encoded_size(); + if encoded_pov_size > max_pov_size as usize { + return Err(InvalidCandidate::ParamsTooLarge(encoded_pov_size as u64)); } if pov_hash != candidate.pov_hash { @@ -396,7 +398,7 @@ trait ValidationBackend { fn validate<S: SpawnNamed + 'static>( arg: Self::Arg, - validation_code: &ValidationCode, + raw_validation_code: &[u8], params: ValidationParams, spawn: S, ) -> Result<WasmValidationResult, ValidationError>; @@ -409,12 +411,12 @@ impl ValidationBackend for RealValidationBackend { fn validate<S: SpawnNamed + 'static>( isolation_strategy: IsolationStrategy, - validation_code: &ValidationCode, + raw_validation_code: &[u8], params: ValidationParams, spawn: S, ) -> Result<WasmValidationResult, ValidationError> { wasm_executor::validate_candidate( - &validation_code.0, + &raw_validation_code, params, &isolation_strategy, spawn, @@ -446,14 +448,40 @@ fn validate_candidate_exhaustive<B: ValidationBackend, S: SpawnNamed + 'static>( return Ok(ValidationResult::Invalid(e)) } + let raw_validation_code = match sp_maybe_compressed_blob::decompress( + &validation_code.0, + VALIDATION_CODE_BOMB_LIMIT, + ) { + Ok(code) => code, + Err(e) => { + tracing::debug!(target: LOG_TARGET, err=?e, "Invalid validation code"); + + // If the validation code is invalid, the candidate certainly is. + return Ok(ValidationResult::Invalid(InvalidCandidate::CodeDecompressionFailure)); + } + }; + + let raw_block_data = match sp_maybe_compressed_blob::decompress( + &pov.block_data.0, + POV_BOMB_LIMIT, + ) { + Ok(block_data) => BlockData(block_data.to_vec()), + Err(e) => { + tracing::debug!(target: LOG_TARGET, err=?e, "Invalid PoV code"); + + // If the PoV is invalid, the candidate certainly is. + return Ok(ValidationResult::Invalid(InvalidCandidate::PoVDecompressionFailure)); + } + }; + let params = ValidationParams { parent_head: persisted_validation_data.parent_head.clone(), - block_data: pov.block_data.clone(), + block_data: raw_block_data, relay_parent_number: persisted_validation_data.relay_parent_number, relay_parent_storage_root: persisted_validation_data.relay_parent_storage_root, }; - match B::validate(backend_arg, &validation_code, params, spawn) { + match B::validate(backend_arg, &raw_validation_code, params, spawn) { Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::Timeout)) => Ok(ValidationResult::Invalid(InvalidCandidate::Timeout)), Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::ParamsTooLarge(l, _))) => @@ -580,7 +608,6 @@ mod tests { use super::*; use polkadot_node_subsystem_test_helpers as test_helpers; use polkadot_primitives::v1::{HeadData, UpwardMessage}; - use polkadot_node_primitives::BlockData; use sp_core::testing::TaskExecutor; use futures::executor; use assert_matches::assert_matches; @@ -597,7 +624,7 @@ mod tests { fn validate<S: SpawnNamed + 'static>( arg: Self::Arg, - _validation_code: &ValidationCode, + _raw_validation_code: &[u8], _params: ValidationParams, _spawn: S, ) -> Result<WasmValidationResult, ValidationError> { @@ -1059,4 +1086,139 @@ mod tests { assert_matches!(v, ValidationResult::Invalid(InvalidCandidate::CodeHashMismatch)); } + #[test] + fn compressed_code_works() { + let validation_data = PersistedValidationData { max_pov_size: 1024, ..Default::default() }; + let pov = PoV { block_data: BlockData(vec![1; 32]) }; + let head_data = HeadData(vec![1, 1, 1]); + + let raw_code = vec![2u8; 16]; + let validation_code = sp_maybe_compressed_blob::compress( + &raw_code, + VALIDATION_CODE_BOMB_LIMIT, + ) + .map(ValidationCode) + .unwrap(); + + let mut descriptor = CandidateDescriptor::default(); + descriptor.pov_hash = pov.hash(); + descriptor.para_head = head_data.hash(); + descriptor.validation_code_hash = validation_code.hash(); + collator_sign(&mut descriptor, Sr25519Keyring::Alice); + + let validation_result = WasmValidationResult { + head_data, + new_validation_code: None, + upward_messages: Vec::new(), + horizontal_messages: Vec::new(), + processed_downward_messages: 0, + hrmp_watermark: 0, + }; + + let v = validate_candidate_exhaustive::<MockValidationBackend, _>( + MockValidationArg { result: Ok(validation_result) }, + validation_data, + validation_code, + descriptor, + Arc::new(pov), + TaskExecutor::new(), + &Default::default(), + ); + + assert_matches!(v, Ok(ValidationResult::Valid(_, _))); + } + + #[test] + fn code_decompression_failure_is_invalid() { + let validation_data = PersistedValidationData { max_pov_size: 1024, ..Default::default() }; + let pov = PoV { block_data: BlockData(vec![1; 32]) }; + let head_data = HeadData(vec![1, 1, 1]); + + let raw_code = vec![2u8; VALIDATION_CODE_BOMB_LIMIT + 1]; + let validation_code = sp_maybe_compressed_blob::compress( + &raw_code, + VALIDATION_CODE_BOMB_LIMIT + 1, + ) + .map(ValidationCode) + .unwrap(); + + let mut descriptor = CandidateDescriptor::default(); + descriptor.pov_hash = pov.hash(); + descriptor.para_head = head_data.hash(); + descriptor.validation_code_hash = validation_code.hash(); + collator_sign(&mut descriptor, Sr25519Keyring::Alice); + + let validation_result = WasmValidationResult { + head_data, + new_validation_code: None, + upward_messages: Vec::new(), + horizontal_messages: Vec::new(), + processed_downward_messages: 0, + hrmp_watermark: 0, + }; + + let v = validate_candidate_exhaustive::<MockValidationBackend, _>( + MockValidationArg { result: Ok(validation_result) }, + validation_data, + validation_code, + descriptor, + Arc::new(pov), + TaskExecutor::new(), + &Default::default(), + ); + + assert_matches!( + v, + Ok(ValidationResult::Invalid(InvalidCandidate::CodeDecompressionFailure)) + ); + } + + #[test] + fn pov_decompression_failure_is_invalid() { + let validation_data = PersistedValidationData { + max_pov_size: POV_BOMB_LIMIT as u32, + ..Default::default() + }; + let head_data = HeadData(vec![1, 1, 1]); + + let raw_block_data = vec![2u8; POV_BOMB_LIMIT + 1]; + let pov = sp_maybe_compressed_blob::compress( + &raw_block_data, + POV_BOMB_LIMIT + 1, + ) + .map(|raw| PoV { block_data: BlockData(raw) }) + .unwrap(); + + let validation_code = ValidationCode(vec![2; 16]); + + let mut descriptor = CandidateDescriptor::default(); + descriptor.pov_hash = pov.hash(); + descriptor.para_head = head_data.hash(); + descriptor.validation_code_hash = validation_code.hash(); + collator_sign(&mut descriptor, Sr25519Keyring::Alice); + + let validation_result = WasmValidationResult { + head_data, + new_validation_code: None, + upward_messages: Vec::new(), + horizontal_messages: Vec::new(), + processed_downward_messages: 0, + hrmp_watermark: 0, + }; + + let v = validate_candidate_exhaustive::<MockValidationBackend, _>( + MockValidationArg { result: Ok(validation_result) }, + validation_data, + validation_code, + descriptor, + Arc::new(pov), + TaskExecutor::new(), + &Default::default(), + ); + + assert_matches!( + v, + Ok(ValidationResult::Invalid(InvalidCandidate::PoVDecompressionFailure)) + ); + } } diff --git a/polkadot/node/network/availability-distribution/src/error.rs b/polkadot/node/network/availability-distribution/src/error.rs index 0b07efdc7a4832d620cad5042e482fd0722f2281..5f891325f325c5055a375b2778f070b0f08e4c3d 100644 --- a/polkadot/node/network/availability-distribution/src/error.rs +++ b/polkadot/node/network/availability-distribution/src/error.rs @@ -24,7 +24,6 @@ use futures::channel::oneshot; use polkadot_node_subsystem_util::Error as UtilError; use polkadot_primitives::v1::SessionIndex; -use polkadot_node_primitives::CompressedPoVError; use polkadot_subsystem::{errors::RuntimeApiError, SubsystemError}; use crate::LOG_TARGET; @@ -79,10 +78,6 @@ pub enum Error { #[error("There was no session with the given index")] NoSuchSession(SessionIndex), - /// Decompressing PoV failed. - #[error("PoV could not be decompressed")] - PoVDecompression(CompressedPoVError), - /// Fetching PoV failed with `RequestError`. #[error("FetchPoV request error")] FetchPoV(#[source] RequestError), diff --git a/polkadot/node/network/availability-distribution/src/pov_requester/mod.rs b/polkadot/node/network/availability-distribution/src/pov_requester/mod.rs index 45a3be4108ecb405726b83c6bc111239241e4418..5aecdb26d7e4d2a6d9d181728f950e18c0f70fb6 100644 --- a/polkadot/node/network/availability-distribution/src/pov_requester/mod.rs +++ b/polkadot/node/network/availability-distribution/src/pov_requester/mod.rs @@ -152,9 +152,7 @@ async fn do_fetch_pov( { let response = pending_response.await.map_err(Error::FetchPoV)?; let pov = match response { - PoVFetchingResponse::PoV(compressed) => { - compressed.decompress().map_err(Error::PoVDecompression)? - } + PoVFetchingResponse::PoV(pov) => pov, PoVFetchingResponse::NoSuchPoV => { return Err(Error::NoSuchPoV) } @@ -244,7 +242,7 @@ mod tests { use sp_core::testing::TaskExecutor; use polkadot_primitives::v1::{CandidateHash, Hash, ValidatorIndex}; - use polkadot_node_primitives::{BlockData, CompressedPoV}; + use polkadot_node_primitives::BlockData; use polkadot_subsystem_testhelpers as test_helpers; use polkadot_subsystem::messages::{AvailabilityDistributionMessage, RuntimeApiMessage, RuntimeApiRequest}; @@ -315,9 +313,8 @@ mod tests { reqs.pop(), Some(Requests::PoVFetching(outgoing)) => {outgoing} ); - req.pending_response.send(Ok(PoVFetchingResponse::PoV( - CompressedPoV::compress(&pov).unwrap()).encode() - )).unwrap(); + req.pending_response.send(Ok(PoVFetchingResponse::PoV(pov.clone()).encode())) + .unwrap(); break }, msg => tracing::debug!(target: LOG_TARGET, msg = ?msg, "Received msg"), diff --git a/polkadot/node/network/availability-distribution/src/responder.rs b/polkadot/node/network/availability-distribution/src/responder.rs index 5f91cbceef37a5f5d0e604c576cecd1429aaf505..da3b87a7c378d191aa6330225d35185ec4ea65ff 100644 --- a/polkadot/node/network/availability-distribution/src/responder.rs +++ b/polkadot/node/network/availability-distribution/src/responder.rs @@ -16,11 +16,13 @@ //! Answer requests for availability chunks. +use std::sync::Arc; + use futures::channel::oneshot; use polkadot_node_network_protocol::request_response::{request::IncomingRequest, v1}; use polkadot_primitives::v1::{CandidateHash, ValidatorIndex}; -use polkadot_node_primitives::{AvailableData, CompressedPoV, ErasureChunk}; +use polkadot_node_primitives::{AvailableData, ErasureChunk}; use polkadot_subsystem::{ messages::{AllMessages, AvailabilityStoreMessage}, SubsystemContext, jaeger, @@ -100,18 +102,7 @@ where let response = match av_data { None => v1::PoVFetchingResponse::NoSuchPoV, Some(av_data) => { - let pov = match CompressedPoV::compress(&av_data.pov) { - Ok(pov) => pov, - Err(error) => { - tracing::error!( - target: LOG_TARGET, - error = ?error, - "Failed to create `CompressedPov`", - ); - // this should really not happen, let this request time out: - return Err(Error::PoVDecompression(error)) - } - }; + let pov = Arc::try_unwrap(av_data.pov).unwrap_or_else(|a| (&*a).clone()); v1::PoVFetchingResponse::PoV(pov) } }; diff --git a/polkadot/node/network/collator-protocol/src/collator_side.rs b/polkadot/node/network/collator-protocol/src/collator_side.rs index a8f1dcf3a24c0af7c2e0c1c95369159b63747862..8c7fc3763e37c3ea0e7f96eabe9c852d8c659a58 100644 --- a/polkadot/node/network/collator-protocol/src/collator_side.rs +++ b/polkadot/node/network/collator-protocol/src/collator_side.rs @@ -42,7 +42,7 @@ use polkadot_node_subsystem_util::{ request_availability_cores, metrics::{self, prometheus}, }; -use polkadot_node_primitives::{SignedFullStatement, Statement, PoV, CompressedPoV}; +use polkadot_node_primitives::{SignedFullStatement, Statement, PoV}; const COST_UNEXPECTED_MESSAGE: Rep = Rep::CostMinor("An unexpected message"); @@ -660,27 +660,6 @@ async fn send_collation( receipt: CandidateReceipt, pov: PoV, ) { - let pov = match CompressedPoV::compress(&pov) { - Ok(compressed) => { - tracing::trace!( - target: LOG_TARGET, - size = %pov.block_data.0.len(), - compressed = %compressed.len(), - peer_id = ?request.peer, - "Sending collation." - ); - compressed - }, - Err(error) => { - tracing::error!( - target: LOG_TARGET, - ?error, - "Failed to create `CompressedPov`", - ); - return - } - }; - if let Err(_) = request.send_response(CollationFetchingResponse::Collation(receipt, pov)) { tracing::warn!( target: LOG_TARGET, @@ -1519,7 +1498,7 @@ mod tests { ) .expect("Decoding should work"); assert_eq!(receipt, candidate); - assert_eq!(pov.decompress().unwrap(), pov_block); + assert_eq!(pov, pov_block); } ); diff --git a/polkadot/node/network/collator-protocol/src/validator_side.rs b/polkadot/node/network/collator-protocol/src/validator_side.rs index 7698f28dd1c5428c36a2b7f6ab0676b2371654eb..8bba32865342494b4572a764530a1c95cd51912c 100644 --- a/polkadot/node/network/collator-protocol/src/validator_side.rs +++ b/polkadot/node/network/collator-protocol/src/validator_side.rs @@ -1158,49 +1158,33 @@ where modify_reputation(ctx, *peer_id, COST_WRONG_PARA).await; } - Ok(CollationFetchingResponse::Collation(receipt, compressed_pov)) => { - match compressed_pov.decompress() { - Ok(pov) => { - tracing::debug!( - target: LOG_TARGET, - para_id = %para_id, - hash = ?hash, - candidate_hash = ?receipt.hash(), - "Received collation", - ); - - // Actual sending: - let _span = jaeger::Span::new(&pov, "received-collation"); - let (mut tx, _) = oneshot::channel(); - std::mem::swap(&mut tx, &mut (per_req.to_requester)); - let result = tx.send((receipt, pov)); - - if let Err(_) = result { - tracing::warn!( - target: LOG_TARGET, - hash = ?hash, - para_id = ?para_id, - peer_id = ?peer_id, - "Sending response back to requester failed (receiving side closed)" - ); - } else { - metrics_result = Ok(()); - success = "true"; - } + Ok(CollationFetchingResponse::Collation(receipt, pov)) => { + tracing::debug!( + target: LOG_TARGET, + para_id = %para_id, + hash = ?hash, + candidate_hash = ?receipt.hash(), + "Received collation", + ); - } - Err(error) => { - tracing::warn!( - target: LOG_TARGET, - hash = ?hash, - para_id = ?para_id, - peer_id = ?peer_id, - ?error, - "Failed to extract PoV", - ); - modify_reputation(ctx, *peer_id, COST_CORRUPTED_MESSAGE).await; - } - }; + // Actual sending: + let _span = jaeger::Span::new(&pov, "received-collation"); + let (mut tx, _) = oneshot::channel(); + std::mem::swap(&mut tx, &mut (per_req.to_requester)); + let result = tx.send((receipt, pov)); + + if let Err(_) = result { + tracing::warn!( + target: LOG_TARGET, + hash = ?hash, + para_id = ?para_id, + peer_id = ?peer_id, + "Sending response back to requester failed (receiving side closed)" + ); + } else { + metrics_result = Ok(()); + success = "true"; + } } }; metrics.on_request(metrics_result); @@ -1227,7 +1211,7 @@ mod tests { CollatorPair, ValidatorId, ValidatorIndex, CoreState, CandidateDescriptor, GroupRotationInfo, ScheduledCore, OccupiedCore, GroupIndex, }; - use polkadot_node_primitives::{BlockData, CompressedPoV}; + use polkadot_node_primitives::BlockData; use polkadot_node_subsystem_util::TimeoutExt; use polkadot_subsystem_testhelpers as test_helpers; use polkadot_subsystem::messages::{RuntimeApiMessage, RuntimeApiRequest}; @@ -1859,9 +1843,9 @@ mod tests { response_channel.send(Ok( CollationFetchingResponse::Collation( candidate_a.clone(), - CompressedPoV::compress(&PoV { + PoV { block_data: BlockData(vec![]), - }).unwrap(), + }, ).encode() )).expect("Sending response should succeed"); @@ -1889,9 +1873,9 @@ mod tests { response_channel.send(Ok( CollationFetchingResponse::Collation( candidate_b.clone(), - CompressedPoV::compress(&PoV { + PoV { block_data: BlockData(vec![1, 2, 3]), - }).unwrap(), + }, ).encode() )).expect("Sending response should succeed"); diff --git a/polkadot/node/network/protocol/src/request_response/mod.rs b/polkadot/node/network/protocol/src/request_response/mod.rs index 8e71add066464ecb1f2c08dfd31006f0a9b3b17c..99fd8b18da1c33bfacbc03233a4dbc3225ec3a41 100644 --- a/polkadot/node/network/protocol/src/request_response/mod.rs +++ b/polkadot/node/network/protocol/src/request_response/mod.rs @@ -36,7 +36,7 @@ use std::borrow::Cow; use std::time::Duration; use futures::channel::mpsc; -use polkadot_node_primitives::MAX_COMPRESSED_POV_SIZE; +use polkadot_node_primitives::MAX_POV_SIZE; use strum::EnumIter; pub use sc_network::config as network; @@ -84,7 +84,7 @@ const MIN_BANDWIDTH_BYTES: u64 = 50 * 1024 * 1024; /// Timeout for PoV like data, 2 times what it should take, assuming we can fully utilize the /// bandwidth. This amounts to two seconds right now. const POV_REQUEST_TIMEOUT_CONNECTED: Duration = - Duration::from_millis(2 * 1000 * (MAX_COMPRESSED_POV_SIZE as u64) / MIN_BANDWIDTH_BYTES); + Duration::from_millis(2 * 1000 * (MAX_POV_SIZE as u64) / MIN_BANDWIDTH_BYTES); impl Protocol { /// Get a configuration for a given Request response protocol. @@ -114,7 +114,7 @@ impl Protocol { Protocol::CollationFetching => RequestResponseConfig { name: p_name, max_request_size: 10_000, - max_response_size: MAX_COMPRESSED_POV_SIZE as u64, + max_response_size: MAX_POV_SIZE as u64, // Taken from initial implementation in collator protocol: request_timeout: POV_REQUEST_TIMEOUT_CONNECTED, inbound_queue: Some(tx), @@ -122,7 +122,7 @@ impl Protocol { Protocol::PoVFetching => RequestResponseConfig { name: p_name, max_request_size: 1_000, - max_response_size: MAX_COMPRESSED_POV_SIZE as u64, + max_response_size: MAX_POV_SIZE as u64, request_timeout: POV_REQUEST_TIMEOUT_CONNECTED, inbound_queue: Some(tx), }, @@ -130,7 +130,7 @@ impl Protocol { name: p_name, max_request_size: 1_000, // Available data size is dominated by the PoV size. - max_response_size: MAX_COMPRESSED_POV_SIZE as u64, + max_response_size: MAX_POV_SIZE as u64, request_timeout: POV_REQUEST_TIMEOUT_CONNECTED, inbound_queue: Some(tx), }, diff --git a/polkadot/node/network/protocol/src/request_response/v1.rs b/polkadot/node/network/protocol/src/request_response/v1.rs index 97934075b629cb2e5c339ee3878aca5575f10306..bd362eb2c5108af1cc2a5267956212411871dd3f 100644 --- a/polkadot/node/network/protocol/src/request_response/v1.rs +++ b/polkadot/node/network/protocol/src/request_response/v1.rs @@ -23,7 +23,7 @@ use polkadot_primitives::v1::{ Hash, }; use polkadot_primitives::v1::Id as ParaId; -use polkadot_node_primitives::{AvailableData, CompressedPoV, ErasureChunk}; +use polkadot_node_primitives::{AvailableData, PoV, ErasureChunk}; use super::request::IsRequest; use super::Protocol; @@ -107,7 +107,7 @@ pub struct CollationFetchingRequest { pub enum CollationFetchingResponse { /// Deliver requested collation. #[codec(index = 0)] - Collation(CandidateReceipt, CompressedPoV), + Collation(CandidateReceipt, PoV), } impl IsRequest for CollationFetchingRequest { @@ -127,7 +127,7 @@ pub struct PoVFetchingRequest { pub enum PoVFetchingResponse { /// Deliver requested PoV. #[codec(index = 0)] - PoV(CompressedPoV), + PoV(PoV), /// PoV was not found in store. #[codec(index = 1)] NoSuchPoV, diff --git a/polkadot/node/primitives/Cargo.toml b/polkadot/node/primitives/Cargo.toml index 3765323754a329f5e6f1b91feb40b7fdaf5c5141..e8b01dea00f9a944e62cef3c622b9005d5db107c 100644 --- a/polkadot/node/primitives/Cargo.toml +++ b/polkadot/node/primitives/Cargo.toml @@ -15,6 +15,7 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-consensus-vrf = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-maybe-compressed-blob = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-parachain = { path = "../../parachain", default-features = false } schnorrkel = "0.9.1" thiserror = "1.0.22" diff --git a/polkadot/node/primitives/src/lib.rs b/polkadot/node/primitives/src/lib.rs index db70497b6b8f1f3c48ee1a2b9d1e4fef4b953b42..7ed9db54522caff2c8ac619d4c5a3c585b59c30c 100644 --- a/polkadot/node/primitives/src/lib.rs +++ b/polkadot/node/primitives/src/lib.rs @@ -36,9 +36,17 @@ pub use sp_consensus_babe::{ use polkadot_primitives::v1::{CandidateCommitments, CandidateHash, CollatorPair, CommittedCandidateReceipt, CompactStatement, EncodeAs, Hash, HeadData, Id as ParaId, OutboundHrmpMessage, PersistedValidationData, Signed, UpwardMessage, ValidationCode, BlakeTwo256, HashT, ValidatorIndex}; pub use polkadot_parachain::primitives::BlockData; - pub mod approval; +/// The bomb limit for decompressing code blobs. +pub const VALIDATION_CODE_BOMB_LIMIT: usize = 16 * 1024 * 1024; + +/// Maximum PoV size we support right now. +pub const MAX_POV_SIZE: u32 = 50 * 1024 * 1024; + +/// The bomb limit for decompressing PoV blobs. +pub const POV_BOMB_LIMIT: usize = MAX_POV_SIZE as usize; + /// A statement, where the candidate receipt is included in the `Seconded` variant. /// /// This is the committed candidate receipt instead of the bare candidate receipt. As such, @@ -119,6 +127,10 @@ pub enum InvalidCandidate { ParamsTooLarge(u64), /// Code size is over the limit. CodeTooLarge(u64), + /// Code does not decompress correctly. + CodeDecompressionFailure, + /// PoV does not decompress correctly. + PoVDecompressionFailure, /// Validation function returned invalid data. BadReturn, /// Invalid relay chain parent. @@ -143,17 +155,6 @@ pub enum ValidationResult { Invalid(InvalidCandidate), } -/// Maximum PoV size we support right now. -pub const MAX_POV_SIZE: u32 = 50 * 1024 * 1024; - -/// Very conservative (compression ratio of 1). -/// -/// Experiments showed that we have a typical compression ratio of 3.4. -/// https://github.com/ordian/bench-compression-algorithms/ -/// -/// So this could be reduced if deemed necessary. -pub const MAX_COMPRESSED_POV_SIZE: u32 = MAX_POV_SIZE; - /// A Proof-of-Validity #[derive(PartialEq, Eq, Clone, Encode, Decode, Debug)] pub struct PoV { @@ -168,77 +169,6 @@ impl PoV { } } -/// SCALE and Zstd encoded [`PoV`]. -#[derive(Clone, Encode, Decode, PartialEq, Eq)] -pub struct CompressedPoV(Vec<u8>); - -#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)] -#[allow(missing_docs)] -pub enum CompressedPoVError { - #[error("Failed to compress a PoV")] - Compress, - #[error("Failed to decompress a PoV")] - Decompress, - #[error("Failed to decode the uncompressed PoV")] - Decode, - #[error("Architecture is not supported")] - NotSupported, -} - -impl CompressedPoV { - /// Compress the given [`PoV`] and returns a [`CompressedPoV`]. - #[cfg(not(target_os = "unknown"))] - pub fn compress(pov: &PoV) -> Result<Self, CompressedPoVError> { - zstd::encode_all(pov.encode().as_slice(), 3).map_err(|_| CompressedPoVError::Compress).map(Self) - } - - /// Compress the given [`PoV`] and returns a [`CompressedPoV`]. - #[cfg(target_os = "unknown")] - pub fn compress(_: &PoV) -> Result<Self, CompressedPoVError> { - Err(CompressedPoVError::NotSupported) - } - - /// Decompress `self` and returns the [`PoV`] on success. - #[cfg(not(target_os = "unknown"))] - pub fn decompress(&self) -> Result<PoV, CompressedPoVError> { - use std::io::Read; - - struct InputDecoder<'a, 'b: 'a, T: std::io::BufRead>(&'a mut zstd::Decoder<'b, T>, usize); - impl<'a, 'b, T: std::io::BufRead> parity_scale_codec::Input for InputDecoder<'a, 'b, T> { - fn read(&mut self, into: &mut [u8]) -> Result<(), parity_scale_codec::Error> { - self.1 = self.1.saturating_add(into.len()); - if self.1 > MAX_POV_SIZE as usize { - return Err("pov block too big".into()) - } - self.0.read_exact(into).map_err(Into::into) - } - fn remaining_len(&mut self) -> Result<Option<usize>, parity_scale_codec::Error> { - Ok(None) - } - } - - let mut decoder = zstd::Decoder::new(self.0.as_slice()).map_err(|_| CompressedPoVError::Decompress)?; - PoV::decode(&mut InputDecoder(&mut decoder, 0)).map_err(|_| CompressedPoVError::Decode) - } - - /// Decompress `self` and returns the [`PoV`] on success. - #[cfg(target_os = "unknown")] - pub fn decompress(&self) -> Result<PoV, CompressedPoVError> { - Err(CompressedPoVError::NotSupported) - } - - /// Get compressed data size. - pub fn len(&self) -> usize { - self.0.len() - } -} - -impl std::fmt::Debug for CompressedPoV { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "CompressedPoV({} bytes)", self.0.len()) - } -} - /// The output of a collator. /// /// This differs from `CandidateCommitments` in two ways: @@ -330,15 +260,13 @@ pub struct ErasureChunk { pub proof: Vec<Vec<u8>>, } -#[cfg(test)] -mod test { - use super::{CompressedPoV, CompressedPoVError, PoV}; +/// Compress a PoV, unless it exceeds the [`POV_BOMB_LIMIT`]. +#[cfg(not(target_os = "unknown"))] +pub fn maybe_compress_pov(pov: PoV) -> PoV { + let PoV { block_data: BlockData(raw) } = pov; + let raw = sp_maybe_compressed_blob::compress(&raw, POV_BOMB_LIMIT) + .unwrap_or(raw); - #[test] - fn decompress_huge_pov_block_fails() { - let pov = PoV { block_data: vec![0; 63 * 1024 * 1024].into() }; - - let compressed = CompressedPoV::compress(&pov).unwrap(); - assert_eq!(CompressedPoVError::Decode, compressed.decompress().unwrap_err()); - } + let pov = PoV { block_data: BlockData(raw) }; + pov } diff --git a/polkadot/parachain/test-parachains/adder/collator/src/lib.rs b/polkadot/parachain/test-parachains/adder/collator/src/lib.rs index 5573d2d0639f8425814a5a22be7dc193033bd5a2..03724ea79d993c97fba252e5bd2de91d832a144d 100644 --- a/polkadot/parachain/test-parachains/adder/collator/src/lib.rs +++ b/polkadot/parachain/test-parachains/adder/collator/src/lib.rs @@ -176,13 +176,15 @@ impl Collator { hrmp_watermark: validation_data.relay_parent_number, }; + let compressed_pov = polkadot_node_primitives::maybe_compress_pov(pov); + let (result_sender, recv) = oneshot::channel::<SignedFullStatement>(); let seconded_collations = seconded_collations.clone(); spawner.spawn("adder-collator-seconded", async move { if let Ok(res) = recv.await { if !matches!( res.payload(), - Statement::Seconded(s) if s.descriptor.pov_hash == pov.hash(), + Statement::Seconded(s) if s.descriptor.pov_hash == compressed_pov.hash(), ) { log::error!("Seconded statement should match our collation: {:?}", res.payload()); std::process::exit(-1); diff --git a/polkadot/roadmap/implementers-guide/src/types/network.md b/polkadot/roadmap/implementers-guide/src/types/network.md index 0dc9d05699eda335ea39a627752c2d9f85d9ba72..ee763e4d1aad1d040e778aefc3637a03ebc97ea6 100644 --- a/polkadot/roadmap/implementers-guide/src/types/network.md +++ b/polkadot/roadmap/implementers-guide/src/types/network.md @@ -19,9 +19,6 @@ enum ObservedRole { Full, Light, } - -/// SCALE and zstd encoded `PoV`. -struct CompressedPoV(Vec<u8>); ``` ## V1 Network Subsystem Message Types @@ -84,8 +81,8 @@ enum PoVDistributionV1Message { /// specific relay-parent hash. Awaiting(Hash, Vec<Hash>), /// Notification of an awaited PoV, in a given relay-parent context. - /// (relay_parent, pov_hash, compressed_pov) - SendPoV(Hash, Hash, CompressedPoV), + /// (relay_parent, pov_hash, pov) + SendPoV(Hash, Hash, PoV), } ```