Skip to content

Commit

Permalink
fix: txpool content rpc not hiding
Browse files Browse the repository at this point in the history
  • Loading branch information
clostao committed Nov 15, 2023
1 parent 3a52826 commit a864efb
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 38 deletions.
51 changes: 19 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/parityt
sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sc-proposer-metrics = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43"}
sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sc-finality-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sc-utils = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sc-utils = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
# Substrate Primitive
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false }
sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false }
Expand Down
7 changes: 6 additions & 1 deletion node/src/rpc/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub use fc_rpc::{EthBlockDataCacheTask, EthConfig, OverrideHandle, StorageOverri
pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool};
pub use fc_storage::overrides_handle;
use fp_rpc::{ConvertTransaction, ConvertTransactionRuntimeApi, EthereumRuntimeRPCApi};
use crate::eth::{EthApi, EthConfiguration};

use super::TracingConfig;

Expand Down Expand Up @@ -100,6 +101,7 @@ pub fn create_eth<C, BE, P, A, CT, B, EC: EthConfig<B, C>>(
fc_mapping_sync::EthereumBlockNotification<B>,
>,
>,
eth_config: &EthConfiguration,
optional_tracing_config: Option<TracingConfig>,
) -> Result<RpcModule<()>, Box<dyn std::error::Error + Send + Sync>>
where
Expand Down Expand Up @@ -215,7 +217,10 @@ where
io.merge(Trace::new(client.clone(), trace_requester, 20).into_rpc())?;
}
}
io.merge(tx_pool.into_rpc())?;

if eth_config.ethapi.contains(&EthApi::Txpool) {
io.merge(tx_pool.into_rpc())?;
}

Ok(io)
}
5 changes: 4 additions & 1 deletion node/src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ mod tracing;
pub use self::tracing::*;

mod eth;
pub use self::eth::{create_eth, overrides_handle, EthDeps};
pub use self::eth::{create_eth, overrides_handle, EthDeps, };
use crate::service::EthConfiguration;

/// Full client dependencies.
pub struct FullDeps<C, P, A: ChainApi, CT> {
Expand Down Expand Up @@ -59,6 +60,7 @@ pub struct TracingConfig {

/// Instantiate all Full RPC extensions.
pub fn create_full<C, P, BE, A, CT>(
eth_config: &EthConfiguration,
deps: FullDeps<C, P, A, CT>,
subscription_task_executor: SubscriptionTaskExecutor,
pubsub_notification_sinks: Arc<
Expand Down Expand Up @@ -119,6 +121,7 @@ where
eth,
subscription_task_executor,
pubsub_notification_sinks,
eth_config,
optional_tracing_config,
)?;

Expand Down
1 change: 1 addition & 0 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ where
};

crate::rpc::create_full(
&eth_config.clone(),
deps,
subscription_task_executor,
pubsub_notification_sinks.clone(),
Expand Down
2 changes: 1 addition & 1 deletion vendor/client/rpc/debug/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ where
raw_max_memory_usage: usize,
) -> (impl Future<Output = ()>, DebugRequester) {
let (tx, mut rx): (DebugRequester, _) =
sc_utils::mpsc::tracing_unbounded("debug-requester");
sc_utils::mpsc::tracing_unbounded("debug-requester", 1000);

let fut = async move {
loop {
Expand Down
2 changes: 1 addition & 1 deletion vendor/client/rpc/trace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ where
) -> (impl Future<Output = ()>, CacheRequester) {
// Communication with the outside world :
let (requester_tx, mut requester_rx) =
sc_utils::mpsc::tracing_unbounded("trace-filter-cache");
sc_utils::mpsc::tracing_unbounded("trace-filter-cache", 1000);

// Task running in the service.
let task = async move {
Expand Down

0 comments on commit a864efb

Please sign in to comment.