From ebddfc7092c3f53d11f10b682b5d3c76e5cad6bf Mon Sep 17 00:00:00 2001 From: Shamil Gadelshin Date: Thu, 22 Jan 2026 14:20:09 +0300 Subject: [PATCH 1/4] Reintroduce pending_create_inherent_data_providers --- node/src/consensus/aura_consensus.rs | 12 ++++++++++++ node/src/consensus/babe_consensus.rs | 17 +++++++++++++++++ node/src/consensus/consensus_mechanism.rs | 5 +++++ node/src/service.rs | 2 +- 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/node/src/consensus/aura_consensus.rs b/node/src/consensus/aura_consensus.rs index 57b5559fd3..16bdae6c01 100644 --- a/node/src/consensus/aura_consensus.rs +++ b/node/src/consensus/aura_consensus.rs @@ -101,6 +101,18 @@ impl ConsensusMechanism for AuraConsensus { fn create_inherent_data_providers( slot_duration: SlotDuration, + ) -> Result> { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + let slot = + sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( + *timestamp, + slot_duration, + ); + Ok((slot, timestamp)) + } + + fn pending_create_inherent_data_providers( + slot_duration: SlotDuration, ) -> Result> { let current = sp_timestamp::InherentDataProvider::from_system_time(); let next_slot = current diff --git a/node/src/consensus/babe_consensus.rs b/node/src/consensus/babe_consensus.rs index 42d3022512..490a505f4d 100644 --- a/node/src/consensus/babe_consensus.rs +++ b/node/src/consensus/babe_consensus.rs @@ -121,6 +121,23 @@ impl ConsensusMechanism for BabeConsensus { Ok((slot, timestamp)) } + fn pending_create_inherent_data_providers( + slot_duration: SlotDuration, + ) -> Result> { + let current = sp_timestamp::InherentDataProvider::from_system_time(); + let next_slot = current + .timestamp() + .as_millis() + .saturating_add(slot_duration.as_millis()); + let timestamp = sp_timestamp::InherentDataProvider::new(next_slot.into()); + let slot = + sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration( + *timestamp, + slot_duration, + ); + Ok((slot, timestamp)) + } + fn new() -> Self { Self { babe_link: None, diff --git a/node/src/consensus/consensus_mechanism.rs b/node/src/consensus/consensus_mechanism.rs index a500f5efe0..b88e2d0462 100644 --- a/node/src/consensus/consensus_mechanism.rs +++ b/node/src/consensus/consensus_mechanism.rs @@ -87,6 +87,11 @@ pub trait ConsensusMechanism { slot_duration: SlotDuration, ) -> Result>; + /// Creates IDPs for the consensus mechanism for pending blocks. + fn pending_create_inherent_data_providers( + slot_duration: SlotDuration, + ) -> Result>; + /// Creates the frontier consensus data provider with this mechanism. fn frontier_consensus_data_provider( client: Arc, diff --git a/node/src/service.rs b/node/src/service.rs index 9e1c241f34..7b2ee0e75f 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -454,7 +454,7 @@ where let slot_duration = consensus_mechanism.slot_duration(&client)?; let pending_create_inherent_data_providers = - move |_, ()| async move { CM::create_inherent_data_providers(slot_duration) }; + move |_, ()| async move { CM::pending_create_inherent_data_providers(slot_duration) }; let rpc_methods = consensus_mechanism.rpc_methods( client.clone(), From ed13ba3673e216757c5e0aba5eb10479756c10c7 Mon Sep 17 00:00:00 2001 From: Shamil Gadelshin Date: Thu, 29 Jan 2026 18:45:16 +0300 Subject: [PATCH 2/4] Bump spec version --- 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 225c2e2706..000c0018b3 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -241,7 +241,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: 371, + spec_version: 372, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From 2ca55d961ab230b28848205bbe928b3c693f84a9 Mon Sep 17 00:00:00 2001 From: Sam Johnson Date: Wed, 11 Feb 2026 21:02:04 -0500 Subject: [PATCH 3/4] bump spec version --- 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 30147a8f1a..7741c44b65 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -243,7 +243,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: 376, + spec_version: 377, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From efef9d668328f6c1dad69dcfef74f4ef326ead60 Mon Sep 17 00:00:00 2001 From: Sam Johnson Date: Thu, 12 Feb 2026 14:43:44 -0500 Subject: [PATCH 4/4] commit Cargo.lock --- runtime/src/lib.rs | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 7741c44b65..919468c1ef 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -20,15 +20,15 @@ extern crate alloc; use codec::{Compact, Decode, Encode}; use ethereum::AuthorizationList; use frame_support::{ + PalletId, dispatch::DispatchResult, genesis_builder_helper::{build_state, get_preset}, pallet_prelude::Get, - traits::{fungible::HoldConsideration, Contains, InsideBoth, LinearStoragePrice}, - PalletId, + traits::{Contains, InsideBoth, LinearStoragePrice, fungible::HoldConsideration}, }; use frame_system::{EnsureRoot, EnsureRootWithSuccess, EnsureSigned}; use pallet_commitments::{CanCommit, OnMetadataCommitment}; -use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; +use pallet_grandpa::{AuthorityId as GrandpaId, fg_primitives}; use pallet_registry::CanRegisterIdentity; pub use pallet_shield; use pallet_subtensor::rpc_info::{ @@ -50,13 +50,13 @@ use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_consensus_babe::BabeConfiguration; use sp_consensus_babe::BabeEpochConfiguration; use sp_core::{ + H160, H256, OpaqueMetadata, U256, crypto::{ByteArray, KeyTypeId}, - OpaqueMetadata, H160, H256, U256, }; -use sp_runtime::generic::Era; use sp_runtime::Cow; +use sp_runtime::generic::Era; use sp_runtime::{ - generic, impl_opaque_keys, + AccountId32, ApplyExtrinsicResult, ConsensusEngineId, Percent, generic, impl_opaque_keys, traits::{ AccountIdLookup, BlakeTwo256, Block as BlockT, DispatchInfoOf, Dispatchable, One, PostDispatchInfoOf, UniqueSaturatedInto, Verify, @@ -64,7 +64,6 @@ use sp_runtime::{ transaction_validity::{ TransactionPriority, TransactionSource, TransactionValidity, TransactionValidityError, }, - AccountId32, ApplyExtrinsicResult, ConsensusEngineId, Percent, }; use sp_std::cmp::Ordering; use sp_std::prelude::*; @@ -72,24 +71,23 @@ use sp_std::prelude::*; use sp_version::NativeVersion; use sp_version::RuntimeVersion; use subtensor_precompiles::Precompiles; -use subtensor_runtime_common::{time::*, AlphaCurrency, TaoCurrency, *}; +use subtensor_runtime_common::{AlphaCurrency, TaoCurrency, time::*, *}; use subtensor_swap_interface::{Order, SwapHandler}; // A few exports that help ease life for downstream crates. pub use frame_support::{ - construct_runtime, parameter_types, + StorageValue, construct_runtime, parameter_types, traits::{ - ConstBool, ConstU128, ConstU32, ConstU64, ConstU8, FindAuthor, InstanceFilter, + ConstBool, ConstU8, ConstU32, ConstU64, ConstU128, FindAuthor, InstanceFilter, KeyOwnerProofSystem, OnFinalize, OnTimestampSet, PrivilegeCmp, Randomness, StorageInfo, }, weights::{ + IdentityFee, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, + WeightToFeePolynomial, constants::{ BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND, }, - IdentityFee, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, - WeightToFeePolynomial, }, - StorageValue, }; pub use frame_system::Call as SystemCall; pub use pallet_balances::Call as BalancesCall;