This repository has been archived by the owner on Dec 2, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VerifyStage: headers validation using preferified hashes.
The preverified hashes is a list of known precomputed hashes of every 192-th block in the chain: hash(0), hash(192), hash(384), hash(576), ... When we have a HeaderSlice and need to verify it, the algorithm verifies that the top of the slice matches one of the preverified hashes, and that all blocks down to the root of the slice are properly connected by the parent_hash field. For example, if we have a HeaderSlice[192...384] (with block headers from 192 to 384 inclusive), it verifies that: hash(slice[384]) == preverified hash(384) hash(slice[383]) == slice[384].parent_hash hash(slice[382]) == slice[383].parent_hash ... hash(slice[192]) == slice[193].parent_hash Thus verifying hashes of all the headers.
- Loading branch information