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

blockchain: Split block and header validation. #386

Merged
merged 1 commit into from
May 12, 2015

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Apr 20, 2015

This pull request refactors the consensus rule checks for block headers and blocks in the blockchain package into separate functions. These changes contain no modifications to consensus rules and the code still passes all block consensus tests. It is only a refactoring.

This is being done to help pave the way toward supporting concurrent downloads. While the package already supports headers-first mode up through the latest checkpoint through the use of the BFFastAdd flag and hard-coded checkpoints, it currently only works when downloading from a single peer. In order to support concurrent downloads from multiple peers, the ability for the caller to do things such as independently checking a block header (both context-free and full-context checks) will be needed.

There are several more changes that will be necessary to support concurrent downloads as well, such as making the package concurrent safe, modifying it to make use of the new database API, etc. Those changes are planned for future commits.

@jrick
Copy link
Member

jrick commented May 12, 2015

ok

This commit refactors the consensus rule checks for block headers and
blocks in the blockchain package into separate functions.  These changes
contain no modifications to consensus rules and the code still passes all
block consensus tests.  It is only a refactoring.

This is being done to help pave the way toward supporting concurrent
downloads.  While the package already supports headers-first mode up
through the latest checkpoint through the use of the BFFastAdd flag and
hard-coded checkpoints, it currently only works when downloading from a
single peer.  In order to support concurrent downloads from multiple
peers, the ability for the caller to do things such as independently
checking a block header (both context-free and full-context checks) will
be needed.

There are several more changes that will be necessary to support
concurrent downloads as well, such as making the package concurrent safe,
modifying it to make use of the new database API, etc.  Those changes are
planned for future commits.
@conformal-deploy conformal-deploy merged commit 19eae8d into btcsuite:master May 12, 2015
@davecgh davecgh deleted the chain_prep branch May 12, 2015 21:08
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.

3 participants