Skip to content

V0.31#3553

Merged
ebuchman merged 15 commits intomasterfrom
v0.31
Apr 15, 2019
Merged

V0.31#3553
ebuchman merged 15 commits intomasterfrom
v0.31

Conversation

@ebuchman
Copy link
Contributor

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

ebuchman and others added 15 commits April 1, 2019 14:17
Merge v0.31.2 release back to develop
Merge V0.31.3 back to develop
ListOfKnownAddresses is removed
panic if addrbook size is less than zero
CrawlPeers does not attempt to connect to existing or peers we're currently dialing
various perf. fixes
improved tests (though not complete)
move IsDialingOrExistingAddress check into DialPeerWithAddress (Fixes #2716)


* addrbook: preallocate memory when saving addrbook to file

* addrbook: remove oldestFirst struct and check for ID

* oldestFirst replaced with sort.Slice
* ID is now mandatory, so no need to check

* addrbook: remove ListOfKnownAddresses

GetSelection is used instead in seed mode.

* addrbook: panic if size is less than 0

* rewrite addrbook#saveToFile to not use a counter

* test AttemptDisconnects func

* move IsDialingOrExistingAddress check into DialPeerWithAddress

* save and cleanup crawl peer data

* get rid of DefaultSeedDisconnectWaitPeriod

* make linter happy

* fix TestPEXReactorSeedMode

* fix comment

* add a changelog entry

* Apply suggestions from code review

Co-Authored-By: melekes <anton.kalyaev@gmail.com>

* rename ErrDialingOrExistingAddress to ErrCurrentlyDialingOrExistingAddress

* lowercase errors

* do not persist seed data

pros:
- no extra files
- less IO

cons:
- if the node crashes, seed might crawl a peer too soon

* fixes after Ethan's review

* add a changelog entry

* we should only consult Switch about peers

checking addrbook size does not make sense since only PEX reactor uses
it for dialing peers!

#3011 (comment)
It's not proposer local time anymore, but a weighted median

Fixes #3514
* add actionable advice for ErrAddrBookNonRoutable err

Should replace #3463

* reorder checks in addrbook#addAddress so

ErrAddrBookPrivate is returned first

and do not log error in DialPeersAsync if the address is private
because it's not an error
* add missing changelog entry
* rpc: store validator info periodly

* increase ValidatorSetStoreInterval

also

- unexpose it
- add a comment
- refactor code
- add a benchmark, which shows that 100000 results in ~ 100ms to get 100
validators

* make the change non-breaking

* expand comment

* rename valSetStoreInterval to valSetCheckpointInterval

* change the panic msg

* add a test and changelog entry

* update changelog entry

* update changelog entry

* add a link to PR

* fix test

* Update CHANGELOG_PENDING.md

Co-Authored-By: melekes <anton.kalyaev@gmail.com>

* update comment

* use MaxInt64 func
A prior change to address accidental DNS lookups introduced the
SocketAddr on peer, which was then used to add it to the addressbook.
Which in turn swallowed the self reported port of the peer, which is
important on a reconnect. This change revives the NetAddress on NodeInfo
which the Peer carries, but now returns an error to avoid nil
dereferencing another issue observed in the past. Additionally we could
potentially address #3532, yet the original problem statemenf of that
issue stands.

As a drive-by optimisation `MarkAsGood` now takes only a `p2p.ID` which
makes it interface a bit stricter and leaner.
* [adr] ADR 037: Peer Behaviour inital draft
* Update docs/architecture/adr-037-peer-behaviour.md

Co-Authored-By: brapse <brapse@gmail.com>

* Update docs/architecture/adr-037-peer-behaviour.md
Co-Authored-By: brapse <brapse@gmail.com>

* [docs] adr-037 Better footnote styling
* [ADR] ADR-037 adjust Footnotes for github markdown
* [ADR] ADR-037 fix numbered list
Fix some typos in p2p/transport.go
 - prep changelog
 - add missing changelog entries
 - fix minor glitch in existing changelog (v0.31.2)
 - bump versions
- mention ADR in release summary
 - remove [p2p] api changes
 - amend v0.31.3 log to contain note about breaking change
@ebuchman ebuchman requested review from melekes and xla as code owners April 12, 2019 14:56
@codecov-io
Copy link

Codecov Report

Merging #3553 into master will increase coverage by 0.11%.
The diff coverage is 39.47%.

@@            Coverage Diff             @@
##           master    #3553      +/-   ##
==========================================
+ Coverage   64.17%   64.28%   +0.11%     
==========================================
  Files         213      213              
  Lines       17369    17374       +5     
==========================================
+ Hits        11146    11169      +23     
+ Misses       5299     5286      -13     
+ Partials      924      919       -5
Impacted Files Coverage Δ
p2p/pex/known_address.go 52.94% <ø> (-7.06%) ⬇️
p2p/errors.go 15.25% <0%> (-0.54%) ⬇️
p2p/switch.go 64.06% <0%> (-1.23%) ⬇️
p2p/test_util.go 63.97% <0%> (ø) ⬆️
p2p/pex/errors.go 11.11% <0%> (-3.18%) ⬇️
p2p/node_info.go 76.38% <0%> (+5.87%) ⬆️
node/node.go 63.88% <100%> (+0.07%) ⬆️
p2p/pex/file.go 78.04% <100%> (ø) ⬆️
p2p/pex/addrbook.go 67% <37.5%> (-0.41%) ⬇️
state/store.go 69.17% <43.75%> (-0.11%) ⬇️
... and 11 more

@ebuchman ebuchman merged commit 1c6d9d2 into master Apr 15, 2019
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.

8 participants