Replace tokio_core with tokio (ring -> 0.13) (#9657)
* Replace `tokio_core` with `tokio`.
* Remove `tokio-core` and replace with `tokio` in
- `ethcore/stratum`
- `secret_store`
- `util/fetch`
- `util/reactor`
* Bump hyper to 0.12 in
- `miner`
- `util/fake-fetch`
- `util/fetch`
- `secret_store`
* Bump `jsonrpc-***` to 0.9 in
- `parity`
- `ethcore/stratum`
- `ipfs`
- `rpc`
- `rpc_client`
- `whisper`
* Bump `ring` to 0.13
* Use a more graceful shutdown process in `secret_store` tests.
* Convert some mutexes to rwlocks in `secret_store`.
* Consolidate Tokio Runtime use, remove `CpuPool`.
* Rename and move the `tokio_reactor` crate (`util/reactor`) to
`tokio_runtime` (`util/runtime`).
* Rename `EventLoop` to `Runtime`.
- Rename `EventLoop::spawn` to `Runtime::with_default_thread_count`.
- Add the `Runtime::with_thread_count` method.
- Rename `Remote` to `Executor`.
* Remove uses of `CpuPool` and spawn all tasks via the `Runtime` executor
instead.
* Other changes related to `CpuPool` removal:
- Remove `Reservations::with_pool`. `::new` now takes an `Executor` as an argument.
- Remove `SenderReservations::with_pool`. `::new` now takes an `Executor` as an argument.
This commit is contained in:
committed by
Afri Schoedon
parent
b8da38f4e4
commit
68ca8df22f
@@ -25,7 +25,6 @@ extern crate clap;
|
||||
extern crate dir;
|
||||
extern crate env_logger;
|
||||
extern crate futures;
|
||||
extern crate futures_cpupool;
|
||||
extern crate atty;
|
||||
extern crate jsonrpc_core;
|
||||
extern crate num_cpus;
|
||||
@@ -60,7 +59,7 @@ extern crate kvdb;
|
||||
extern crate parity_hash_fetch as hash_fetch;
|
||||
extern crate parity_ipfs_api;
|
||||
extern crate parity_local_store as local_store;
|
||||
extern crate parity_reactor;
|
||||
extern crate parity_runtime;
|
||||
extern crate parity_rpc;
|
||||
extern crate parity_updater as updater;
|
||||
extern crate parity_version;
|
||||
|
||||
@@ -29,7 +29,7 @@ use light::TransactionQueue;
|
||||
|
||||
use futures::{future, Future};
|
||||
|
||||
use parity_reactor::Remote;
|
||||
use parity_runtime::Executor;
|
||||
|
||||
use parking_lot::RwLock;
|
||||
|
||||
@@ -50,8 +50,8 @@ pub struct QueueCull<T> {
|
||||
pub on_demand: Arc<OnDemand>,
|
||||
/// The transaction queue.
|
||||
pub txq: Arc<RwLock<TransactionQueue>>,
|
||||
/// Event loop remote.
|
||||
pub remote: Remote,
|
||||
/// Event loop executor.
|
||||
pub executor: Executor,
|
||||
}
|
||||
|
||||
impl<T: LightChainClient + 'static> IoHandler<ClientIoMessage> for QueueCull<T> {
|
||||
@@ -70,7 +70,7 @@ impl<T: LightChainClient + 'static> IoHandler<ClientIoMessage> for QueueCull<T>
|
||||
let start_nonce = self.client.engine().account_start_nonce(best_header.number());
|
||||
|
||||
info!(target: "cull", "Attempting to cull queued transactions from {} senders.", senders.len());
|
||||
self.remote.spawn_with_timeout(move |_| {
|
||||
self.executor.spawn_with_timeout(move || {
|
||||
let maybe_fetching = sync.with_context(move |ctx| {
|
||||
// fetch the nonce of each sender in the queue.
|
||||
let nonce_reqs = senders.iter()
|
||||
|
||||
@@ -21,7 +21,7 @@ use ethcore::client::Mode;
|
||||
use ethcore::ethereum;
|
||||
use ethcore::spec::{Spec, SpecParams};
|
||||
use ethereum_types::{U256, Address};
|
||||
use futures_cpupool::CpuPool;
|
||||
use parity_runtime::Executor;
|
||||
use hash_fetch::fetch::Client as FetchClient;
|
||||
use journaldb::Algorithm;
|
||||
use miner::gas_pricer::GasPricer;
|
||||
@@ -256,7 +256,7 @@ impl Default for GasPricerConfig {
|
||||
}
|
||||
|
||||
impl GasPricerConfig {
|
||||
pub fn to_gas_pricer(&self, fetch: FetchClient, p: CpuPool) -> GasPricer {
|
||||
pub fn to_gas_pricer(&self, fetch: FetchClient, p: Executor) -> GasPricer {
|
||||
match *self {
|
||||
GasPricerConfig::Fixed(u) => GasPricer::Fixed(u),
|
||||
GasPricerConfig::Calibrated { usd_per_tx, recalibration_period, .. } => {
|
||||
|
||||
@@ -23,14 +23,13 @@ use dir::default_data_path;
|
||||
use dir::helpers::replace_home;
|
||||
use helpers::parity_ipc_path;
|
||||
use jsonrpc_core::MetaIoHandler;
|
||||
use parity_reactor::TokioRemote;
|
||||
use parity_runtime::Executor;
|
||||
use parity_rpc::informant::{RpcStats, Middleware};
|
||||
use parity_rpc::{self as rpc, Metadata, DomainsValidation};
|
||||
use rpc_apis::{self, ApiSet};
|
||||
|
||||
pub use parity_rpc::{IpcServer, HttpServer, RequestMiddleware};
|
||||
pub use parity_rpc::ws::Server as WsServer;
|
||||
pub use parity_rpc::informant::CpuPool;
|
||||
|
||||
pub const DAPPS_DOMAIN: &'static str = "web3.site";
|
||||
|
||||
@@ -134,9 +133,8 @@ fn address(enabled: bool, bind_iface: &str, bind_port: u16, hosts: &Option<Vec<S
|
||||
|
||||
pub struct Dependencies<D: rpc_apis::Dependencies> {
|
||||
pub apis: Arc<D>,
|
||||
pub remote: TokioRemote,
|
||||
pub executor: Executor,
|
||||
pub stats: Arc<RpcStats>,
|
||||
pub pool: Option<CpuPool>,
|
||||
}
|
||||
|
||||
pub fn new_ws<D: rpc_apis::Dependencies>(
|
||||
@@ -155,7 +153,7 @@ pub fn new_ws<D: rpc_apis::Dependencies>(
|
||||
let handler = {
|
||||
let mut handler = MetaIoHandler::with_middleware((
|
||||
rpc::WsDispatcher::new(full_handler),
|
||||
Middleware::new(deps.stats.clone(), deps.apis.activity_notifier(), deps.pool.clone())
|
||||
Middleware::new(deps.stats.clone(), deps.apis.activity_notifier())
|
||||
));
|
||||
let apis = conf.apis.list_apis();
|
||||
deps.apis.extend_with_set(&mut handler, &apis);
|
||||
@@ -163,7 +161,6 @@ pub fn new_ws<D: rpc_apis::Dependencies>(
|
||||
handler
|
||||
};
|
||||
|
||||
let remote = deps.remote.clone();
|
||||
let allowed_origins = into_domains(with_domain(conf.origins, domain, &None));
|
||||
let allowed_hosts = into_domains(with_domain(conf.hosts, domain, &Some(url.clone().into())));
|
||||
|
||||
@@ -178,7 +175,6 @@ pub fn new_ws<D: rpc_apis::Dependencies>(
|
||||
let start_result = rpc::start_ws(
|
||||
&addr,
|
||||
handler,
|
||||
remote.clone(),
|
||||
allowed_origins,
|
||||
allowed_hosts,
|
||||
conf.max_connections,
|
||||
@@ -210,7 +206,6 @@ pub fn new_http<D: rpc_apis::Dependencies>(
|
||||
let url = format!("{}:{}", conf.interface, conf.port);
|
||||
let addr = url.parse().map_err(|_| format!("Invalid {} listen host/port given: {}", id, url))?;
|
||||
let handler = setup_apis(conf.apis, deps);
|
||||
let remote = deps.remote.clone();
|
||||
|
||||
let cors_domains = into_domains(conf.cors);
|
||||
let allowed_hosts = into_domains(with_domain(conf.hosts, domain, &Some(url.clone().into())));
|
||||
@@ -220,7 +215,6 @@ pub fn new_http<D: rpc_apis::Dependencies>(
|
||||
cors_domains,
|
||||
allowed_hosts,
|
||||
handler,
|
||||
remote,
|
||||
rpc::RpcExtractor,
|
||||
conf.server_threads,
|
||||
conf.max_payload,
|
||||
@@ -244,7 +238,6 @@ pub fn new_ipc<D: rpc_apis::Dependencies>(
|
||||
}
|
||||
|
||||
let handler = setup_apis(conf.apis, dependencies);
|
||||
let remote = dependencies.remote.clone();
|
||||
let path = PathBuf::from(&conf.socket_addr);
|
||||
// Make sure socket file can be created on unix-like OS.
|
||||
// Windows pipe paths are not on the FS.
|
||||
@@ -255,7 +248,7 @@ pub fn new_ipc<D: rpc_apis::Dependencies>(
|
||||
}
|
||||
}
|
||||
|
||||
match rpc::start_ipc(&conf.socket_addr, handler, remote, rpc::RpcExtractor) {
|
||||
match rpc::start_ipc(&conf.socket_addr, handler, rpc::RpcExtractor) {
|
||||
Ok(server) => Ok(Some(server)),
|
||||
Err(io_error) => Err(format!("IPC error: {}", io_error)),
|
||||
}
|
||||
@@ -294,7 +287,7 @@ pub fn setup_apis<D>(apis: ApiSet, deps: &Dependencies<D>) -> MetaIoHandler<Meta
|
||||
where D: rpc_apis::Dependencies
|
||||
{
|
||||
let mut handler = MetaIoHandler::with_middleware(
|
||||
Middleware::new(deps.stats.clone(), deps.apis.activity_notifier(), deps.pool.clone())
|
||||
Middleware::new(deps.stats.clone(), deps.apis.activity_notifier())
|
||||
);
|
||||
let apis = apis.list_apis();
|
||||
deps.apis.extend_with_set(&mut handler, &apis);
|
||||
|
||||
@@ -28,13 +28,12 @@ use ethcore::miner::Miner;
|
||||
use ethcore::snapshot::SnapshotService;
|
||||
use ethcore_logger::RotatingLogger;
|
||||
use sync::{ManageNetwork, SyncProvider, LightSync};
|
||||
use futures_cpupool::CpuPool;
|
||||
use hash_fetch::fetch::Client as FetchClient;
|
||||
use jsonrpc_core::{self as core, MetaIoHandler};
|
||||
use light::client::LightChainClient;
|
||||
use light::{TransactionQueue as LightTransactionQueue, Cache as LightDataCache};
|
||||
use miner::external::ExternalMiner;
|
||||
use parity_reactor;
|
||||
use parity_runtime::Executor;
|
||||
use parity_rpc::dispatch::{FullDispatcher, LightDispatcher};
|
||||
use parity_rpc::informant::{ActivityNotifier, ClientNotifier};
|
||||
use parity_rpc::{Metadata, NetworkSettings, Host};
|
||||
@@ -231,8 +230,7 @@ pub struct FullDependencies {
|
||||
pub geth_compatibility: bool,
|
||||
pub ws_address: Option<Host>,
|
||||
pub fetch: FetchClient,
|
||||
pub pool: CpuPool,
|
||||
pub remote: parity_reactor::Remote,
|
||||
pub executor: Executor,
|
||||
pub whisper_rpc: Option<::whisper::RpcFactory>,
|
||||
pub gas_price_percentile: usize,
|
||||
pub poll_lifetime: u32,
|
||||
@@ -253,7 +251,7 @@ impl FullDependencies {
|
||||
let deps = &$deps;
|
||||
let dispatcher = FullDispatcher::new(deps.client.clone(), deps.miner.clone(), $nonces, deps.gas_price_percentile);
|
||||
if deps.signer_service.is_enabled() {
|
||||
$handler.extend_with($namespace::to_delegate(SigningQueueClient::new(&deps.signer_service, dispatcher, deps.remote.clone(), &deps.secret_store)))
|
||||
$handler.extend_with($namespace::to_delegate(SigningQueueClient::new(&deps.signer_service, dispatcher, deps.executor.clone(), &deps.secret_store)))
|
||||
} else {
|
||||
$handler.extend_with($namespace::to_delegate(SigningUnsafeClient::new(&deps.secret_store, dispatcher)))
|
||||
}
|
||||
@@ -261,7 +259,7 @@ impl FullDependencies {
|
||||
}
|
||||
}
|
||||
|
||||
let nonces = Arc::new(Mutex::new(dispatch::Reservations::with_pool(self.pool.clone())));
|
||||
let nonces = Arc::new(Mutex::new(dispatch::Reservations::new(self.executor.clone())));
|
||||
let dispatcher = FullDispatcher::new(
|
||||
self.client.clone(),
|
||||
self.miner.clone(),
|
||||
@@ -306,7 +304,7 @@ impl FullDependencies {
|
||||
},
|
||||
Api::EthPubSub => {
|
||||
if !for_generic_pubsub {
|
||||
let client = EthPubSubClient::new(self.client.clone(), self.remote.clone());
|
||||
let client = EthPubSubClient::new(self.client.clone(), self.executor.clone());
|
||||
let h = client.handler();
|
||||
self.miner.add_transactions_listener(Box::new(move |hashes| if let Some(h) = h.upgrade() {
|
||||
h.notify_new_transactions(hashes);
|
||||
@@ -322,7 +320,7 @@ impl FullDependencies {
|
||||
handler.extend_with(PersonalClient::new(&self.secret_store, dispatcher.clone(), self.geth_compatibility).to_delegate());
|
||||
},
|
||||
Api::Signer => {
|
||||
handler.extend_with(SignerClient::new(&self.secret_store, dispatcher.clone(), &self.signer_service, self.remote.clone()).to_delegate());
|
||||
handler.extend_with(SignerClient::new(&self.secret_store, dispatcher.clone(), &self.signer_service, self.executor.clone()).to_delegate());
|
||||
},
|
||||
Api::Parity => {
|
||||
let signer = match self.signer_service.is_enabled() {
|
||||
@@ -351,7 +349,7 @@ impl FullDependencies {
|
||||
let mut rpc = MetaIoHandler::default();
|
||||
let apis = ApiSet::List(apis.clone()).retain(ApiSet::PubSub).list_apis();
|
||||
self.extend_api(&mut rpc, &apis, true);
|
||||
handler.extend_with(PubSubClient::new(rpc, self.remote.clone()).to_delegate());
|
||||
handler.extend_with(PubSubClient::new(rpc, self.executor.clone()).to_delegate());
|
||||
}
|
||||
},
|
||||
Api::ParityAccounts => {
|
||||
@@ -364,7 +362,6 @@ impl FullDependencies {
|
||||
&self.updater,
|
||||
&self.net_service,
|
||||
self.fetch.clone(),
|
||||
self.pool.clone(),
|
||||
).to_delegate())
|
||||
},
|
||||
Api::Traces => {
|
||||
@@ -440,9 +437,8 @@ pub struct LightDependencies<T> {
|
||||
pub transaction_queue: Arc<RwLock<LightTransactionQueue>>,
|
||||
pub ws_address: Option<Host>,
|
||||
pub fetch: FetchClient,
|
||||
pub pool: CpuPool,
|
||||
pub geth_compatibility: bool,
|
||||
pub remote: parity_reactor::Remote,
|
||||
pub executor: Executor,
|
||||
pub whisper_rpc: Option<::whisper::RpcFactory>,
|
||||
pub private_tx_service: Option<Arc<PrivateTransactionManager>>,
|
||||
pub gas_price_percentile: usize,
|
||||
@@ -464,7 +460,7 @@ impl<C: LightChainClient + 'static> LightDependencies<C> {
|
||||
self.on_demand.clone(),
|
||||
self.cache.clone(),
|
||||
self.transaction_queue.clone(),
|
||||
Arc::new(Mutex::new(dispatch::Reservations::with_pool(self.pool.clone()))),
|
||||
Arc::new(Mutex::new(dispatch::Reservations::new(self.executor.clone()))),
|
||||
self.gas_price_percentile,
|
||||
);
|
||||
|
||||
@@ -476,7 +472,7 @@ impl<C: LightChainClient + 'static> LightDependencies<C> {
|
||||
let secret_store = deps.secret_store.clone();
|
||||
if deps.signer_service.is_enabled() {
|
||||
$handler.extend_with($namespace::to_delegate(
|
||||
SigningQueueClient::new(&deps.signer_service, dispatcher, deps.remote.clone(), &secret_store)
|
||||
SigningQueueClient::new(&deps.signer_service, dispatcher, deps.executor.clone(), &secret_store)
|
||||
))
|
||||
} else {
|
||||
$handler.extend_with(
|
||||
@@ -522,7 +518,7 @@ impl<C: LightChainClient + 'static> LightDependencies<C> {
|
||||
self.on_demand.clone(),
|
||||
self.sync.clone(),
|
||||
self.cache.clone(),
|
||||
self.remote.clone(),
|
||||
self.executor.clone(),
|
||||
self.gas_price_percentile,
|
||||
);
|
||||
self.client.add_listener(client.handler() as Weak<_>);
|
||||
@@ -538,7 +534,7 @@ impl<C: LightChainClient + 'static> LightDependencies<C> {
|
||||
handler.extend_with(PersonalClient::new(&self.secret_store, dispatcher.clone(), self.geth_compatibility).to_delegate());
|
||||
},
|
||||
Api::Signer => {
|
||||
handler.extend_with(SignerClient::new(&self.secret_store, dispatcher.clone(), &self.signer_service, self.remote.clone()).to_delegate());
|
||||
handler.extend_with(SignerClient::new(&self.secret_store, dispatcher.clone(), &self.signer_service, self.executor.clone()).to_delegate());
|
||||
},
|
||||
Api::Parity => {
|
||||
let signer = match self.signer_service.is_enabled() {
|
||||
@@ -565,7 +561,7 @@ impl<C: LightChainClient + 'static> LightDependencies<C> {
|
||||
let mut rpc = MetaIoHandler::default();
|
||||
let apis = ApiSet::List(apis.clone()).retain(ApiSet::PubSub).list_apis();
|
||||
self.extend_api(&mut rpc, &apis, true);
|
||||
handler.extend_with(PubSubClient::new(rpc, self.remote.clone()).to_delegate());
|
||||
handler.extend_with(PubSubClient::new(rpc, self.executor.clone()).to_delegate());
|
||||
}
|
||||
},
|
||||
Api::ParityAccounts => {
|
||||
@@ -575,7 +571,6 @@ impl<C: LightChainClient + 'static> LightDependencies<C> {
|
||||
handler.extend_with(light::ParitySetClient::new(
|
||||
self.sync.clone(),
|
||||
self.fetch.clone(),
|
||||
self.pool.clone(),
|
||||
).to_delegate())
|
||||
},
|
||||
Api::Traces => {
|
||||
|
||||
@@ -34,14 +34,13 @@ use ethereum_types::Address;
|
||||
use sync::{self, SyncConfig};
|
||||
use miner::work_notify::WorkPoster;
|
||||
use futures::IntoFuture;
|
||||
use futures_cpupool::CpuPool;
|
||||
use hash_fetch::{self, fetch};
|
||||
use informant::{Informant, LightNodeInformantData, FullNodeInformantData};
|
||||
use journaldb::Algorithm;
|
||||
use light::Cache as LightDataCache;
|
||||
use miner::external::ExternalMiner;
|
||||
use node_filter::NodeFilter;
|
||||
use parity_reactor::EventLoop;
|
||||
use parity_runtime::Runtime;
|
||||
use parity_rpc::{Origin, Metadata, NetworkSettings, informant, is_major_importing};
|
||||
use updater::{UpdatePolicy, Updater};
|
||||
use parity_version::version;
|
||||
@@ -270,7 +269,7 @@ fn execute_light_impl(cmd: RunCmd, logger: Arc<RotatingLogger>) -> Result<Runnin
|
||||
*sync_handle.write() = Arc::downgrade(&light_sync);
|
||||
|
||||
// spin up event loop
|
||||
let event_loop = EventLoop::spawn();
|
||||
let runtime = Runtime::with_default_thread_count();
|
||||
|
||||
// queue cull service.
|
||||
let queue_cull = Arc::new(::light_helpers::QueueCull {
|
||||
@@ -278,7 +277,7 @@ fn execute_light_impl(cmd: RunCmd, logger: Arc<RotatingLogger>) -> Result<Runnin
|
||||
sync: light_sync.clone(),
|
||||
on_demand: on_demand.clone(),
|
||||
txq: txq.clone(),
|
||||
remote: event_loop.remote(),
|
||||
executor: runtime.executor(),
|
||||
});
|
||||
|
||||
service.register_handler(queue_cull).map_err(|e| format!("Error attaching service: {:?}", e))?;
|
||||
@@ -286,8 +285,6 @@ fn execute_light_impl(cmd: RunCmd, logger: Arc<RotatingLogger>) -> Result<Runnin
|
||||
// start the network.
|
||||
light_sync.start_network();
|
||||
|
||||
let cpu_pool = CpuPool::new(4);
|
||||
|
||||
// fetch service
|
||||
let fetch = fetch::Client::new(FETCH_LIGHT_NUM_DNS_THREADS).map_err(|e| format!("Error starting fetch client: {:?}", e))?;
|
||||
let passwords = passwords_from_files(&cmd.acc_conf.password_files)?;
|
||||
@@ -313,9 +310,8 @@ fn execute_light_impl(cmd: RunCmd, logger: Arc<RotatingLogger>) -> Result<Runnin
|
||||
transaction_queue: txq,
|
||||
ws_address: cmd.ws_conf.address(),
|
||||
fetch: fetch,
|
||||
pool: cpu_pool.clone(),
|
||||
geth_compatibility: cmd.geth_compatibility,
|
||||
remote: event_loop.remote(),
|
||||
executor: runtime.executor(),
|
||||
whisper_rpc: whisper_factory,
|
||||
private_tx_service: None, //TODO: add this to client.
|
||||
gas_price_percentile: cmd.gas_price_percentile,
|
||||
@@ -324,13 +320,8 @@ fn execute_light_impl(cmd: RunCmd, logger: Arc<RotatingLogger>) -> Result<Runnin
|
||||
|
||||
let dependencies = rpc::Dependencies {
|
||||
apis: deps_for_rpc_apis.clone(),
|
||||
remote: event_loop.raw_remote(),
|
||||
executor: runtime.executor(),
|
||||
stats: rpc_stats.clone(),
|
||||
pool: if cmd.http_conf.processing_threads > 0 {
|
||||
Some(rpc::CpuPool::new(cmd.http_conf.processing_threads))
|
||||
} else {
|
||||
None
|
||||
},
|
||||
};
|
||||
|
||||
// start rpc servers
|
||||
@@ -358,7 +349,7 @@ fn execute_light_impl(cmd: RunCmd, logger: Arc<RotatingLogger>) -> Result<Runnin
|
||||
rpc: rpc_direct,
|
||||
informant,
|
||||
client,
|
||||
keep_alive: Box::new((event_loop, service, ws_server, http_server, ipc_server)),
|
||||
keep_alive: Box::new((runtime, service, ws_server, http_server, ipc_server)),
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -477,10 +468,8 @@ fn execute_impl<Cr, Rr>(cmd: RunCmd, logger: Arc<RotatingLogger>, on_client_rq:
|
||||
// prepare account provider
|
||||
let account_provider = Arc::new(prepare_account_provider(&cmd.spec, &cmd.dirs, &spec.data_dir, cmd.acc_conf, &passwords)?);
|
||||
|
||||
let cpu_pool = CpuPool::new(4);
|
||||
|
||||
// spin up event loop
|
||||
let event_loop = EventLoop::spawn();
|
||||
let runtime = Runtime::with_default_thread_count();
|
||||
|
||||
// fetch service
|
||||
let fetch = fetch::Client::new(FETCH_FULL_NUM_DNS_THREADS).map_err(|e| format!("Error starting fetch client: {:?}", e))?;
|
||||
@@ -489,7 +478,7 @@ fn execute_impl<Cr, Rr>(cmd: RunCmd, logger: Arc<RotatingLogger>, on_client_rq:
|
||||
// create miner
|
||||
let miner = Arc::new(Miner::new(
|
||||
cmd.miner_options,
|
||||
cmd.gas_pricer_conf.to_gas_pricer(fetch.clone(), cpu_pool.clone()),
|
||||
cmd.gas_pricer_conf.to_gas_pricer(fetch.clone(), runtime.executor()),
|
||||
&spec,
|
||||
Some(account_provider.clone()),
|
||||
|
||||
@@ -500,7 +489,7 @@ fn execute_impl<Cr, Rr>(cmd: RunCmd, logger: Arc<RotatingLogger>, on_client_rq:
|
||||
|
||||
if !cmd.miner_extras.work_notify.is_empty() {
|
||||
miner.add_work_listener(Box::new(
|
||||
WorkPoster::new(&cmd.miner_extras.work_notify, fetch.clone(), event_loop.remote())
|
||||
WorkPoster::new(&cmd.miner_extras.work_notify, fetch.clone(), runtime.executor())
|
||||
));
|
||||
}
|
||||
|
||||
@@ -698,7 +687,7 @@ fn execute_impl<Cr, Rr>(cmd: RunCmd, logger: Arc<RotatingLogger>, on_client_rq:
|
||||
&Arc::downgrade(&(service.client() as Arc<BlockChainClient>)),
|
||||
&Arc::downgrade(&sync_provider),
|
||||
update_policy,
|
||||
hash_fetch::Client::with_fetch(contract_client.clone(), cpu_pool.clone(), updater_fetch, event_loop.remote())
|
||||
hash_fetch::Client::with_fetch(contract_client.clone(), updater_fetch, runtime.executor())
|
||||
);
|
||||
service.add_notify(updater.clone());
|
||||
|
||||
@@ -723,8 +712,7 @@ fn execute_impl<Cr, Rr>(cmd: RunCmd, logger: Arc<RotatingLogger>, on_client_rq:
|
||||
geth_compatibility: cmd.geth_compatibility,
|
||||
ws_address: cmd.ws_conf.address(),
|
||||
fetch: fetch.clone(),
|
||||
pool: cpu_pool.clone(),
|
||||
remote: event_loop.remote(),
|
||||
executor: runtime.executor(),
|
||||
whisper_rpc: whisper_factory,
|
||||
private_tx_service: Some(private_tx_service.clone()),
|
||||
gas_price_percentile: cmd.gas_price_percentile,
|
||||
@@ -733,14 +721,8 @@ fn execute_impl<Cr, Rr>(cmd: RunCmd, logger: Arc<RotatingLogger>, on_client_rq:
|
||||
|
||||
let dependencies = rpc::Dependencies {
|
||||
apis: deps_for_rpc_apis.clone(),
|
||||
remote: event_loop.raw_remote(),
|
||||
executor: runtime.executor(),
|
||||
stats: rpc_stats.clone(),
|
||||
pool: if cmd.http_conf.processing_threads > 0 {
|
||||
Some(rpc::CpuPool::new(cmd.http_conf.processing_threads))
|
||||
} else {
|
||||
None
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
// start rpc servers
|
||||
@@ -820,7 +802,7 @@ fn execute_impl<Cr, Rr>(cmd: RunCmd, logger: Arc<RotatingLogger>, on_client_rq:
|
||||
informant,
|
||||
client,
|
||||
client_service: Arc::new(service),
|
||||
keep_alive: Box::new((watcher, updater, ws_server, http_server, ipc_server, secretstore_key_server, ipfs_server, event_loop)),
|
||||
keep_alive: Box::new((watcher, updater, ws_server, http_server, ipc_server, secretstore_key_server, ipfs_server, runtime)),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user