kaspad icon indicating copy to clipboard operation
kaspad copied to clipboard

Research the best way to utilize flyclient for pruning headers

Open someone235 opened this issue 3 years ago • 3 comments

someone235 avatar May 13 '21 08:05 someone235

Some thoughts on the subject: We can use flyclient to prune headers like this:

  1. Every time the pruning point (P) moves we can create a flyclient proof from the previous P to the new one and save it to disk.
  2. Delete all the headers of the pruned blocks.
  3. If a new node wants to IBD from scratch, we need to send it all of the proofs that were created since genesis.

IIRC flyclient proof contains log(n) headers, and the interval between pruning point (F) is currently 86400. It means that we'll need 17 headers per day, and the max header size is about 500 bytes, so it's ~3mb for year, and without pruning the headers they will take ~16gb per year. The main problem I see with this proposal is that we use flyclient in an irregular way, so SPV will still need to download O(n) headers instead of O(log n) with regular flyclient.

someone235 avatar May 13 '21 08:05 someone235

Should be closed, an alternative design is implemented (?)

hashdag avatar Jun 23 '21 18:06 hashdag

Not implemented yet, but we should implement this https://github.com/kaspanet/research/issues/3

someone235 avatar Jun 28 '21 08:06 someone235