Skip to content

Fix/improve bootstrapping, introduce "reckless" chainstate db mode.#2015

Merged
ImplOfAnImpl merged 11 commits intomasterfrom
improve_bootstrapping
Feb 24, 2026
Merged

Fix/improve bootstrapping, introduce "reckless" chainstate db mode.#2015
ImplOfAnImpl merged 11 commits intomasterfrom
improve_bootstrapping

Conversation

@ImplOfAnImpl
Copy link
Contributor

Bootstrapping was previously completely non-functional, because an attempt to import a bootstrap file would truncate it instead.
Also, it was slow, not really faster than a network sync (a lot of overhead was coming from the inefficiency of the file format itself).

So, in this PR:

  • The format of the bootstrap file was changed and the legacy one is no longer supported. This allowed to speed up the import.
  • The export speed was also improved, by directly fetching encoded blocks from the chainstate db, instead of decoding and re-encoding them again (though it was reasonably fast already).
  • During bootstrapping the node now responds to ctrl-c (previously it had to be killed to cancel it).
  • Importing can now also be done via node-daemon's command line (exporting is still done via RPC only). The option is called --import-bootstrap-file and it's a top-level option (i.e. it comes before the network type). I also made --clean-data a top-level option, for consistency and to be able to mark them as mutually exclusive.
  • A new option --enable-db-reckless-mode-in-ibd was added, which puts chainstate into a "reckless" mode during bootstrapping or IBD; this disables filesystem sync at each db transaction commit, which has the potential to corrupt the db on a system crash, but also makes bootstrapping several times faster.

@ImplOfAnImpl ImplOfAnImpl marked this pull request as ready for review February 18, 2026 10:43
@ImplOfAnImpl ImplOfAnImpl marked this pull request as draft February 18, 2026 12:31
@ImplOfAnImpl ImplOfAnImpl force-pushed the improve_bootstrapping branch 3 times, most recently from c538551 to 27b8ea4 Compare February 18, 2026 18:39
@ImplOfAnImpl ImplOfAnImpl marked this pull request as ready for review February 18, 2026 22:06
Base automatically changed from minor_improvements to master February 23, 2026 14:26
@ImplOfAnImpl ImplOfAnImpl merged commit ab9b551 into master Feb 24, 2026
20 checks passed
@ImplOfAnImpl ImplOfAnImpl deleted the improve_bootstrapping branch February 24, 2026 08:05
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.

2 participants