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

Sync traffic optimization #3477

Merged
merged 2 commits into from
Nov 17, 2016
Merged

Sync traffic optimization #3477

merged 2 commits into from
Nov 17, 2016

Conversation

arkpar
Copy link
Collaborator

@arkpar arkpar commented Nov 16, 2016

  • Prevent downloading subchain headers from all available peers.
  • Abort pending download requests properly.

@arkpar arkpar added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Nov 16, 2016
@arkpar arkpar changed the title Sync bandwidth optimization Sync traffic optimization Nov 16, 2016
@gavofyork
Copy link
Contributor

would be nice to comprehend this PR a bit. maybe elaborate on the additional state (what does it mean? when should they be in particular configurations? how does the new state relate to existing state? are there any invalid combinations?) and logic (why is the state being changed in the way it is? is there anything special about the condition that makes this state change valid now? what kind of post-conditions are being achieved?).

@arkpar
Copy link
Collaborator Author

arkpar commented Nov 17, 2016

There is no new state or state change introduced here.
There are 3 major changes here:

  1. Additional validation for incoming headers. When we get a collection of subchain headers we check that at least one of them is known before inserting to H
  2. Request subchain header from at most 5 peers.
  3. When block downloader moves from downloading subchain heads to blocks all outstanding downloads are marked as expired.

So the state changes are:

  1. There can be no more than 5 peers downloading subchain heads. The rationale is to save traffic.

@gavofyork
Copy link
Contributor

gitlab CI fails build.

@gavofyork gavofyork added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Nov 17, 2016
@gavofyork gavofyork merged commit 2532b15 into master Nov 17, 2016
@gavofyork gavofyork deleted the sync-opt branch November 17, 2016 13:53
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. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants