From c34c688dec3da79570c5e8b16db6e4180fd3928a Mon Sep 17 00:00:00 2001 From: Sam Johnson Date: Wed, 21 May 2025 18:19:45 -0400 Subject: [PATCH 1/2] fix everything --- runtime/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 64937fd3bb..0c1be0e67e 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -1709,6 +1709,14 @@ impl_runtime_apis! { tx: ::Extrinsic, block_hash: ::Hash, ) -> TransactionValidity { + use codec::DecodeLimit; + use frame_support::pallet_prelude::{InvalidTransaction, TransactionValidityError}; + use frame_support::traits::ExtrinsicCall; + let encoded = tx.call().encode(); + if RuntimeCall::decode_all_with_depth_limit(200, &mut encoded.as_slice()).is_err() { + log::warn!("failed to decde with depth limit of 200"); + return Err(TransactionValidityError::Invalid(InvalidTransaction::Call)); + } Executive::validate_transaction(source, tx, block_hash) } } From ed91975e5ec29d1613f85df908d60186a45b2d0e Mon Sep 17 00:00:00 2001 From: Sam Johnson Date: Wed, 21 May 2025 18:21:37 -0400 Subject: [PATCH 2/2] bump spec --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 0c1be0e67e..95b032f9e6 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -209,7 +209,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 271, + spec_version: 272, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1,