Skip to content

Commit

Permalink
Remove v2 RPC that is being added by Substrate internally
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Sep 30, 2024
1 parent 5e31d2a commit f1b0d28
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 31 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion crates/subspace-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ sc-offchain = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818
sc-proof-of-time = { version = "0.1.0", path = "../sc-proof-of-time" }
sc-rpc = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42" }
sc-rpc-api = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42" }
sc-rpc-spec-v2 = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42" }
sc-service = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false }
sc-sysinfo = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false }
sc-subspace-block-relay = { version = "0.1.0", path = "../sc-subspace-block-relay" }
Expand Down
2 changes: 0 additions & 2 deletions crates/subspace-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1295,14 +1295,12 @@ where
let reward_signing_notification_stream = reward_signing_notification_stream.clone();
let archived_segment_notification_stream = archived_segment_notification_stream.clone();
let transaction_pool = transaction_pool.clone();
let chain_spec = config.base.chain_spec.cloned_box();
let backend = backend.clone();

Box::new(move |subscription_executor| {
let deps = rpc::FullDeps {
client: client.clone(),
pool: transaction_pool.clone(),
chain_spec: chain_spec.cloned_box(),
subscription_executor,
new_slot_notification_stream: new_slot_notification_stream.clone(),
reward_signing_notification_stream: reward_signing_notification_stream.clone(),
Expand Down
9 changes: 0 additions & 9 deletions crates/subspace-service/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ use sc_consensus_subspace::slot_worker::{
};
use sc_consensus_subspace_rpc::{SubspaceRpc, SubspaceRpcApiServer, SubspaceRpcConfig};
use sc_rpc::SubscriptionTaskExecutor;
use sc_rpc_spec_v2::chain_spec::{ChainSpec, ChainSpecApiServer};
use sc_transaction_pool_api::TransactionPool;
use sp_api::ProvideRuntimeApi;
use sp_block_builder::BlockBuilder;
Expand All @@ -59,8 +58,6 @@ where
pub client: Arc<C>,
/// Transaction pool instance.
pub pool: Arc<P>,
/// A copy of the chain spec.
pub chain_spec: Box<dyn sc_chain_spec::ChainSpec>,
/// Executor to drive the subscription manager in the Grandpa RPC handler.
pub subscription_executor: SubscriptionTaskExecutor,
/// A stream with notifications about new slot arrival with ability to send solution back.
Expand Down Expand Up @@ -113,7 +110,6 @@ where
let FullDeps {
client,
pool,
chain_spec,
subscription_executor,
new_slot_notification_stream,
reward_signing_notification_stream,
Expand All @@ -126,11 +122,6 @@ where
backend,
} = deps;

let chain_name = chain_spec.name().to_string();
let genesis_hash = client.info().genesis_hash;
let properties = chain_spec.properties();
module.merge(ChainSpec::new(chain_name, genesis_hash, properties).into_rpc())?;

module.merge(System::new(client.clone(), pool).into_rpc())?;
module.merge(TransactionPayment::new(client.clone()).into_rpc())?;

Expand Down
1 change: 0 additions & 1 deletion domains/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ sc-network-sync = { git = "https://github.com/subspace/polkadot-sdk", rev = "587
sc-network-transactions = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42" }
sc-rpc = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42" }
sc-rpc-server = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42" }
sc-rpc-spec-v2 = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42" }
sc-service = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false }
sc-telemetry = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42" }
sc-transaction-pool = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42" }
Expand Down
1 change: 0 additions & 1 deletion domains/service/src/domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ where
client: client.clone(),
pool: transaction_pool.clone(),
graph: transaction_pool.pool().clone(),
chain_spec: domain_config.chain_spec.cloned_box(),
network: network_service.clone(),
sync: sync_service.clone(),
is_authority,
Expand Down
16 changes: 1 addition & 15 deletions domains/service/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiSe
use sc_client_api::{AuxStore, BlockBackend};
use sc_network::NetworkService;
use sc_network_sync::SyncingService;
use sc_rpc_spec_v2::chain_spec::{ChainSpec, ChainSpecApiServer};
use sc_service::{DatabaseSource, SpawnTaskHandle};
use sc_transaction_pool::{ChainApi, Pool};
use sc_transaction_pool_api::TransactionPool;
Expand All @@ -37,8 +36,6 @@ pub struct FullDeps<Block: BlockT, Client, TP, CA: ChainApi, BE, CIDP> {
pub pool: Arc<TP>,
/// Graph pool instance.
pub graph: Arc<Pool<CA>>,
/// A copy of the chain spec.
pub chain_spec: Box<dyn sc_chain_spec::ChainSpec>,
/// Network service
pub network: Arc<NetworkService<Block, Block::Hash>>,
/// Chain syncing service
Expand All @@ -64,7 +61,6 @@ impl<Block: BlockT, Client, TP, CA: ChainApi, BE, CIDP: Clone> Clone
backend: self.backend.clone(),
pool: self.pool.clone(),
graph: self.graph.clone(),
chain_spec: self.chain_spec.cloned_box(),
network: self.network.clone(),
sync: self.sync.clone(),
is_authority: self.is_authority,
Expand Down Expand Up @@ -98,17 +94,7 @@ where
AccountId: DeserializeOwned + Encode + Debug + Decode + Display + Clone + Sync + Send + 'static,
{
let mut module = RpcModule::new(());
let FullDeps {
client,
pool,
chain_spec,
..
} = deps;

let chain_name = chain_spec.name().to_string();
let genesis_hash = client.info().genesis_hash;
let properties = chain_spec.properties();
module.merge(ChainSpec::new(chain_name, genesis_hash, properties).into_rpc())?;
let FullDeps { client, pool, .. } = deps;

module.merge(System::new(client.clone(), pool).into_rpc())?;
module.merge(TransactionPayment::new(client).into_rpc())?;
Expand Down

0 comments on commit f1b0d28

Please sign in to comment.