Skip to content

Commit a1bf521

Browse files
authored
Merge pull request #1668 from opentensor/fix-everything
fix everything
2 parents da2c732 + fdd5d93 commit a1bf521

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

runtime/src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
207207
// `spec_version`, and `authoring_version` are the same between Wasm and native.
208208
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
209209
// the compatible custom types.
210-
spec_version: 264,
210+
spec_version: 265,
211211
impl_version: 1,
212212
apis: RUNTIME_API_VERSIONS,
213213
transaction_version: 1,
@@ -1596,6 +1596,14 @@ impl_runtime_apis! {
15961596
tx: <Block as BlockT>::Extrinsic,
15971597
block_hash: <Block as BlockT>::Hash,
15981598
) -> TransactionValidity {
1599+
use codec::DecodeLimit;
1600+
use frame_support::pallet_prelude::{InvalidTransaction, TransactionValidityError};
1601+
use frame_support::traits::ExtrinsicCall;
1602+
let encoded = tx.call().encode();
1603+
if RuntimeCall::decode_all_with_depth_limit(8, &mut encoded.as_slice()).is_err() {
1604+
log::warn!("failed to decode with depth limit of 8");
1605+
return Err(TransactionValidityError::Invalid(InvalidTransaction::Call));
1606+
}
15991607
Executive::validate_transaction(source, tx, block_hash)
16001608
}
16011609
}

0 commit comments

Comments
 (0)