Removal of witnesses is now recorded on a per-checkpoint
level, so that rewinding the tree state now restores any
witnesses that were removed since the checkpoint.
A number of internal consistency checks previously enforced
by the property tests have been removed as they did not
correctly implement this semantic, and reimplementing these
consistency checks would be equivalent to reimplementing the
sample tree, so these checks are now performed simply by
comparison against the reference implentation.
For some applications, it is not necessary to include the
full range of witnessing and checkpointing operations. The
Frontier trait captures the minimal operations required:
appending leaves to the tree and constructing the root
of the tree by hashing against empty nodes.
In this commit:
* TreeHasher is replaced by the Hashable trait. Hashable is
modified to use level information in the construction of
the hash, and a convenience method is provided for obtaining
the empty node at a given level.
* The pop_checkpoint method is removed from the `Tree` interface.
Instead, a maximum number of checkpoints is established at tree
construction time and then the oldest checkpoints are automatically
dropped when adding new checkpoints once that number is reached.
* The `witness` method implementation in the sample tree
is modified to ignore duplicate calls.
* Property testing functiona are modified to abstract over
the type of hashable data.