[WIP] feat: assume-valid swift sync#837
[WIP] feat: assume-valid swift sync#837JoseSK999 wants to merge 3 commits intogetfloresta:masterfrom
Conversation
HTTPS*. HTTP will return a 301 |
|
Fixed an error with our inflight requests: we must not drop any of them before completion, even if |
|
I've added a little log to see how many inflights we have on average, and it's a sound 200 (the maximum we can have). At least on my not-that-great countryside internet, I'm basically limited by my bandwidth (it's as fast as I can download it). The next step is to improve our peer selection code to only keep fast peers during swiftsync |
|
I've increased the max Another thing we can do is a dynamic algorithm to pick a optimal max requests Edit: This is signet, from the network. |
|
That’s nice. Since we process blocks very fast, with any arrival order, we only keep them in memory for a few milliseconds at most. So we can in theory be more aggressive with |
|
The average for this is ~3.5k inflight blocks. It almost never maxes out |
|
@JoseSK999 can you please rebase this with the latest changes in #836? I want to profile this |
816a117 to
1e42b0a
Compare
|
Rebased with the new |
|
I noticed that the node will start to download filters after SwiftSync is done, even though IBD is not finished. |
|
Yeah because we first need to implement a way to construct the utreexo acc while in SwiftSync. This PR currently only showcases pure SwiftSync: we could in theory save the UTXOs in a db, but Floresta needs utreexo to continue validating. |
07d4f86 to
c65c396
Compare
|
Incorporated the changes from #847, so we do header-chain selection properly |
14c49a9 to
17f0005
Compare
17f0005 to
9a526c0
Compare
feat: avoid computing `txids` twice Implement a `Consensus::check_merkle_root`, which follows the same logic as the original `rust-bitcoin` method, except we return the computed `txid` list. This is useful for when SwiftSync builds the `OutPoints`, which avoids recomputing the `txid`.
9a526c0 to
4d08ce1
Compare
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.