Skip to content

pex: dial seeds when address book needs more addresses#3603

Merged
melekes merged 2 commits intotendermint:developfrom
Polychain:fix-stalled-peer-discovery
Apr 30, 2019
Merged

pex: dial seeds when address book needs more addresses#3603
melekes merged 2 commits intotendermint:developfrom
Polychain:fix-stalled-peer-discovery

Conversation

@defunctzombie
Copy link
Contributor

@defunctzombie defunctzombie commented Apr 29, 2019

If we are low on addresses for peering, we need to discover more peers. The
previous behavior would query existing peers; however, if an existing peer
does not participate in peer exchange, then our node will not discover more peers.

This change consults both existing peers as well as seeds when there is a deficit
in address book addresses. This allows for discovering peers though existing channels
as well as via seeds if existing peers do not share addresses.


  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGELOG_PENDING.md

If we are low on addresses for peering, we need to discover more peers. The
previous behavior would query existing peers; however, if an existing peer
does not participate in peer exchange, then our node will not discover more peers.

This change consults both existing peers as well as seeds when there is a deficit
in address book addresses. This allows for discovering peers though existing channels
as well as via seeds if existing peers do not share addresses.
@defunctzombie
Copy link
Contributor Author

I'd like to settle on direction for the code changes before tackling the remaining TODO items from the PR checklist.

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@4253e67). Click here to learn what that means.
The diff coverage is 100%.

@@            Coverage Diff            @@
##             master    #3603   +/-   ##
=========================================
  Coverage          ?   64.15%           
=========================================
  Files             ?      213           
  Lines             ?    17380           
  Branches          ?        0           
=========================================
  Hits              ?    11150           
  Misses            ?     5303           
  Partials          ?      927
Impacted Files Coverage Δ
p2p/pex/pex_reactor.go 78.83% <100%> (ø)

@jackzampolin
Copy link
Contributor

This looks like a great change!

Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

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

🍓 🍌 🥛

@melekes melekes changed the base branch from master to develop April 30, 2019 06:05
@melekes melekes self-assigned this Apr 30, 2019
@melekes melekes merged commit 40dbad9 into tendermint:develop Apr 30, 2019
@melekes
Copy link
Contributor

melekes commented Apr 30, 2019

Thanks for contributing to Tendermint 👍

melekes added a commit that referenced this pull request Apr 30, 2019
melekes added a commit that referenced this pull request May 1, 2019
* p2p: merge switch cases

also improve the error msg in privval

* pex: refactor code plus update specification

follow-up to #3603

* Update docs/spec/reactors/pex/pex.md

Co-Authored-By: melekes <anton.kalyaev@gmail.com>
@melekes melekes mentioned this pull request May 7, 2019
36 tasks
@defunctzombie defunctzombie deleted the fix-stalled-peer-discovery branch May 8, 2019 22:16
@melekes melekes mentioned this pull request May 30, 2019
44 tasks
brapse pushed a commit to brapse/tendermint that referenced this pull request Jun 5, 2019
If we are low on addresses for peering, we need to discover more peers. The
previous behavior would query existing peers; however, if an existing peer
does not participate in peer exchange, then our node will not discover more peers.

This change consults both existing peers as well as seeds when there is a deficit
in address book addresses. This allows for discovering peers though existing channels
as well as via seeds if existing peers do not share addresses.
brapse pushed a commit to brapse/tendermint that referenced this pull request Jun 5, 2019
* p2p: merge switch cases

also improve the error msg in privval

* pex: refactor code plus update specification

follow-up to tendermint#3603

* Update docs/spec/reactors/pex/pex.md

Co-Authored-By: melekes <anton.kalyaev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants