Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Time-based gradual gossip #4176

Merged
merged 1 commit into from
Nov 26, 2019
Merged

Time-based gradual gossip #4176

merged 1 commit into from
Nov 26, 2019

Conversation

arkpar
Copy link
Member

@arkpar arkpar commented Nov 21, 2019

This reworks #4050 to use time-based gossip progression, rather than relying on the number of attempts, which is quite random.

@arkpar arkpar added the A0-please_review Pull request needs code review. label Nov 21, 2019
@tomaka
Copy link
Contributor

tomaka commented Nov 22, 2019

This heavily conflicts with #4125

@gavofyork
Copy link
Member

I'd like to get it in soon, but since a bug in the logic has the potential to halt finality, it's probably best to test a little first on @andresilva 's chaos setup, and roll out gradually. would nonetheless be nice to get it in soon after we bump polkadot-master for 0.6.18.

@arkpar
Copy link
Member Author

arkpar commented Nov 22, 2019

This heavily conflicts with #4125

Not that heavy.
Most changes are in client/finality-grandpa/src/communication/gossip.rs, which is barely touched in #4125

Changes in client/network are mostly removing stuff introduced in #4050

@gavofyork gavofyork added this to the polkadot-0.6.19 milestone Nov 22, 2019
@tomaka
Copy link
Contributor

tomaka commented Nov 25, 2019

For what it's worth I'm fine with that PR being merged. I don't know enough about how this part of the gossiping system works to review this, however.

Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the round_start should be kept per round rather than globally. The downside with the current approachis that we might delay gossiping older messages a little bit (as we progress to a new round and restart the timer). Although that may be a good thing in order to reduce gossip further. I think the current implementation should be fine and shouldn't lead to any stalls as we always broadcast to everyone eventually.

const PROPAGATION_ALL: u32 = 4; //in rounds;
const PROPAGATION_ALL_AUTHORITIES: u32 = 2; //in rounds;
const PROPAGATION_SOME_NON_AUTHORITIES: u32 = 3; //in rounds;
const ROUND_DURATION: u32 = 4; // measured in gossip durations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be 2 (prevote and precommit)? Or are the extra 2 gossip durations to account for network/gossip delays?

@gavofyork gavofyork merged commit 4e240f8 into master Nov 26, 2019
@gavofyork gavofyork deleted the a-less-gossip branch November 26, 2019 17:17
@@ -492,6 +515,37 @@ impl<N: Ord> Peers<N> {
fn non_authorities(&self) -> usize {
self.inner.iter().filter(|(_, info)| !info.roles.is_authority()).count()
}

fn reshuffle(&mut self) {
let mut lucky_peers : Vec<_> = self.inner
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let mut lucky_peers : Vec<_> = self.inner
let mut lucky_peers: Vec<_> = self.inner

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants