Skip to content

Conversation

@pawanjay176
Copy link
Member

Issue Addressed

N/A

Proposed Changes

Fixes multiple issues related to discovering of subnet peers.

  1. Subnet discovery retries after yielding no results
  2. Metadata updates if peer send older metadata
  3. peerdb stores the peer subscriptions from gossipsub

This reverts commit 05c74ac.
@pawanjay176 pawanjay176 added the ready-for-review The code is ready for review label Dec 15, 2020
self.peers.iter_mut()
.filter(move |(_, info)| {
info.is_connected() && info.on_subnet(subnet_id)
// TODO(pawan): should log a message or have a metric for when metadata and gossipsub diverge
Copy link
Member

Choose a reason for hiding this comment

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

Can we action or remove this TODO

Copy link
Member

Choose a reason for hiding this comment

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

I think we should log something

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry forgot about this. Will add a log.

Copy link
Member Author

@pawanjay176 pawanjay176 Dec 16, 2020

Choose a reason for hiding this comment

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

@AgeManning This is actually a bit tricky. gossipsub and metadata attnets can give conflicting results because it takes PING_INTERVAL (30secs) in the worst case for a peer to communicate an updated metadata.

For e.g. peer sends a ping -> peer subscribes to some subnet -> updates its metadata attnets -> wait 30 secs -> send ping with updated metadata
So we have this 30 sec period when metadata subscriptions don't agree with gossipsub subscriptions.

Copy link
Member Author

@pawanjay176 pawanjay176 Dec 16, 2020

Choose a reason for hiding this comment

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

I think we should just drop the logging here as it won't give us useful info most of the times.

@AgeManning AgeManning added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Dec 16, 2020
pawanjay176 and others added 2 commits December 16, 2020 12:02
Co-authored-by: Age Manning <Age@AgeManning.com>
Copy link
Member

@AgeManning AgeManning left a comment

Choose a reason for hiding this comment

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

LGTM

@AgeManning
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Dec 17, 2020
## Issue Addressed

N/A

## Proposed Changes

Fixes multiple issues related to discovering of subnet peers.
1. Subnet discovery retries after yielding no results
2. Metadata updates if peer send older metadata
3. peerdb stores the peer subscriptions from gossipsub
@bors
Copy link

bors bot commented Dec 17, 2020

@bors bors bot changed the title Subnet discovery fixes [Merged by Bors] - Subnet discovery fixes Dec 17, 2020
@bors bors bot closed this Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-on-author The reviewer has suggested changes and awaits thier implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants