Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev Docs: Document Blocks-First IBD & Orphan Blocks #685

Merged
merged 2 commits into from
Feb 1, 2015

Conversation

harding
Copy link
Contributor

@harding harding commented Dec 18, 2014

Dev Docs: Document Blocks-First IBD & Orphan Blocks

Preview IBD section: http://dg0.dtrt.org/en/developer-guide#initial-block-download
Preview Orphan Blocks section: http://dg0.dtrt.org/en/developer-guide#orphan-blocks

This pull adds a new section about the Initial Block Download (IBD) method used in Bitcoin Core 0.9, which I've retroactively named blocks-first. It also adds a short section explaining the difference between orphan blocks and stale blocks. See the commit message for minor details.

This is a partial resubmission of closed pull #660 focusing only on the current IBD method. This keeps the text shorter and, hopefully, easier to review. I also think this version is much, much better---it includes nearly 100% rewritten text plus five new illustrations that didn't appear in the original pull. After we get this merged, I'll rewrite and resubmit the headers-first part of pull #660.

@harding
Copy link
Contributor Author

harding commented Jan 14, 2015

Rebased to fix merge conflicts.


It's important to headers-first nodes that the blocks be requested and
sent in order because each block header references the header hash of
the preceeding block. That means the IBD node can't fully validate a
Copy link
Contributor

Choose a reason for hiding this comment

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

@harding s/preceeding/preceding/

@ghost1542
Copy link
Contributor

@harding Thanks!! LGTM

This commit provides a detailed overview of the current block download
method, which I've retroactively named blocks-first for parallelism with
headers-first.

New And Significantly Revised:

* New Initial Block Download (IBD) section (h3) with Blocks-First
  subsection (h4)

* New Orphan Block subsection (under Blocks Broadcasting) describing
  orphan blocks and how they're handled under blocks-first. Also
  includes a simple illustration of the difference between orphan blocks
  and stale blocks. Thanks to luke-jr for his s/orphan block/stale
  block/ commit a couple months ago---that made this commit much easier.

Edits:

* Cleaned up a couple cases missed by previous s/orphan/stale/ commit
  because they used past tense (orphaned).

* In P2P reference section, mentioned that a `block` message can be sent
  unsolicited by miners.

* Mention that `getheaders` and `headers` were added in protocol
  version 31800.

* Moved a few internal links around and added a few new internal links.

Administrivia:

* Started adding "TODOv0.10" in HTML comments to places that need to be
  updated when 0.10 is released so that I can easily git grep for that
  tag later.
@harding
Copy link
Contributor Author

harding commented Jan 31, 2015

Rebased to fix merge conflicts and added commit 3109903 making the changes @saivann suggested. (Thanks!) Preview updated.

In the absence of critical feedback, this will be merged around 22:00 UTC Sunday.

@harding harding merged commit 3109903 into bitcoin-dot-org:master Feb 1, 2015
harding added a commit that referenced this pull request Feb 1, 2015
* 685: Dev Docs: Document Blocks-First IBD & Orphan Blocks
* 721: Dev Docs: Mention Upcoming v3 Blocks/BIP66
@harding harding deleted the ibd2 branch February 25, 2015 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants