Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ members = [
"client/header-metadata",
"client/keystore",
"client/network",
"client/network-gossip",
"client/offchain",
"client/rpc-servers",
"client/rpc",
Expand Down
1 change: 1 addition & 0 deletions client/finality-grandpa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ client = { package = "substrate-client", path = "../" }
header-metadata = { package = "substrate-header-metadata", path = "../header-metadata" }
inherents = { package = "substrate-inherents", path = "../../primitives/inherents" }
network = { package = "substrate-network", path = "../network" }
network-gossip = { package = "substrate-network-gossip", path = "../network-gossip" }
paint-finality-tracker = { path = "../../paint/finality-tracker" }
fg_primitives = { package = "substrate-finality-grandpa-primitives", path = "../../primitives/finality-grandpa" }
grandpa = { package = "finality-grandpa", version = "0.9.0", features = ["derive-codec"] }
Expand Down
13 changes: 5 additions & 8 deletions client/finality-grandpa/src/communication/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
//! We only send polite messages to peers,

use sr_primitives::traits::{NumberFor, Block as BlockT, Zero};
use network::consensus_gossip::{self as network_gossip, MessageIntent, ValidatorContext};
use network_gossip::{self, GossipEngine, MessageIntent, ValidatorContext};
use network::{config::Roles, PeerId};
use codec::{Encode, Decode};
use fg_primitives::AuthorityId;
Expand Down Expand Up @@ -1402,29 +1402,26 @@ pub(super) struct ReportStream {
impl ReportStream {
/// Consume the report stream, converting it into a future that
/// handles all reports.
pub(super) fn consume<B, N>(self, net: N)
pub(super) fn consume<B>(self, net: GossipEngine<B>)
-> impl Future<Item=(),Error=()> + Send + 'static
where
B: BlockT,
N: super::Network<B> + Send + 'static,
{
ReportingTask {
reports: self.reports,
net,
_marker: Default::default(),
}
}
}

/// A future for reporting peers.
#[must_use = "Futures do nothing unless polled"]
struct ReportingTask<B, N> {
struct ReportingTask<B: BlockT> {
reports: mpsc::UnboundedReceiver<PeerReport>,
net: N,
_marker: std::marker::PhantomData<B>,
net: GossipEngine<B>,
}

impl<B: BlockT, N: super::Network<B>> Future for ReportingTask<B, N> {
impl<B: BlockT> Future for ReportingTask<B> {
type Item = ();
type Error = ();

Expand Down
Loading