Skip to content

Conversation

@rustaceanrob
Copy link
Collaborator

@rustaceanrob rustaceanrob commented Aug 15, 2025

Here I introduce a crate that ties together all of the component crates. node/bin/ibd.rs performs a fast IBD on Signet using an (unoptimized) hintfile. Blocks are written to a blockfile directory as individual files, simply serializing the block to a vector of bytes. The number of connections is defined as a TASKS constant within ibd.rs. The bitcoinkernel project is used to pre-sync the block headers to the given stop hash, and to later reference these block hashes by their height. The lib.rs contains must of the individual task logic, while ibd.rs drives the control flow by reading in the hint file, creating the ChainStateManager, and spawning the appropriate tasks. Of note, the OutPoint are hashed on each individual OS thread, while the accumulator state is updated with these 32 byte arrays.

To run it:

just ibd

Will start the program, assuming a bitcoin.hints is in the node directory.

To run it again

just delete

Delete the chainstate and block files to run it again.

Follow ups:
Allow the justfile commands to take arguments for where blocks are stored, where the hintfile is located, and the number of parallel tasks.

OS file limits were reached at 1024 tasks
@rustaceanrob rustaceanrob marked this pull request as ready for review August 17, 2025 09:22
@rustaceanrob rustaceanrob merged commit 2b8bc66 into 2140-dev:master Aug 17, 2025
4 checks passed
@rustaceanrob rustaceanrob deleted the 8-15-client-bin branch August 17, 2025 09:34
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.

1 participant