diff --git a/Cargo.lock b/Cargo.lock index 0923ed48d4..eb932e95da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -971,6 +971,7 @@ dependencies = [ "pallet-transaction-payment", "parity-scale-codec", "scale-info", + "sp-api", "sp-core", "sp-runtime", "sp-state-machine", diff --git a/bin/runtime-common/Cargo.toml b/bin/runtime-common/Cargo.toml index 632f45e581..a7d1713afa 100644 --- a/bin/runtime-common/Cargo.toml +++ b/bin/runtime-common/Cargo.toml @@ -29,6 +29,7 @@ frame-support = { git = "https://github.com/paritytech/substrate", branch = "mas frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } @@ -50,6 +51,7 @@ std = [ "pallet-bridge-messages/std", "pallet-transaction-payment/std", "scale-info/std", + "sp-api/std", "sp-core/std", "sp-runtime/std", "sp-state-machine/std", diff --git a/bin/runtime-common/src/messages.rs b/bin/runtime-common/src/messages.rs index 3e548361f9..f0e23adec2 100644 --- a/bin/runtime-common/src/messages.rs +++ b/bin/runtime-common/src/messages.rs @@ -30,7 +30,7 @@ use bp_runtime::{ messages::{DispatchFeePayment, MessageDispatchResult}, ChainId, Size, StorageProofChecker, }; -use codec::{Decode, Encode}; +use codec::{Decode, DecodeLimit, Encode}; use frame_support::{ traits::{Currency, ExistenceRequirement}, weights::{Weight, WeightToFeePolynomial}, @@ -521,7 +521,11 @@ pub mod target { for Result { fn from(encoded_call: FromBridgedChainEncodedMessageCall) -> Self { - DecodedCall::decode(&mut &encoded_call.encoded_call[..]).map_err(drop) + DecodedCall::decode_with_depth_limit( + sp_api::MAX_EXTRINSIC_DEPTH, + &mut &encoded_call.encoded_call[..], + ) + .map_err(drop) } }