[WIP] feat: assume-valid swift sync #837
Draft
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.
Description and Notes
This PR depends on #836
I've changed the
catch_upcontext so that yourflorestadstarts withSwiftSync. It will also request legacy blocks, so this runs witnessless, but just for testing purposes. A future PR should actually implement the witnessless version.Now, once your
florestadstarts, it will try to read the hints file from the samedatadiras your node uses. Default directory is.florestain the root for mainnet (and.floresta/signet, etc.). So you need to have the hints file there, namedsignet.hintsortestnet.hintsorbitcoin.hints.I got mine from the server hosted by 2140-dev:
NOTE: to run
florestadon mainnet you need to pass-- --no-assume-utreexo.So you paste the hints file in the
datadir, and thenflorestadwill be able to runSwifSync. Four things can happen:In the last three cases we abort SwiftSync and switch to
SyncNode. There is an integration test showing how we would react against an invalid block.If you finish SwiftSync you better stop the node because our acc is
Stump::new()and you reject blocks/proofs (TODO allow SwiftSync to build the accumulator). ALSO to run this a couple of times you will need to remove thechaindatafolder, so that it starts from 0 again.This should be >10x faster than
SyncNodefor IBD as we avoid the utreexo proof bottleneck. In my case it was ~12x faster.