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

Do not drop the peer with None difficulty #10772

Merged
merged 2 commits into from Jun 27, 2019
Merged

Do not drop the peer with None difficulty #10772

merged 2 commits into from Jun 27, 2019

Conversation

grbIzl
Copy link
Collaborator

@grbIzl grbIzl commented Jun 24, 2019

Several issues about archive nodes behavior were created with similar description: archive node starts loosing peers and stops sync. Sometimes the sync is restored after some period, sometimes no.
See: #10724 #10763 #10626

The analysis shows one suspicious place, that leads to loosing peers (cut from the logs follows):
...
2019-06-24 06:27:03 IO Worker #1 TRACE sync Skipping peer 312, force=false, td=Some(10728254029006356954158), our td=10728254029006356954158, state=Idle
...
2019-06-24 06:27:04 IO Worker #0 DEBUG sync 312 -> Dispatching packet: 1
2019-06-24 06:27:04 IO Worker #0 TRACE sync 312 -> NewHashes (1 entries)
2019-06-24 06:27:04 IO Worker #0 TRACE sync New hash block already queued 0xef843f3c9be62b47228ae6b7819713117e3449dbdf73f8e644e057fe420fe289
2019-06-24 06:27:04 IO Worker #0 TRACE sync Considering peer 312, force=false, td=None, our td=10728254029006356954158, latest=0xef84…e289, have_latest=true, state=Idle
2019-06-24 06:27:04 IO Worker #0 TRACE sync peer 312 is not suitable for requesting old blocks, syncing_difficulty=10728254029006356954158, peer_difficulty=None
2019-06-24 06:27:04 IO Worker #0 TRACE sync Deactivating peer 312
....

As you can see, the peer 312 was deactivated because its difficulty was defined as None. From my point of view it's an erroneous decision and this peer should be treated as legit. For example, compare this logic to the same several LOCs before: https://github.com/paritytech/parity-ethereum/blob/master/ethcore/sync/src/chain/mod.rs#L963

@grbIzl grbIzl requested a review from ascjones June 24, 2019 13:13
@grbIzl grbIzl added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Jun 24, 2019
@dvdplm dvdplm requested a review from seunlanlege June 24, 2019 14:13
Copy link
Contributor

@ascjones ascjones left a comment

Choose a reason for hiding this comment

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

I believe this is okay, though I would like a warp sync + ancient blocks to be run to check there is no regression to getting stuck on a "bad" block, which was fixed by #9753.

@grbIzl
Copy link
Collaborator Author

grbIzl commented Jun 25, 2019

I believe this is okay, though I would like a warp sync + ancient blocks to be run to check there is no regression to getting stuck on a "bad" block, which was fixed by #9753.

I've looked through the fix #9753 and it seems to be not affected by this change. You can find the log of running node with this fix in this comment: #10724 (comment)

@ordian ordian added this to the 2.6 milestone Jun 25, 2019
@ordian ordian added A7-looksgoodtestsfail 🤖 Pull request is reviewed well, but cannot be merged due to tests failing. A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. A7-looksgoodtestsfail 🤖 Pull request is reviewed well, but cannot be merged due to tests failing. labels Jun 25, 2019
@ordian ordian merged commit 59f0eb7 into master Jun 27, 2019
@ordian ordian deleted the ArchiveNodePeersDrop branch June 27, 2019 15:45
@ordian ordian added B0-patch-stable 🕷 Pull request should also be back-ported to the stable branch. B1-patch-beta 🕷🕷 labels Jun 27, 2019
dvdplm added a commit that referenced this pull request Jun 28, 2019
…ckChain

* master:
  revert changes to .gitlab-ci.yml (#10807)
  Add filtering capability to `parity_pendingTransactions` (issue 8269) (#10506)
  removed EthEngine alias (#10805)
  wait a bit longer in should_check_status_of_request_when_its_resolved (#10808)
  Do not drop the peer with None difficulty (#10772)
  ethcore-bloom-journal updated to 2018 (#10804)
  ethcore-light uses bincode 1.1 (#10798)
  Fix a few typos and unused warnings. (#10803)
  updated project to ansi_term 0.11 (#10799)
  added new ropsten-bootnode and removed old one (#10794)
  updated price-info to edition 2018 (#10801)
  ethcore-network-devp2p uses igd 0.9 (#10797)
  updated parity-local-store to edition 2018 and removed redundant Error type (#10800)
dvdplm added a commit that referenced this pull request Jul 1, 2019
…me-parent

* master: (24 commits)
  cargo update -p smallvec (#10822)
  replace memzero with zeroize crate (#10816)
  Don't repeat the logic from Default impl (#10813)
  removed additional_params method (#10818)
  Add Constantinople eips to the dev (instant_seal) config (#10809)
  removed redundant fmt::Display implementations (#10806)
  revert changes to .gitlab-ci.yml (#10807)
  Add filtering capability to `parity_pendingTransactions` (issue 8269) (#10506)
  removed EthEngine alias (#10805)
  wait a bit longer in should_check_status_of_request_when_its_resolved (#10808)
  Do not drop the peer with None difficulty (#10772)
  ethcore-bloom-journal updated to 2018 (#10804)
  ethcore-light uses bincode 1.1 (#10798)
  Fix a few typos and unused warnings. (#10803)
  updated project to ansi_term 0.11 (#10799)
  added new ropsten-bootnode and removed old one (#10794)
  updated price-info to edition 2018 (#10801)
  ethcore-network-devp2p uses igd 0.9 (#10797)
  updated parity-local-store to edition 2018 and removed redundant Error type (#10800)
  Cleanup unused vm dependencies (#10787)
  ...
dvdplm added a commit that referenced this pull request Jul 3, 2019
* master: (22 commits)
  ethcore does not use byteorder (#10829)
  Better logging when backfilling ancient blocks fail (#10796)
  depends: Update wordlist to v1.3 (#10823)
  cargo update -p smallvec (#10822)
  replace memzero with zeroize crate (#10816)
  Don't repeat the logic from Default impl (#10813)
  removed additional_params method (#10818)
  Add Constantinople eips to the dev (instant_seal) config (#10809)
  removed redundant fmt::Display implementations (#10806)
  revert changes to .gitlab-ci.yml (#10807)
  Add filtering capability to `parity_pendingTransactions` (issue 8269) (#10506)
  removed EthEngine alias (#10805)
  wait a bit longer in should_check_status_of_request_when_its_resolved (#10808)
  Do not drop the peer with None difficulty (#10772)
  ethcore-bloom-journal updated to 2018 (#10804)
  ethcore-light uses bincode 1.1 (#10798)
  Fix a few typos and unused warnings. (#10803)
  updated project to ansi_term 0.11 (#10799)
  added new ropsten-bootnode and removed old one (#10794)
  updated price-info to edition 2018 (#10801)
  ...
s3krit pushed a commit that referenced this pull request Aug 12, 2019
* Treat peer with None difficulty as legit

* Temporarily enable release binary build - REMOVE BEFORE MERGE
@s3krit s3krit mentioned this pull request Aug 12, 2019
s3krit added a commit that referenced this pull request Aug 12, 2019
  -  Fix cargo audit (#10921)
  - Add support for Energy Web Foundation's new chains (#10957)
  - Kaspersky AV whitelisting (#10919)
  - Avast whitelist script (#10900)
  - Docker images renaming (#10863)
  - Remove excessive warning (#10831)
  - Allow --nat extip:your.host.here.org (#10830)
  - When updating the client or when called from RPC, sleep should mean sleep (#10814)
  - added new ropsten-bootnode and removed old one (#10794)
  - ethkey no longer uses byteorder (#10786)
  - Do not drop the peer with None difficulty (#10772)
  - docs: Update Readme with TOC, Contributor Guideline. Update Cargo package descriptions (#10652)
@s3krit s3krit mentioned this pull request Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. B0-patch-stable 🕷 Pull request should also be back-ported to the stable branch. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants