Create a fast IBD client #35
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here I introduce a crate that ties together all of the component crates.
node/bin/ibd.rsperforms a fast IBD on Signet using an (unoptimized) hintfile. Blocks are written to ablockfiledirectory as individual files, simply serializing the block to a vector of bytes. The number of connections is defined as aTASKSconstant withinibd.rs. Thebitcoinkernelproject is used to pre-sync the block headers to the given stop hash, and to later reference these block hashes by their height. Thelib.rscontains must of the individual task logic, whileibd.rsdrives the control flow by reading in the hint file, creating theChainStateManager, and spawning the appropriate tasks. Of note, theOutPointare hashed on each individual OS thread, while the accumulator state is updated with these 32 byte arrays.To run it:
Will start the program, assuming a
bitcoin.hintsis in thenodedirectory.To run it again
Delete the chainstate and block files to run it again.
Follow ups:
Allow the
justfilecommands to take arguments for where blocks are stored, where the hintfile is located, and the number of parallel tasks.