nervosnetwork / ckb

The Nervos CKB is a public permissionless blockchain, and the layer 1 of Nervos network.
https://www.nervos.org
MIT License
1.16k stars 228 forks source link

Cache header validation point (in case of crash) #4518

Open Matt-RUN-CKB opened 3 months ago

Matt-RUN-CKB commented 3 months ago

Feature Request

Is your feature request related to a problem? Please describe.

When using CKB with assume_valid, currently the header verification always starts at block 0. In the case of a crash, header validation begins at block 0 again

Describe the solution you'd like

While header validation is ongoing, cache in the ckb node the latest header that has been verified, so in the case of a crash the node can start at the latest point

eval-exec commented 3 months ago

Great idea! As the number of blocks increases, the time consumed by Header Sync is also increasing significantly. CKB is planning to use the Light Client protocol to replace the Header Sync process to address this issue.