Skip to content

Commit

Permalink
Perform witness signing on checkpoints of the same size
Browse files Browse the repository at this point in the history
Removed a short circuit that previously skipped doing work if the tree at that size had previously been witnessed. Having fresh timestamps on checkpoints is a feature.
  • Loading branch information
mhutchinson committed Oct 16, 2024
1 parent c27809c commit 88e1846
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/witness/witness.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,8 @@ func (w *Witness) Update(ctx context.Context, logID string, nextRaw []byte, cPro
counterInconsistentCheckpoints.Inc(logID)
return prevRaw, status.Errorf(codes.FailedPrecondition, "checkpoint for same size log with differing hash (got %x, have %x)", next.Hash, prev.Hash)
}
// If it's identical to the previous one do nothing.
counterUpdateSuccess.Inc(logID)
return prevRaw, nil
// This used to short-circuit here to save work.
// However, having the most recently witnessed timestamp available is beneficial to demonstrate freshness.
}
if prev.Size == 0 {
// Checkpoints of size 0 are really placeholders and consistency proofs can't be performed.
Expand Down

0 comments on commit 88e1846

Please sign in to comment.