From bcb3982b5240606882469e3c0493c0379332b157 Mon Sep 17 00:00:00 2001 From: Greg Zaitsev Date: Fri, 27 Feb 2026 17:06:47 -0500 Subject: [PATCH] Use mortal eras for all transactions --- runtime/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index b324934caa..95670892a7 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -164,13 +164,20 @@ impl frame_system::offchain::CreateSignedTransaction ) -> Option { use sp_runtime::traits::StaticLookup; + // Transaction validity period from block hash included in signature + // Has to a power of 2. 256 blocks yields to 3072 s = 51.2 minutes. + let validity_period = 256_u64; + let current_block = frame_system::Pallet::::block_number(); + // Transaction validity era starts at the current block + let era = Era::mortal(validity_period, current_block as u64); + let address = ::Lookup::unlookup(account.clone()); let extra: TransactionExtensions = ( frame_system::CheckNonZeroSender::::new(), frame_system::CheckSpecVersion::::new(), frame_system::CheckTxVersion::::new(), frame_system::CheckGenesis::::new(), - frame_system::CheckEra::::from(Era::Immortal), + frame_system::CheckEra::::from(era), check_nonce::CheckNonce::::from(nonce).into(), frame_system::CheckWeight::::new(), ChargeTransactionPaymentWrapper::new(