From 1aab3349cc3a4fac0df1d88cd98ae961ed6a7cde Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Sun, 19 Sep 2021 05:29:34 -0700 Subject: [PATCH] Use DecodeLimit for decoding XCM messages (#605) * Use DecodeLimit for decoding XCM messages * Use decode_all_with_depth_limit in appropriate places * Use decode_all while decoding byte vector * cargo fmt --- Cargo.lock | 4 ++-- client/collator/Cargo.toml | 2 +- client/consensus/aura/Cargo.toml | 2 +- client/consensus/common/Cargo.toml | 2 +- client/network/Cargo.toml | 2 +- client/pov-recovery/Cargo.toml | 2 +- client/service/Cargo.toml | 2 +- pallets/aura-ext/Cargo.toml | 2 +- pallets/collator-selection/Cargo.toml | 2 +- pallets/dmp-queue/Cargo.toml | 2 +- pallets/dmp-queue/src/lib.rs | 11 ++++++---- pallets/parachain-system/Cargo.toml | 2 +- pallets/xcm/Cargo.toml | 2 +- pallets/xcm/src/lib.rs | 16 ++++++++++---- pallets/xcmp-queue/Cargo.toml | 4 ++-- pallets/xcmp-queue/src/lib.rs | 22 ++++++++++++++----- polkadot-parachains/Cargo.toml | 2 +- .../pallets/parachain-info/Cargo.toml | 2 +- polkadot-parachains/pallets/ping/Cargo.toml | 2 +- .../parachains-common/Cargo.toml | 2 +- polkadot-parachains/rococo/Cargo.toml | 6 ++--- polkadot-parachains/shell/Cargo.toml | 6 ++--- polkadot-parachains/statemine/Cargo.toml | 8 +++---- polkadot-parachains/statemint/Cargo.toml | 8 +++---- polkadot-parachains/westmint/Cargo.toml | 8 +++---- primitives/core/Cargo.toml | 2 +- primitives/parachain-inherent/Cargo.toml | 4 ++-- primitives/timestamp/Cargo.toml | 2 +- primitives/utility/Cargo.toml | 2 +- test/client/Cargo.toml | 2 +- test/relay-sproof-builder/Cargo.toml | 2 +- test/runtime-upgrade/Cargo.toml | 2 +- test/runtime/Cargo.toml | 2 +- test/service/Cargo.toml | 2 +- 34 files changed, 82 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3c639c0f7..b19bf5f628 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5958,9 +5958,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8975095a2a03bbbdc70a74ab11a4f76a6d0b84680d87c68d722531b0ac28e8a9" +checksum = "e11263a97373b43da4b426edbb52ef99a7b51e2d9752ef56a7f8b356f48495a5" dependencies = [ "arrayvec 0.7.0", "bitvec 0.20.1", diff --git a/client/collator/Cargo.toml b/client/collator/Cargo.toml index a3e77615c3..6f65d48029 100644 --- a/client/collator/Cargo.toml +++ b/client/collator/Cargo.toml @@ -24,7 +24,7 @@ cumulus-client-consensus-common = { path = "../consensus/common" } cumulus-primitives-core = { path = "../../primitives/core" } # Other dependencies -codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ] } +codec = { package = "parity-scale-codec", version = "2.3.0", features = [ "derive" ] } futures = { version = "0.3.1", features = ["compat"] } parking_lot = "0.10.2" tracing = "0.1.25" diff --git a/client/consensus/aura/Cargo.toml b/client/consensus/aura/Cargo.toml index 5a7ff13d2f..35a0e47fd8 100644 --- a/client/consensus/aura/Cargo.toml +++ b/client/consensus/aura/Cargo.toml @@ -33,6 +33,6 @@ cumulus-primitives-core = { path = "../../../primitives/core" } # Other deps futures = { version = "0.3.8", features = ["compat"] } -codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ] } +codec = { package = "parity-scale-codec", version = "2.3.0", features = [ "derive" ] } tracing = "0.1.22" async-trait = "0.1.42" diff --git a/client/consensus/common/Cargo.toml b/client/consensus/common/Cargo.toml index 2733bad647..e8a66b3f25 100644 --- a/client/consensus/common/Cargo.toml +++ b/client/consensus/common/Cargo.toml @@ -20,7 +20,7 @@ polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = # Other deps futures = { version = "0.3.8", features = ["compat"] } -codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ] } +codec = { package = "parity-scale-codec", version = "2.3.0", features = [ "derive" ] } tracing = "0.1.25" async-trait = "0.1.42" dyn-clone = "1.0.4" diff --git a/client/network/Cargo.toml b/client/network/Cargo.toml index e176f6b729..ecdf4c9704 100644 --- a/client/network/Cargo.toml +++ b/client/network/Cargo.toml @@ -21,7 +21,7 @@ polkadot-client = { git = "https://github.com/paritytech/polkadot", branch = "ma polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "master" } # other deps -codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ] } +codec = { package = "parity-scale-codec", version = "2.3.0", features = [ "derive" ] } futures = { version = "0.3.1", features = ["compat"] } futures-timer = "3.0.2" tracing = "0.1.22" diff --git a/client/pov-recovery/Cargo.toml b/client/pov-recovery/Cargo.toml index 110bafb57a..31b96d0e4b 100644 --- a/client/pov-recovery/Cargo.toml +++ b/client/pov-recovery/Cargo.toml @@ -24,7 +24,7 @@ polkadot-node-subsystem = { git = "https://github.com/paritytech/polkadot", bran cumulus-primitives-core = { path = "../../primitives/core" } # other deps -codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ] } +codec = { package = "parity-scale-codec", version = "2.3.0", features = [ "derive" ] } futures = { version = "0.3.1", features = ["compat"] } futures-timer = "3.0.2" tracing = "0.1.22" diff --git a/client/service/Cargo.toml b/client/service/Cargo.toml index 187e19c301..051482ad34 100644 --- a/client/service/Cargo.toml +++ b/client/service/Cargo.toml @@ -32,5 +32,5 @@ polkadot-overseer = { git = "https://github.com/paritytech/polkadot", branch = " # Other deps tracing = "0.1.22" -codec = { package = "parity-scale-codec", version = "2.0.0" } +codec = { package = "parity-scale-codec", version = "2.3.0" } parking_lot = "0.10.2" diff --git a/pallets/aura-ext/Cargo.toml b/pallets/aura-ext/Cargo.toml index 83ba9a1758..72b3366dab 100644 --- a/pallets/aura-ext/Cargo.toml +++ b/pallets/aura-ext/Cargo.toml @@ -17,7 +17,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", default-features sp-application-crypto = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } # Other Dependencies -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"]} +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = ["derive"]} scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } serde = { version = "1.0.101", optional = true, features = ["derive"] } diff --git a/pallets/collator-selection/Cargo.toml b/pallets/collator-selection/Cargo.toml index d3d39a89ce..b73e9a353e 100644 --- a/pallets/collator-selection/Cargo.toml +++ b/pallets/collator-selection/Cargo.toml @@ -14,7 +14,7 @@ targets = ['x86_64-unknown-linux-gnu'] [dependencies] log = { version = "0.4.0", default-features = false } -codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = '2.0.0' } +codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = '2.3.0' } scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } serde = { version = "1.0.119", default-features = false } sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = "master" } diff --git a/pallets/dmp-queue/Cargo.toml b/pallets/dmp-queue/Cargo.toml index c4a8e20dd2..402fc658f5 100644 --- a/pallets/dmp-queue/Cargo.toml +++ b/pallets/dmp-queue/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] # Other dependencies -codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ], default-features = false } +codec = { package = "parity-scale-codec", version = "2.3.0", features = [ "derive" ], default-features = false } scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } log = { version = "0.4.14", default-features = false } diff --git a/pallets/dmp-queue/src/lib.rs b/pallets/dmp-queue/src/lib.rs index adaca469a2..ebd2b59767 100644 --- a/pallets/dmp-queue/src/lib.rs +++ b/pallets/dmp-queue/src/lib.rs @@ -21,7 +21,7 @@ #![cfg_attr(not(feature = "std"), no_std)] -use codec::{Decode, Encode}; +use codec::{Decode, DecodeLimit, Encode}; use cumulus_primitives_core::{relay_chain::BlockNumber as RelayBlockNumber, DmpMessageHandler}; use frame_support::{ dispatch::Weight, traits::EnsureOrigin, weights::constants::WEIGHT_PER_MILLIS, @@ -30,7 +30,7 @@ pub use pallet::*; use scale_info::TypeInfo; use sp_runtime::RuntimeDebug; use sp_std::{convert::TryFrom, prelude::*}; -use xcm::{latest::prelude::*, VersionedXcm}; +use xcm::{latest::prelude::*, VersionedXcm, MAX_XCM_DECODE_DEPTH}; #[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] pub struct ConfigData { @@ -225,8 +225,11 @@ pub mod pallet { data: &[u8], ) -> Result { let id = sp_io::hashing::blake2_256(&data[..]); - let maybe_msg = - VersionedXcm::::decode(&mut &data[..]).map(Xcm::::try_from); + let maybe_msg = VersionedXcm::::decode_all_with_depth_limit( + MAX_XCM_DECODE_DEPTH, + &mut &data[..], + ) + .map(Xcm::::try_from); match maybe_msg { Err(_) => { Self::deposit_event(Event::InvalidFormat(id)); diff --git a/pallets/parachain-system/Cargo.toml b/pallets/parachain-system/Cargo.toml index e58879ad7c..feee0b090a 100644 --- a/pallets/parachain-system/Cargo.toml +++ b/pallets/parachain-system/Cargo.toml @@ -30,7 +30,7 @@ sp-trie = { git = "https://github.com/paritytech/substrate", default-features = sp-externalities = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } # Other Dependencies -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"]} +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = ["derive"]} scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } serde = { version = "1.0.101", optional = true, features = ["derive"] } log = { version = "0.4.14", default-features = false } diff --git a/pallets/xcm/Cargo.toml b/pallets/xcm/Cargo.toml index 71f6684269..e56b47a990 100644 --- a/pallets/xcm/Cargo.toml +++ b/pallets/xcm/Cargo.toml @@ -5,7 +5,7 @@ name = "cumulus-pallet-xcm" version = "0.1.0" [dependencies] -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } serde = { version = "1.0.101", optional = true, features = ["derive"] } diff --git a/pallets/xcm/src/lib.rs b/pallets/xcm/src/lib.rs index 15427eb7d0..ab61076ddf 100644 --- a/pallets/xcm/src/lib.rs +++ b/pallets/xcm/src/lib.rs @@ -20,7 +20,7 @@ #![cfg_attr(not(feature = "std"), no_std)] -use codec::{Decode, Encode}; +use codec::{Decode, DecodeLimit, Encode}; use cumulus_primitives_core::{ relay_chain::BlockNumber as RelayBlockNumber, DmpMessageHandler, ParaId, }; @@ -31,7 +31,7 @@ use sp_runtime::traits::BadOrigin; use sp_std::{convert::TryFrom, prelude::*}; use xcm::{ latest::{ExecuteXcm, Outcome, Parent, Xcm}, - VersionedXcm, + VersionedXcm, MAX_XCM_DECODE_DEPTH, }; #[frame_support::pallet] @@ -115,7 +115,11 @@ impl DmpMessageHandler for UnlimitedDmpExecution { let mut used = 0; for (_sent_at, data) in iter { let id = sp_io::hashing::twox_64(&data[..]); - let msg = VersionedXcm::::decode(&mut &data[..]).map(Xcm::::try_from); + let msg = VersionedXcm::::decode_all_with_depth_limit( + MAX_XCM_DECODE_DEPTH, + &mut &data[..], + ) + .map(Xcm::::try_from); match msg { Err(_) => Pallet::::deposit_event(Event::InvalidFormat(id)), Ok(Err(())) => Pallet::::deposit_event(Event::UnsupportedVersion(id)), @@ -144,7 +148,11 @@ impl DmpMessageHandler for LimitAndDropDmpExecution { let mut used = 0; for (_sent_at, data) in iter { let id = sp_io::hashing::twox_64(&data[..]); - let msg = VersionedXcm::::decode(&mut &data[..]).map(Xcm::::try_from); + let msg = VersionedXcm::::decode_all_with_depth_limit( + MAX_XCM_DECODE_DEPTH, + &mut &data[..], + ) + .map(Xcm::::try_from); match msg { Err(_) => Pallet::::deposit_event(Event::InvalidFormat(id)), Ok(Err(())) => Pallet::::deposit_event(Event::UnsupportedVersion(id)), diff --git a/pallets/xcmp-queue/Cargo.toml b/pallets/xcmp-queue/Cargo.toml index 6c4549c5ef..0ee1751139 100644 --- a/pallets/xcmp-queue/Cargo.toml +++ b/pallets/xcmp-queue/Cargo.toml @@ -6,10 +6,10 @@ edition = "2018" [dependencies] # Other dependencies -codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ], default-features = false } +codec = { package = "parity-scale-codec", version = "2.3.0", features = [ "derive" ], default-features = false } +rand_chacha = { version = "0.3.0", default-features = false } scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } log = { version = "0.4.14", default-features = false } -rand_chacha = { version = "0.3.0", default-features = false } # Substrate Dependencies sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } diff --git a/pallets/xcmp-queue/src/lib.rs b/pallets/xcmp-queue/src/lib.rs index 3b429ea0de..9f3ecc8ffa 100644 --- a/pallets/xcmp-queue/src/lib.rs +++ b/pallets/xcmp-queue/src/lib.rs @@ -31,7 +31,7 @@ mod mock; #[cfg(test)] mod tests; -use codec::{Decode, Encode}; +use codec::{Decode, DecodeAll, DecodeLimit, Encode}; use cumulus_primitives_core::{ relay_chain::BlockNumber as RelayBlockNumber, ChannelStatus, GetChannelInfo, MessageSendError, ParaId, XcmpMessageFormat, XcmpMessageHandler, XcmpMessageSource, @@ -44,7 +44,7 @@ use rand_chacha::{ use scale_info::TypeInfo; use sp_runtime::{traits::Hash, RuntimeDebug}; use sp_std::{convert::TryFrom, prelude::*}; -use xcm::{latest::prelude::*, VersionedXcm, WrapVersion}; +use xcm::{latest::prelude::*, VersionedXcm, WrapVersion, MAX_XCM_DECODE_DEPTH}; pub use pallet::*; @@ -249,7 +249,11 @@ impl Pallet { let have_active = s[index].4 > s[index].3; let appended = have_active && >::mutate(recipient, s[index].4 - 1, |s| { - if XcmpMessageFormat::decode(&mut &s[..]) != Ok(format) { + if XcmpMessageFormat::decode_and_advance_with_depth_limit( + MAX_XCM_DECODE_DEPTH, + &mut &s[..], + ) != Ok(format) + { return false } if s.len() + data.len() > max_message_size { @@ -371,7 +375,10 @@ impl Pallet { XcmpMessageFormat::ConcatenatedVersionedXcm => { while !remaining_fragments.is_empty() { last_remaining_fragments = remaining_fragments; - if let Ok(xcm) = VersionedXcm::::decode(&mut remaining_fragments) { + if let Ok(xcm) = VersionedXcm::::decode_and_advance_with_depth_limit( + MAX_XCM_DECODE_DEPTH, + &mut remaining_fragments, + ) { let weight = max_weight - weight_used; match Self::handle_xcm_message(sender, sent_at, xcm, weight) { Ok(used) => weight_used = weight_used.saturating_add(used), @@ -394,7 +401,7 @@ impl Pallet { XcmpMessageFormat::ConcatenatedEncodedBlob => { while !remaining_fragments.is_empty() { last_remaining_fragments = remaining_fragments; - if let Ok(blob) = >::decode(&mut remaining_fragments) { + if let Ok(blob) = >::decode_all(&mut remaining_fragments) { let weight = max_weight - weight_used; match Self::handle_blob_message(sender, sent_at, blob, weight) { Ok(used) => weight_used = weight_used.saturating_add(used), @@ -588,7 +595,10 @@ impl XcmpMessageHandler for Pallet { for (sender, sent_at, data) in iter { // Figure out the message format. let mut data_ref = data; - let format = match XcmpMessageFormat::decode(&mut data_ref) { + let format = match XcmpMessageFormat::decode_and_advance_with_depth_limit( + MAX_XCM_DECODE_DEPTH, + &mut data_ref, + ) { Ok(f) => f, Err(_) => { debug_assert!(false, "Unknown XCMP message format. Silently dropping message"); diff --git a/polkadot-parachains/Cargo.toml b/polkadot-parachains/Cargo.toml index 26ef020972..f4f2428055 100644 --- a/polkadot-parachains/Cargo.toml +++ b/polkadot-parachains/Cargo.toml @@ -12,7 +12,7 @@ path = "src/main.rs" [dependencies] futures = { version = "0.3.1", features = ["compat"] } log = "0.4.8" -codec = { package = "parity-scale-codec", version = "2.0.0" } +codec = { package = "parity-scale-codec", version = "2.3.0" } structopt = "0.3.3" serde = { version = "1.0.101", features = ["derive"] } hex-literal = "0.2.1" diff --git a/polkadot-parachains/pallets/parachain-info/Cargo.toml b/polkadot-parachains/pallets/parachain-info/Cargo.toml index 857b2523b5..c5add537a0 100644 --- a/polkadot-parachains/pallets/parachain-info/Cargo.toml +++ b/polkadot-parachains/pallets/parachain-info/Cargo.toml @@ -5,7 +5,7 @@ name = "parachain-info" version = "0.1.0" [dependencies] -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } serde = { version = "1.0.101", optional = true, features = ["derive"] } diff --git a/polkadot-parachains/pallets/ping/Cargo.toml b/polkadot-parachains/pallets/ping/Cargo.toml index 9175b03d10..28b08451ab 100644 --- a/polkadot-parachains/pallets/ping/Cargo.toml +++ b/polkadot-parachains/pallets/ping/Cargo.toml @@ -5,7 +5,7 @@ name = "cumulus-ping" version = "0.1.0" [dependencies] -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } serde = { version = "1.0.101", optional = true, features = ["derive"] } diff --git a/polkadot-parachains/parachains-common/Cargo.toml b/polkadot-parachains/parachains-common/Cargo.toml index 9fb879fbf8..25227bb454 100644 --- a/polkadot-parachains/parachains-common/Cargo.toml +++ b/polkadot-parachains/parachains-common/Cargo.toml @@ -10,7 +10,7 @@ targets = ['x86_64-unknown-linux-gnu'] [dependencies] # External dependencies -codec = { package = 'parity-scale-codec', version = '2.0.0', features = ['derive'], default-features = false } +codec = { package = 'parity-scale-codec', version = '2.3.0', features = ['derive'], default-features = false } scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } # Substrate dependencies diff --git a/polkadot-parachains/rococo/Cargo.toml b/polkadot-parachains/rococo/Cargo.toml index 47aa9e1f8b..5916989bf0 100644 --- a/polkadot-parachains/rococo/Cargo.toml +++ b/polkadot-parachains/rococo/Cargo.toml @@ -6,11 +6,11 @@ edition = '2018' description = "Simple runtime used by the rococo parachain(s)" [dependencies] -serde = { version = "1.0.101", optional = true, features = ["derive"] } -scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = ["derive"] } log = { version = "0.4.14", default-features = false } parachain-info = { path = "../pallets/parachain-info", default-features = false } +scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.101", optional = true, features = ["derive"] } # Substrate dependencies sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } diff --git a/polkadot-parachains/shell/Cargo.toml b/polkadot-parachains/shell/Cargo.toml index e3bf289382..2a0edf2335 100644 --- a/polkadot-parachains/shell/Cargo.toml +++ b/polkadot-parachains/shell/Cargo.toml @@ -5,11 +5,11 @@ authors = ["Parity Technologies "] edition = '2018' [dependencies] -serde = { version = "1.0.101", optional = true, features = ["derive"] } -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = ["derive"] } log = { version = "0.4.14", default-features = false } parachain-info = { path = "../pallets/parachain-info", default-features = false } +scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.101", optional = true, features = ["derive"] } # Substrate dependencies sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } diff --git a/polkadot-parachains/statemine/Cargo.toml b/polkadot-parachains/statemine/Cargo.toml index 00625e4787..c349d3f38f 100644 --- a/polkadot-parachains/statemine/Cargo.toml +++ b/polkadot-parachains/statemine/Cargo.toml @@ -6,13 +6,13 @@ edition = '2018' description = "Kusama variant of Statemint parachain runtime" [dependencies] -serde = { version = "1.0.101", optional = true, features = ["derive"] } -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive", "max-encoded-len"] } -scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = ["derive", "max-encoded-len"] } +hex-literal = { version = '0.3.1', optional = true } log = { version = "0.4.14", default-features = false } parachain-info = { path = "../pallets/parachain-info", default-features = false } +scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.101", optional = true, features = ["derive"] } smallvec = "1.6.1" -hex-literal = { version = '0.3.1', optional = true } # Substrate dependencies sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } diff --git a/polkadot-parachains/statemint/Cargo.toml b/polkadot-parachains/statemint/Cargo.toml index 1d41a64d48..cae3781e40 100644 --- a/polkadot-parachains/statemint/Cargo.toml +++ b/polkadot-parachains/statemint/Cargo.toml @@ -6,13 +6,13 @@ edition = '2018' description = "Statemint parachain runtime" [dependencies] -serde = { version = "1.0.101", optional = true, features = ["derive"] } -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive", "max-encoded-len"] } -scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = ["derive", "max-encoded-len"] } +hex-literal = { version = '0.3.1', optional = true } log = { version = "0.4.14", default-features = false } parachain-info = { path = "../pallets/parachain-info", default-features = false } +serde = { version = "1.0.101", optional = true, features = ["derive"] } +scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } smallvec = "1.6.1" -hex-literal = { version = '0.3.1', optional = true } # Substrate dependencies sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } diff --git a/polkadot-parachains/westmint/Cargo.toml b/polkadot-parachains/westmint/Cargo.toml index a300f52488..fc714dcf8a 100644 --- a/polkadot-parachains/westmint/Cargo.toml +++ b/polkadot-parachains/westmint/Cargo.toml @@ -6,13 +6,13 @@ edition = '2018' description = "Westend variant of Statemint parachain runtime" [dependencies] -serde = { version = "1.0.101", optional = true, features = ["derive"] } -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive", "max-encoded-len"] } -scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = ["derive", "max-encoded-len"] } +hex-literal = { version = '0.3.1', optional = true } log = { version = "0.4.14", default-features = false } parachain-info = { path = "../pallets/parachain-info", default-features = false } +scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.101", optional = true, features = ["derive"] } smallvec = "1.6.1" -hex-literal = { version = '0.3.1', optional = true } # Substrate dependencies sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } diff --git a/primitives/core/Cargo.toml b/primitives/core/Cargo.toml index 3e6e2c5550..95ac9d8c8e 100644 --- a/primitives/core/Cargo.toml +++ b/primitives/core/Cargo.toml @@ -19,7 +19,7 @@ polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", def # Other dependencies impl-trait-for-tuples = "0.2.1" -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ "derive" ] } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = [ "derive" ] } [features] default = [ "std" ] diff --git a/primitives/parachain-inherent/Cargo.toml b/primitives/parachain-inherent/Cargo.toml index 2042ff39bc..b76ec7822d 100644 --- a/primitives/parachain-inherent/Cargo.toml +++ b/primitives/parachain-inherent/Cargo.toml @@ -23,10 +23,10 @@ cumulus-primitives-core = { path = "../core", default-features = false } cumulus-test-relay-sproof-builder = { path = "../../test/relay-sproof-builder", optional = true } # Other dependencies -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ "derive" ] } +async-trait = { version = "0.1.42", optional = true } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = [ "derive" ] } scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } tracing = { version = "0.1.22", optional = true } -async-trait = { version = "0.1.42", optional = true } [features] default = [ "std" ] diff --git a/primitives/timestamp/Cargo.toml b/primitives/timestamp/Cargo.toml index 4cd8b262d8..e3404261cb 100644 --- a/primitives/timestamp/Cargo.toml +++ b/primitives/timestamp/Cargo.toml @@ -25,7 +25,7 @@ cumulus-test-client = { path = "../../test/client" } cumulus-test-relay-sproof-builder = { path = "../../test/relay-sproof-builder" } # Other deps -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ "derive" ] } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = [ "derive" ] } futures = "0.3.5" [features] diff --git a/primitives/utility/Cargo.toml b/primitives/utility/Cargo.toml index 22f233062a..446af89907 100644 --- a/primitives/utility/Cargo.toml +++ b/primitives/utility/Cargo.toml @@ -20,7 +20,7 @@ xcm = { git = "https://github.com/paritytech/polkadot", default-features = false cumulus-primitives-core = { path = "../core", default-features = false } # Other dependencies -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ "derive" ] } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = [ "derive" ] } [features] diff --git a/test/client/Cargo.toml b/test/client/Cargo.toml index e42f8c5c4e..2ae58f6775 100644 --- a/test/client/Cargo.toml +++ b/test/client/Cargo.toml @@ -35,4 +35,4 @@ polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "master" } # Other deps -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ "derive" ] } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = [ "derive" ] } diff --git a/test/relay-sproof-builder/Cargo.toml b/test/relay-sproof-builder/Cargo.toml index 9342ff7472..a951fddf1c 100644 --- a/test/relay-sproof-builder/Cargo.toml +++ b/test/relay-sproof-builder/Cargo.toml @@ -6,7 +6,7 @@ edition = '2018' [dependencies] # Other dependencies -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ "derive" ] } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = [ "derive" ] } # Substrate dependencies sp-state-machine = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } diff --git a/test/runtime-upgrade/Cargo.toml b/test/runtime-upgrade/Cargo.toml index 9751d36b30..efe9206196 100644 --- a/test/runtime-upgrade/Cargo.toml +++ b/test/runtime-upgrade/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] edition = "2018" [dependencies] -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } serde = { version = "1.0.101", optional = true, features = ["derive"] } diff --git a/test/runtime/Cargo.toml b/test/runtime/Cargo.toml index 09ef47a487..9b6cadb634 100644 --- a/test/runtime/Cargo.toml +++ b/test/runtime/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] edition = "2018" [dependencies] -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.3.0", default-features = false, features = ["derive"] } scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } serde = { version = "1.0.101", optional = true, features = ["derive"] } diff --git a/test/service/Cargo.toml b/test/service/Cargo.toml index 613ea506d0..f0cfe177c9 100644 --- a/test/service/Cargo.toml +++ b/test/service/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] edition = "2018" [dependencies] -codec = { package = "parity-scale-codec", version = "2.0.0" } +codec = { package = "parity-scale-codec", version = "2.3.0" } rand = "0.7.3" serde = { version = "1.0.101", features = ["derive"] } async-trait = "0.1.42"