difftreelog
fix make node build on 0.9.42
in: master
6 files changed
client/rpc/src/pov_estimate.rsdiffbeforeafterboth--- a/client/rpc/src/pov_estimate.rs
+++ b/client/rpc/src/pov_estimate.rs
@@ -213,12 +213,7 @@
let pre_root = *backend.root();
- let executor = NativeElseWasmExecutor::<D>::new(
- exec_params.wasm_method,
- exec_params.default_heap_pages,
- exec_params.max_runtime_instances,
- exec_params.runtime_cache_size,
- );
+ let executor = sc_service::new_native_or_wasm_executor(exec_params);
let execution = ExecutionStrategy::NativeElseWasm;
let mut results = Vec::new();
node/cli/Cargo.tomldiffbeforeafterboth--- a/node/cli/Cargo.toml
+++ b/node/cli/Cargo.toml
@@ -100,30 +100,8 @@
[features]
default = ["opal-runtime"]
-all-runtimes = [
- 'opal-runtime',
- 'quartz-runtime',
- 'unique-runtime',
-]
-pov-estimate = [
- 'opal-runtime/pov-estimate',
- 'quartz-runtime?/pov-estimate',
- 'uc-rpc/pov-estimate',
- 'unique-rpc/pov-estimate',
- 'unique-runtime?/pov-estimate',
-]
-runtime-benchmarks = [
- 'opal-runtime/runtime-benchmarks',
- 'polkadot-cli/runtime-benchmarks',
- 'polkadot-service/runtime-benchmarks',
- 'quartz-runtime?/runtime-benchmarks',
- 'sc-service/runtime-benchmarks',
- 'unique-runtime?/runtime-benchmarks',
-]
+all-runtimes = ['opal-runtime', 'quartz-runtime', 'unique-runtime']
+pov-estimate = ['opal-runtime/pov-estimate', 'quartz-runtime?/pov-estimate', 'uc-rpc/pov-estimate', 'unique-rpc/pov-estimate', 'unique-runtime?/pov-estimate']
+runtime-benchmarks = ['opal-runtime/runtime-benchmarks', 'polkadot-cli/runtime-benchmarks', 'polkadot-service/runtime-benchmarks', 'quartz-runtime?/runtime-benchmarks', 'sc-service/runtime-benchmarks', 'unique-runtime?/runtime-benchmarks']
sapphire-runtime = ['quartz-runtime', 'quartz-runtime/become-sapphire']
-try-runtime = [
- 'opal-runtime?/try-runtime',
- 'quartz-runtime?/try-runtime',
- 'try-runtime-cli/try-runtime',
- 'unique-runtime?/try-runtime',
-]
+try-runtime = ['opal-runtime?/try-runtime', 'quartz-runtime?/try-runtime', 'try-runtime-cli/try-runtime', 'unique-runtime?/try-runtime']
node/cli/src/command.rsdiffbeforeafterboth--- a/node/cli/src/command.rs
+++ b/node/cli/src/command.rs
@@ -505,7 +505,10 @@
let para_id = ParaId::from(para_id);
- let parachain_account = AccountIdConversion::<polkadot_primitives::v2::AccountId>::into_account_truncating(¶_id);
+ let parachain_account =
+ AccountIdConversion::<polkadot_primitives::AccountId>::into_account_truncating(
+ ¶_id,
+ );
let state_version =
RelayChainCli::native_runtime_version(&config.chain_spec).state_version();
node/cli/src/service.rsdiffbeforeafterboth--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -26,6 +26,7 @@
stream::select,
task::{Context, Poll},
};
+use sp_keystore::KeystorePtr;
use tokio::time::Interval;
use unique_rpc::overrides_handle;
@@ -55,7 +56,6 @@
use sc_network_sync::SyncingService;
use sc_service::{BasePath, Configuration, PartialComponents, TaskManager};
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
-use sp_keystore::SyncCryptoStorePtr;
use sp_runtime::traits::BlakeTwo256;
use substrate_prometheus_endpoint::Registry;
use sc_client_api::BlockchainEvents;
@@ -270,12 +270,7 @@
})
.transpose()?;
- let executor = NativeElseWasmExecutor::<ExecutorDispatch>::new(
- config.wasm_method,
- config.default_heap_pages,
- config.max_runtime_instances,
- config.runtime_cache_size,
- );
+ let executor = sc_service::new_native_or_wasm_executor(config);
let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, _>(
@@ -366,6 +361,14 @@
}
}
+macro_rules! clone {
+ ($($i:ident),* $(,)?) => {
+ $(
+ let $i = $i.clone();
+ )*
+ };
+}
+
/// Start a node with the given parachain `Configuration` and relay chain `Configuration`.
///
/// This is the actual implementation that is abstract over the executor and the runtime api.
@@ -422,7 +425,7 @@
Arc<dyn RelayChainInterface>,
Arc<sc_transaction_pool::FullPool<Block, FullClient<RuntimeApi, ExecutorDispatch>>>,
Arc<SyncingService<Block>>,
- SyncCryptoStorePtr,
+ KeystorePtr,
bool,
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
{
@@ -469,13 +472,7 @@
warp_sync_params: None,
})?;
- let rpc_client = client.clone();
- let rpc_pool = transaction_pool.clone();
let select_chain = params.select_chain.clone();
- let rpc_network = network.clone();
- let rpc_sync_service = sync_service.clone();
-
- let rpc_frontier_backend = frontier_backend.clone();
let block_data_cache = Arc::new(fc_rpc::EthBlockDataCacheTask::new(
task_manager.spawn_handle(),
@@ -485,9 +482,14 @@
prometheus_registry.clone(),
));
+ let pubsub_notification_sinks: fc_mapping_sync::EthereumBlockNotificationSinks<
+ fc_mapping_sync::EthereumBlockNotification<Block>,
+ > = Default::default();
+ let pubsub_notification_sinks = Arc::new(pubsub_notification_sinks);
+
task_manager.spawn_essential_handle().spawn(
"frontier-mapping-sync-worker",
- None,
+ Some("frontier"),
MappingSyncWorker::new(
client.import_notification_stream(),
Duration::new(6, 0),
@@ -498,55 +500,83 @@
3,
0,
SyncStrategy::Normal,
+ sync_service.clone(),
+ pubsub_notification_sinks.clone(),
)
.for_each(|()| futures::future::ready(())),
);
- #[cfg(feature = "pov-estimate")]
- let rpc_backend = backend.clone();
+ let runtime_id = parachain_config.chain_spec.runtime_id();
+
+ let rpc_builder = Box::new({
+ clone!(
+ client,
+ backend,
+ pubsub_notification_sinks,
+ transaction_pool,
+ network,
+ sync_service,
+ frontier_backend,
+ );
+ move |deny_unsafe, subscription_task_executor| {
+ clone!(
+ backend,
+ runtime_id,
+ client,
+ transaction_pool,
+ filter_pool,
+ network,
+ select_chain,
+ block_data_cache,
+ fee_history_cache,
+ pubsub_notification_sinks,
+ frontier_backend,
+ );
- let runtime_id = parachain_config.chain_spec.runtime_id();
+ #[cfg(not(feature = "pov-estimate"))]
+ let _ = backend;
- let rpc_builder = Box::new(move |deny_unsafe, subscription_task_executor| {
- let full_deps = unique_rpc::FullDeps {
- runtime_id: runtime_id.clone(),
+ let full_deps = unique_rpc::FullDeps {
+ runtime_id,
- #[cfg(feature = "pov-estimate")]
- exec_params: uc_rpc::pov_estimate::ExecutorParams {
- wasm_method: parachain_config.wasm_method,
- default_heap_pages: parachain_config.default_heap_pages,
- max_runtime_instances: parachain_config.max_runtime_instances,
- runtime_cache_size: parachain_config.runtime_cache_size,
- },
+ #[cfg(feature = "pov-estimate")]
+ exec_params: uc_rpc::pov_estimate::ExecutorParams {
+ wasm_method: parachain_config.wasm_method,
+ default_heap_pages: parachain_config.default_heap_pages,
+ max_runtime_instances: parachain_config.max_runtime_instances,
+ runtime_cache_size: parachain_config.runtime_cache_size,
+ },
- #[cfg(feature = "pov-estimate")]
- backend: rpc_backend.clone(),
+ #[cfg(feature = "pov-estimate")]
+ backend,
- eth_backend: rpc_frontier_backend.clone(),
- deny_unsafe,
- client: rpc_client.clone(),
- pool: rpc_pool.clone(),
- graph: rpc_pool.pool().clone(),
- // TODO: Unhardcode
- enable_dev_signer: false,
- filter_pool: filter_pool.clone(),
- network: rpc_network.clone(),
- sync: rpc_sync_service.clone(),
- select_chain: select_chain.clone(),
- is_authority: validator,
- // TODO: Unhardcode
- max_past_logs: 10000,
- block_data_cache: block_data_cache.clone(),
- fee_history_cache: fee_history_cache.clone(),
- // TODO: Unhardcode
- fee_history_limit: 2048,
- };
+ eth_backend: frontier_backend,
+ deny_unsafe,
+ client,
+ graph: transaction_pool.pool().clone(),
+ pool: transaction_pool,
+ // TODO: Unhardcode
+ enable_dev_signer: false,
+ filter_pool,
+ network,
+ sync: sync_service.clone(),
+ select_chain,
+ is_authority: validator,
+ // TODO: Unhardcode
+ max_past_logs: 10000,
+ block_data_cache,
+ fee_history_cache,
+ // TODO: Unhardcode
+ fee_history_limit: 2048,
+ pubsub_notification_sinks,
+ };
- unique_rpc::create_full::<_, _, _, _, Runtime, RuntimeApi, _>(
- full_deps,
- subscription_task_executor,
- )
- .map_err(Into::into)
+ unique_rpc::create_full::<_, _, _, _, Runtime, RuntimeApi, _>(
+ full_deps,
+ subscription_task_executor,
+ )
+ .map_err(Into::into)
+ }
});
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
@@ -555,7 +585,7 @@
transaction_pool: transaction_pool.clone(),
task_manager: &mut task_manager,
config: parachain_config,
- keystore: params.keystore_container.sync_keystore(),
+ keystore: params.keystore_container.keystore(),
backend: backend.clone(),
network: network.clone(),
sync_service: sync_service.clone(),
@@ -600,7 +630,7 @@
relay_chain_interface.clone(),
transaction_pool,
sync_service.clone(),
- params.keystore_container.sync_keystore(),
+ params.keystore_container.keystore(),
force_authoring,
)?;
@@ -619,6 +649,7 @@
relay_chain_interface,
relay_chain_slot_duration,
recovery_handle: Box::new(overseer_handle),
+ sync_service,
};
start_collator(params).await?;
@@ -632,6 +663,7 @@
relay_chain_interface,
relay_chain_slot_duration,
recovery_handle: Box::new(overseer_handle),
+ sync_service,
};
start_full_node(params)?;
@@ -897,6 +929,11 @@
prometheus_registry.clone(),
));
+ let pubsub_notification_sinks: fc_mapping_sync::EthereumBlockNotificationSinks<
+ fc_mapping_sync::EthereumBlockNotification<Block>,
+ > = Default::default();
+ let pubsub_notification_sinks = Arc::new(pubsub_notification_sinks);
+
let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
@@ -1026,67 +1063,88 @@
3,
0,
SyncStrategy::Normal,
+ sync_service.clone(),
+ pubsub_notification_sinks.clone(),
)
.for_each(|()| futures::future::ready(())),
);
-
- let rpc_client = client.clone();
- let rpc_pool = transaction_pool.clone();
- let rpc_network = network.clone();
- let rpc_sync_service = sync_service.clone();
- let rpc_frontier_backend = frontier_backend.clone();
#[cfg(feature = "pov-estimate")]
let rpc_backend = backend.clone();
let runtime_id = config.chain_spec.runtime_id();
- let rpc_builder = Box::new(move |deny_unsafe, subscription_executor| {
- let full_deps = unique_rpc::FullDeps {
- runtime_id: runtime_id.clone(),
+ let rpc_builder = Box::new({
+ clone!(
+ backend,
+ client,
+ sync_service,
+ frontier_backend,
+ network,
+ transaction_pool,
+ pubsub_notification_sinks
+ );
+ move |deny_unsafe, subscription_executor| {
+ clone!(
+ backend,
+ block_data_cache,
+ client,
+ fee_history_cache,
+ filter_pool,
+ network,
+ pubsub_notification_sinks,
+ );
+
+ #[cfg(not(feature = "pov-estimate"))]
+ let _ = backend;
+
+ let full_deps = unique_rpc::FullDeps {
+ runtime_id: runtime_id.clone(),
- #[cfg(feature = "pov-estimate")]
- exec_params: uc_rpc::pov_estimate::ExecutorParams {
- wasm_method: config.wasm_method,
- default_heap_pages: config.default_heap_pages,
- max_runtime_instances: config.max_runtime_instances,
- runtime_cache_size: config.runtime_cache_size,
- },
+ #[cfg(feature = "pov-estimate")]
+ exec_params: uc_rpc::pov_estimate::ExecutorParams {
+ wasm_method: config.wasm_method,
+ default_heap_pages: config.default_heap_pages,
+ max_runtime_instances: config.max_runtime_instances,
+ runtime_cache_size: config.runtime_cache_size,
+ },
- #[cfg(feature = "pov-estimate")]
- backend: rpc_backend.clone(),
- eth_backend: rpc_frontier_backend.clone(),
- deny_unsafe,
- client: rpc_client.clone(),
- pool: rpc_pool.clone(),
- graph: rpc_pool.pool().clone(),
- // TODO: Unhardcode
- enable_dev_signer: false,
- filter_pool: filter_pool.clone(),
- network: rpc_network.clone(),
- sync: rpc_sync_service.clone(),
- select_chain: select_chain.clone(),
- is_authority: collator,
- // TODO: Unhardcode
- max_past_logs: 10000,
- block_data_cache: block_data_cache.clone(),
- fee_history_cache: fee_history_cache.clone(),
- // TODO: Unhardcode
- fee_history_limit: 2048,
- };
+ #[cfg(feature = "pov-estimate")]
+ backend,
+ eth_backend: frontier_backend.clone(),
+ deny_unsafe,
+ client,
+ pool: transaction_pool.clone(),
+ graph: transaction_pool.pool().clone(),
+ // TODO: Unhardcode
+ enable_dev_signer: false,
+ filter_pool,
+ network,
+ sync: sync_service.clone(),
+ select_chain: select_chain.clone(),
+ is_authority: collator,
+ // TODO: Unhardcode
+ max_past_logs: 10000,
+ block_data_cache,
+ fee_history_cache,
+ // TODO: Unhardcode
+ fee_history_limit: 2048,
+ pubsub_notification_sinks,
+ };
- unique_rpc::create_full::<_, _, _, _, Runtime, RuntimeApi, _>(
- full_deps,
- subscription_executor,
- )
- .map_err(Into::into)
+ unique_rpc::create_full::<_, _, _, _, Runtime, RuntimeApi, _>(
+ full_deps,
+ subscription_executor,
+ )
+ .map_err(Into::into)
+ }
});
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
network,
sync_service,
client,
- keystore: keystore_container.sync_keystore(),
+ keystore: keystore_container.keystore(),
task_manager: &mut task_manager,
transaction_pool,
rpc_builder,
node/rpc/Cargo.tomldiffbeforeafterboth--- a/node/rpc/Cargo.toml
+++ b/node/rpc/Cargo.toml
@@ -30,6 +30,7 @@
fc-db = { workspace = true }
fc-rpc = { workspace = true }
fc-rpc-core = { workspace = true }
+fc-mapping-sync = { workspace = true }
fp-rpc = { workspace = true }
fp-storage = { workspace = true }
node/rpc/src/lib.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use sp_runtime::traits::BlakeTwo256;18use fc_rpc::{19 EthBlockDataCacheTask, OverrideHandle, RuntimeApiStorageOverride, SchemaV1Override,20 StorageOverride, SchemaV2Override, SchemaV3Override,21};22use jsonrpsee::RpcModule;23use fc_rpc_core::types::{FilterPool, FeeHistoryCache};24use fp_storage::EthereumStorageSchema;25use sc_client_api::{26 backend::{AuxStore, StorageProvider},27 client::BlockchainEvents,28 StateBackend, Backend,29};30use sc_consensus_grandpa::{31 FinalityProofProvider, GrandpaJustificationStream, SharedAuthoritySet, SharedVoterState,32};33use sc_network::NetworkService;34use sc_network_sync::SyncingService;35use sc_rpc::SubscriptionTaskExecutor;36pub use sc_rpc_api::DenyUnsafe;37use sc_transaction_pool::{ChainApi, Pool};38use sp_api::ProvideRuntimeApi;39use sp_block_builder::BlockBuilder;40use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};41use sc_service::TransactionPool;42use std::{collections::BTreeMap, sync::Arc};4344use up_common::types::opaque::*;4546#[cfg(feature = "pov-estimate")]47type FullBackend = sc_service::TFullBackend<Block>;4849/// Extra dependencies for GRANDPA50pub struct GrandpaDeps<B> {51 /// Voting round info.52 pub shared_voter_state: SharedVoterState,53 /// Authority set info.54 pub shared_authority_set: SharedAuthoritySet<Hash, BlockNumber>,55 /// Receives notifications about justification events from Grandpa.56 pub justification_stream: GrandpaJustificationStream<Block>,57 /// Executor to drive the subscription manager in the Grandpa RPC handler.58 pub subscription_executor: SubscriptionTaskExecutor,59 /// Finality proof provider.60 pub finality_provider: Arc<FinalityProofProvider<B, Block>>,61}6263/// Full client dependencies.64pub struct FullDeps<C, P, SC, CA: ChainApi> {65 /// The client instance to use.66 pub client: Arc<C>,67 /// Transaction pool instance.68 pub pool: Arc<P>,69 /// Graph pool instance.70 pub graph: Arc<Pool<CA>>,71 /// The SelectChain Strategy72 pub select_chain: SC,73 /// The Node authority flag74 pub is_authority: bool,75 /// Whether to enable dev signer76 pub enable_dev_signer: bool,77 /// Network service78 pub network: Arc<NetworkService<Block, Hash>>,79 /// Syncing service80 pub sync: Arc<SyncingService<Block>>,81 /// Whether to deny unsafe calls82 pub deny_unsafe: DenyUnsafe,83 /// EthFilterApi pool.84 pub filter_pool: Option<FilterPool>,8586 /// Runtime identification (read from the chain spec)87 pub runtime_id: RuntimeId,88 /// Executor params for PoV estimating89 #[cfg(feature = "pov-estimate")]90 pub exec_params: uc_rpc::pov_estimate::ExecutorParams,91 /// Substrate Backend.92 #[cfg(feature = "pov-estimate")]93 pub backend: Arc<FullBackend>,9495 /// Ethereum Backend.96 pub eth_backend: Arc<fc_db::Backend<Block>>,97 /// Maximum number of logs in a query.98 pub max_past_logs: u32,99 /// Maximum fee history cache size.100 pub fee_history_limit: u64,101 /// Fee history cache.102 pub fee_history_cache: FeeHistoryCache,103 /// Cache for Ethereum block data.104 pub block_data_cache: Arc<EthBlockDataCacheTask<Block>>,105}106107pub fn overrides_handle<C, BE, R>(client: Arc<C>) -> Arc<OverrideHandle<Block>>108where109 C: ProvideRuntimeApi<Block> + StorageProvider<Block, BE> + AuxStore,110 C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError>,111 C: Send + Sync + 'static,112 C::Api: fp_rpc::EthereumRuntimeRPCApi<Block>,113 C::Api: up_rpc::UniqueApi<Block, <R as RuntimeInstance>::CrossAccountId, AccountId>,114 BE: Backend<Block> + 'static,115 BE::State: StateBackend<BlakeTwo256>,116 R: RuntimeInstance + Send + Sync + 'static,117{118 let mut overrides_map = BTreeMap::new();119 overrides_map.insert(120 EthereumStorageSchema::V1,121 Box::new(SchemaV1Override::new(client.clone())) as Box<dyn StorageOverride<_> + 'static>,122 );123 overrides_map.insert(124 EthereumStorageSchema::V2,125 Box::new(SchemaV2Override::new(client.clone())) as Box<dyn StorageOverride<_> + 'static>,126 );127 overrides_map.insert(128 EthereumStorageSchema::V3,129 Box::new(SchemaV3Override::new(client.clone())) as Box<dyn StorageOverride<_> + 'static>,130 );131132 Arc::new(OverrideHandle {133 schemas: overrides_map,134 fallback: Box::new(RuntimeApiStorageOverride::new(client)),135 })136}137138/// Instantiate all Full RPC extensions.139pub fn create_full<C, P, SC, CA, R, A, B>(140 deps: FullDeps<C, P, SC, CA>,141 subscription_task_executor: SubscriptionTaskExecutor,142) -> Result<RpcModule<()>, Box<dyn std::error::Error + Send + Sync>>143where144 C: ProvideRuntimeApi<Block> + StorageProvider<Block, B> + AuxStore,145 C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError> + 'static,146 C: Send + Sync + 'static,147 C: BlockchainEvents<Block>,148 C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,149 C::Api: BlockBuilder<Block>,150 // C::Api: pallet_contracts_rpc::ContractsRuntimeApi<Block, AccountId, Balance, BlockNumber, Hash>,151 C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,152 C::Api: fp_rpc::EthereumRuntimeRPCApi<Block>,153 C::Api: fp_rpc::ConvertTransactionRuntimeApi<Block>,154 C::Api: up_rpc::UniqueApi<Block, <R as RuntimeInstance>::CrossAccountId, AccountId>,155 C::Api: app_promotion_rpc::AppPromotionApi<156 Block,157 BlockNumber,158 <R as RuntimeInstance>::CrossAccountId,159 AccountId,160 >,161 C::Api: up_pov_estimate_rpc::PovEstimateApi<Block>,162 B: sc_client_api::Backend<Block> + Send + Sync + 'static,163 B::State: sc_client_api::backend::StateBackend<sp_runtime::traits::HashFor<Block>>,164 P: TransactionPool<Block = Block> + 'static,165 CA: ChainApi<Block = Block> + 'static,166 R: RuntimeInstance + Send + Sync + 'static,167 <R as RuntimeInstance>::CrossAccountId: serde::Serialize,168 C: sp_api::CallApiAt<169 sp_runtime::generic::Block<170 sp_runtime::generic::Header<u32, BlakeTwo256>,171 sp_runtime::OpaqueExtrinsic,172 >,173 >,174 for<'de> <R as RuntimeInstance>::CrossAccountId: serde::Deserialize<'de>,175{176 use fc_rpc::{177 Eth, EthApiServer, EthDevSigner, EthFilter, EthFilterApiServer, EthPubSub,178 EthPubSubApiServer, EthSigner, Net, NetApiServer, Web3, Web3ApiServer,179 };180 use uc_rpc::{UniqueApiServer, Unique};181182 use uc_rpc::{AppPromotionApiServer, AppPromotion};183184 #[cfg(feature = "pov-estimate")]185 use uc_rpc::pov_estimate::{PovEstimateApiServer, PovEstimate};186187 // use pallet_contracts_rpc::{Contracts, ContractsApi};188 use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};189 use substrate_frame_rpc_system::{System, SystemApiServer};190191 let mut io = RpcModule::new(());192 let FullDeps {193 client,194 pool,195 graph,196 select_chain: _,197 fee_history_limit,198 fee_history_cache,199 block_data_cache,200 enable_dev_signer,201 is_authority,202 network,203 sync,204 deny_unsafe,205 filter_pool,206207 runtime_id: _,208209 #[cfg(feature = "pov-estimate")]210 exec_params,211212 #[cfg(feature = "pov-estimate")]213 backend,214215 eth_backend,216 max_past_logs,217 } = deps;218219 io.merge(System::new(Arc::clone(&client), Arc::clone(&pool), deny_unsafe).into_rpc())?;220 io.merge(TransactionPayment::new(Arc::clone(&client)).into_rpc())?;221222 // io.extend_with(ContractsApi::to_delegate(Contracts::new(client.clone())));223224 let mut signers = Vec::new();225 if enable_dev_signer {226 signers.push(Box::new(EthDevSigner::new()) as Box<dyn EthSigner>);227 }228229 let overrides = overrides_handle::<_, _, R>(client.clone());230231 let execute_gas_limit_multiplier = 10;232 io.merge(233 Eth::new(234 client.clone(),235 pool.clone(),236 graph,237 Some(<R as RuntimeInstance>::get_transaction_converter()),238 sync.clone(),239 signers,240 overrides.clone(),241 eth_backend.clone(),242 is_authority,243 block_data_cache.clone(),244 fee_history_cache,245 fee_history_limit,246 execute_gas_limit_multiplier,247 )248 .into_rpc(),249 )?;250251 io.merge(Unique::new(client.clone()).into_rpc())?;252253 io.merge(AppPromotion::new(client.clone()).into_rpc())?;254255 #[cfg(feature = "pov-estimate")]256 io.merge(257 PovEstimate::new(258 client.clone(),259 backend,260 deny_unsafe,261 exec_params,262 runtime_id,263 )264 .into_rpc(),265 )?;266267 if let Some(filter_pool) = filter_pool {268 io.merge(269 EthFilter::new(270 client.clone(),271 eth_backend,272 filter_pool,273 500_usize, // max stored filters274 max_past_logs,275 block_data_cache,276 )277 .into_rpc(),278 )?;279 }280281 io.merge(282 Net::new(283 client.clone(),284 network.clone(),285 // Whether to format the `peer_count` response as Hex (default) or not.286 true,287 )288 .into_rpc(),289 )?;290291 io.merge(Web3::new(client.clone()).into_rpc())?;292293 io.merge(EthPubSub::new(pool, client, sync, subscription_task_executor, overrides).into_rpc())?;294295 Ok(io)296}