-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
blockchain: Implement header proof storage.
This modifies the chain logic to create and store the individual commitment hashes covered by the commitment root field of the header of each block and also adds code to migrate the database to retroactively create and store entries for all applicable historical blocks. The upgrade can be interrupted at any point and future invocations will resume from the point it was interrupted. The following is a high level overview of the changes: - Introduce a new database bucket to house the header commitments - Add serialization code for use when storing and loading the individual header commitment hashes - Add full test coverage for new serialization code - Store the commitment hashes in the db when connecting blocks - Implement database migration code to retroactively store the commitment hashes for all applicable historical blocks - Bump the chain database version to 13 - Support resuming from interrupted upgrades - Add a new func on the internal header commitment data struct that returns the v1 header commitment hashes to consolidate the logic - Update FilterByBlockHash to load the header commitments from the db and generate the inclusion proof accordingly
- Loading branch information
Showing
6 changed files
with
708 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.