From 93071ebe49b8f570084cffca0a16a7594fe24714 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Thu, 7 Dec 2023 15:51:17 +0300 Subject: [PATCH] Use SyncingService for Eth --- Cargo.lock | 1 + Cargo.toml | 1 + crates/humanode-rpc/Cargo.toml | 1 + crates/humanode-rpc/src/lib.rs | 8 ++++++-- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 44e009a2d..b99d4c1fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3722,6 +3722,7 @@ dependencies = [ "sc-consensus-grandpa", "sc-consensus-grandpa-rpc", "sc-network", + "sc-network-sync", "sc-rpc", "sc-rpc-api", "sc-rpc-spec-v2", diff --git a/Cargo.toml b/Cargo.toml index 282ea5cb5..ca8c803a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -101,6 +101,7 @@ sc-consensus-grandpa = { git = "https://github.com/humanode-network/substrate", sc-consensus-grandpa-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-executor = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-network = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-network-sync = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-rpc-api = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-rpc-spec-v2 = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } diff --git a/crates/humanode-rpc/Cargo.toml b/crates/humanode-rpc/Cargo.toml index 60df8fb3f..384b84cfe 100644 --- a/crates/humanode-rpc/Cargo.toml +++ b/crates/humanode-rpc/Cargo.toml @@ -29,6 +29,7 @@ sc-consensus-epochs = { workspace = true } sc-consensus-grandpa = { workspace = true } sc-consensus-grandpa-rpc = { workspace = true } sc-network = { workspace = true } +sc-network-sync = { workspace = true } sc-rpc = { workspace = true } sc-rpc-api = { workspace = true } sc-rpc-spec-v2 = { workspace = true } diff --git a/crates/humanode-rpc/src/lib.rs b/crates/humanode-rpc/src/lib.rs index b0dba5810..d19101636 100644 --- a/crates/humanode-rpc/src/lib.rs +++ b/crates/humanode-rpc/src/lib.rs @@ -29,6 +29,7 @@ use sc_consensus_grandpa::{ }; use sc_consensus_grandpa_rpc::{Grandpa, GrandpaApiServer}; use sc_network::NetworkService; +use sc_network_sync::SyncingService; pub use sc_rpc_api::DenyUnsafe; use sc_rpc_spec_v2::chain_spec::{ChainSpec, ChainSpecApiServer}; use sc_transaction_pool::{ChainApi, Pool}; @@ -126,8 +127,10 @@ pub struct Deps { pub deny_unsafe: DenyUnsafe, /// Graph pool instance. pub graph: Arc>, - /// Network service + /// Network service. pub network: Arc>, + /// Chain syncing service. + pub sync: Arc>, /// A copy of the chain spec. pub chain_spec: Box, /// AuthorExt specific dependencies. @@ -191,6 +194,7 @@ where deny_unsafe, graph, network, + sync, chain_spec, author_ext, is_authority, @@ -303,7 +307,7 @@ where Arc::clone(&pool), graph, Some(humanode_runtime::TransactionConverter), - Arc::clone(&network), + Arc::clone(&sync), Vec::new(), Arc::clone(ð_overrides), Arc::clone(ð_backend),