handshake-org / handshake-org/hsd

spv: headers-first sync under checkpoints is unecessary

Open
#745 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.1k
Forks
306
PR merge metrics
No merged PRs in 30d

Description

When checkpoints are active, both full and spv nodes sync headers-first up to the last checkpoint, and then go back and request blocks. For full nodes, these blocks are not verified but applied to wallet, UTXO set and urkel tree. For SPV nodes, what we actually get are merkleblocks which are only applied to the wallet. This seems somewhat wasteful since headers-first sync and SPV merkleblock sync are basically the same thing. We can probably sync SPV a bit faster by requesting merkle blocks from the beginning. We can still check that checkpoint blocks are correct but there's no need to downlado 100,000 headers twice from the network

Contributor guide

Open the contributing guide

Research direction

Start by tracing the SPV checkpoint sync path and the existing headers-first and merkleblock requests. Done means SPV nodes request merkleblocks from the beginning while still checking checkpoint blocks, without downloading the same headers twice.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.