From 0691d396eb81eba23215a9b9384fb795dfe05757 Mon Sep 17 00:00:00 2001 From: open-junius Date: Fri, 2 Jan 2026 10:11:52 +0800 Subject: [PATCH 1/2] fix add query with pending block --- client/rpc/src/eth/pending.rs | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/client/rpc/src/eth/pending.rs b/client/rpc/src/eth/pending.rs index 9384b094d7..0bf40eaec3 100644 --- a/client/rpc/src/eth/pending.rs +++ b/client/rpc/src/eth/pending.rs @@ -18,22 +18,16 @@ // Substrate use sc_client_api::backend::{Backend, StorageProvider}; -use sc_transaction_pool_api::{InPoolTransaction, TransactionPool}; -use sp_api::{ApiExt, ApiRef, Core, ProvideRuntimeApi}; +use sc_transaction_pool_api::TransactionPool; +use sp_api::{ApiRef, ProvideRuntimeApi}; use sp_block_builder::BlockBuilder as BlockBuilderApi; use sp_blockchain::{ApplyExtrinsicFailed, HeaderBackend}; -use sp_inherents::{CreateInherentDataProviders, InherentData, InherentDataProvider}; -use sp_runtime::{ - generic::Digest, - traits::{Block as BlockT, Header as HeaderT, One}, - TransactionOutcome, -}; +use sp_inherents::{CreateInherentDataProviders, InherentData}; +use sp_runtime::{generic::Digest, traits::Block as BlockT}; use crate::eth::Eth; use fp_rpc::EthereumRuntimeRPCApi; -const LOG_TARGET: &str = "eth-pending"; - /// The generated error type for creating pending runtime api. #[derive(Debug, thiserror::Error)] pub(crate) enum Error { @@ -65,7 +59,11 @@ where let api = self.client.runtime_api(); let info = self.client.info(); - let (best_number, best_hash) = (info.best_number, info.best_hash); + + /* It is a workaround to avoid using the pending block. + In subtensor, Aura pallet can not initialize with the same slot number + since the AllowMultipleBlocksPerSlot set as false in the runtime.. + https://github.com/opentensor/subtensor/issues/2303 let inherent_data_provider = self .pending_create_inherent_data_providers @@ -135,9 +133,9 @@ where )), Err(err) => TransactionOutcome::Rollback(Err(Error::from(err))), }); - } + }*/ - Ok((best_hash, api)) + Ok((info.best_hash, api)) } } From 54503dc87129f77a6554a7c65f8cfc08ea983910 Mon Sep 17 00:00:00 2001 From: open-junius Date: Fri, 2 Jan 2026 10:13:37 +0800 Subject: [PATCH 2/2] avoid unnecessary code change --- client/rpc/src/eth/pending.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/client/rpc/src/eth/pending.rs b/client/rpc/src/eth/pending.rs index 0bf40eaec3..23b25e4a90 100644 --- a/client/rpc/src/eth/pending.rs +++ b/client/rpc/src/eth/pending.rs @@ -65,6 +65,7 @@ where since the AllowMultipleBlocksPerSlot set as false in the runtime.. https://github.com/opentensor/subtensor/issues/2303 + let (best_number, best_hash) = (info.best_number, info.best_hash); let inherent_data_provider = self .pending_create_inherent_data_providers .create_inherent_data_providers(best_hash, ())