Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
324299c
Extract gossiping system from network
tomaka Nov 27, 2019
23531d8
Merge remote-tracking branch 'upstream/master' into extract-gossip
tomaka Nov 29, 2019
f72f424
Finish porting GRANDPA tests
tomaka Nov 29, 2019
4b705f0
Merge remote-tracking branch 'upstream/master' into extract-gossip
tomaka Dec 2, 2019
64d2d8e
Try put correct engine ID
tomaka Dec 2, 2019
5747b8c
Fix messages encoding
tomaka Dec 2, 2019
be5c07d
Fix communication tests
tomaka Dec 2, 2019
64629da
Use a threads pool to spawn stuff
tomaka Dec 2, 2019
76d9bf3
Fix compilation everywhere
tomaka Dec 2, 2019
acfeb6a
Merge remote-tracking branch 'upstream/master' into extract-gossip
tomaka Dec 2, 2019
0dbccc6
Fix bad merge conflict
tomaka Dec 3, 2019
f993d1d
Merge remote-tracking branch 'upstream/master' into extract-gossip
tomaka Dec 3, 2019
7134aa4
Remove dependency on async-std
tomaka Dec 3, 2019
cdca500
Apply suggestions from code review
tomaka Dec 4, 2019
d1cc542
More suggestions
tomaka Dec 4, 2019
37f7b7c
Remove network startup GP future
tomaka Dec 4, 2019
00b82a5
Update to futures_timer
tomaka Dec 4, 2019
9e31024
adjust wait_when_behind test
rphmeier Dec 4, 2019
eac9548
Pass correct Roles after handshake
tomaka Dec 5, 2019
998cab7
Merge remote-tracking branch 'upstream/master' into extract-gossip
tomaka Dec 5, 2019
715462b
Revert "adjust wait_when_behind test"
tomaka Dec 6, 2019
ee8066e
Merge remote-tracking branch 'upstream/master' into extract-gossip
tomaka Dec 6, 2019
1f0a558
Crate root documentation
tomaka Dec 6, 2019
e6a06ad
Remove MessageRecipient
tomaka Dec 6, 2019
85544a9
Merge remote-tracking branch 'upstream/master' into extract-gossip
tomaka Dec 9, 2019
76437bc
Address concerns
tomaka Dec 9, 2019
a0b3c1c
Fix more concerns
tomaka Dec 10, 2019
6614ff3
Merge remote-tracking branch 'upstream/master' into extract-gossip
tomaka Dec 10, 2019
f9ea038
Merge remote-tracking branch 'upstream/master' into extract-gossip
tomaka Dec 11, 2019
9807b8b
Merge remote-tracking branch 'upstream/master' into extract-gossip
tomaka Dec 11, 2019
1711306
Merge remote-tracking branch 'upstream/master' into extract-gossip
tomaka Dec 11, 2019
4e5e586
Forgot Cargo.lock
tomaka Dec 11, 2019
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
31 changes: 31 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/tracing",
"client/keystore",
"client/network",
"client/network-gossip",
"client/offchain",
"client/peerset",
"client/rpc-servers",
Expand Down
2 changes: 2 additions & 0 deletions bin/node-template/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ pub fn new_full<C: Send + Default + 'static>(config: Configuration<C, GenesisCon
grandpa_link,
service.network(),
service.on_exit(),
service.spawn_task_handle(),
)?);
},
(true, false) => {
Expand All @@ -170,6 +171,7 @@ pub fn new_full<C: Send + Default + 'static>(config: Configuration<C, GenesisCon
on_exit: service.on_exit(),
telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
voting_rule: grandpa::VotingRulesBuilder::default().build(),
executor: service.spawn_task_handle(),
};

// the GRANDPA voter task is considered infallible, i.e.
Expand Down
2 changes: 2 additions & 0 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ macro_rules! new_full {
grandpa_link,
service.network(),
service.on_exit(),
service.spawn_task_handle(),
)?);
},
(true, false) => {
Expand All @@ -240,6 +241,7 @@ macro_rules! new_full {
on_exit: service.on_exit(),
telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
voting_rule: grandpa::VotingRulesBuilder::default().build(),
executor: service.spawn_task_handle(),
};
// the GRANDPA voter task is considered infallible, i.e.
// if it fails we take down the service with it.
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 = "sc-client", path = "../" }
inherents = { package = "sp-inherents", path = "../../primitives/inherents" }
sp-blockchain = { path = "../../primitives/blockchain" }
network = { package = "sc-network", path = "../network" }
network-gossip = { package = "sc-network-gossip", path = "../network-gossip" }
sp-finality-tracker = { path = "../../primitives/finality-tracker" }
fg_primitives = { package = "sp-finality-granpda", path = "../../primitives/finality-grandpa" }
grandpa = { package = "finality-grandpa", version = "0.10.1", 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 sp_runtime::traits::{NumberFor, Block as BlockT, Zero};
use network::consensus_gossip::{self as network_gossip, MessageIntent, ValidatorContext};
use network_gossip::{GossipEngine, MessageIntent, ValidatorContext};
use network::{config::Roles, PeerId, ReputationChange};
use codec::{Encode, Decode};
use fg_primitives::AuthorityId;
Expand Down Expand Up @@ -1459,29 +1459,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