Skip to content

Support for a partial chain

Thomas Blanc requested to merge partial_master into master

This MR attempts to solve item 2 of #339 (closed).

It edits the predecessor access functions in module State so as to handle the possibility that a block may be known and validated without it having its predecessor in the database.

It also creates the prune, delete and purge function.

  • prune store hash removes most information about a block, leaving only its header information. Blocks within max_operation_ttl of a block you would want to validate on must have this data.
  • delete store hash removes all information from a block.
  • purge chain hashfirst prunes all block information, starting from the block b referenced by the hash down to the one indexed by min(max_op_ttl(b), level(b)) before b. Then it deletes all block information from the predecessor of this block down to the end of the chain.

Note that as of right now, the context information is not deleted from the database. This shall be done when item 3 of #339 (closed) is completed.

Potential problem: the logarithmic predecessor lookup has not been changed.

Edited by Paul Laforgue

Merge request reports