Open phbnf opened 2 months ago
I'll just float an in-between option:
CreateCheckpoint()
I'm not in love with this option, but it avoids the personality needing to own the write logic for checkpoints (option 1), and it avoids business policy logic needing to find its way into Tessera (option 2).
I'm not a fan of these options as they stand:
Breaks the division of responsibilities between Tessera and the personality (Tessera owns the checkpoint
resource) and is a layering violation (personalities should not have to know details of how writes are accomplished in the relevant Tessera storage backend).
As you say, this pushes complexity into Tessera which shouldn't be there as it's a CT thing.
Another option could be to expose method which personalities can use to request a new checkpoint to be generated. e.g. Integrate(alwaysWriteCP bool)
which triggers an immediate integration (rather than waiting for the next scheduled one), and passing true
requests that a new checkpoint is written even if the tree doesn't grow as a result of the integrate.
@mhutchinson : Do you mean exposing this as a Tessera API on top of Add()
? Why would we want to export this method for all clients, if the only use case is CT?
Option 1 makes the checkpoint update logic very complicated to handle the race condition. A wild idea is to separate the personality checkpoint and the tessera checkpoint, so you don't have to worry about the race condition but it is very likely to have some delay and consistency issue.
Option 2 may work if there are more personalities use cases.
Option 3 and 4 look pretty similar to expose a new method (with or without integration). They're reasonable to me.
I don't have a better suggestion at the moment. Reusing the storage.Add()
to pass an empty entry is possible if we don't want to introduce/expose a new method. However, it overloads the method with too many logic.
Towards #88
CT checkpoints contain a timestamp, used amongst other things, to measure CT logs MMD. That means that a checkpoint needs to be updated every X amount of time, irregardless of whether or not new entries have been integrated.
Today, Tessera only updates checkpoints (with a new timestamp) when new entries are integrated. We need a new mechanism to allow CT logs to update their checkpoints, even if no new entries have been integrated.
Option 1: Support this in personalities only, with a fully decoupled checkpoint writer.
Option 2: Support this as a Tessera option
Tessera's Alpha release will support CT on AWS and GCP, both of which use buckety storage systems, and allow for preconditions (as of a few days for AWS! https://aws.amazon.com/about-aws/whats-new/2024/08/amazon-s3-conditional-writes/). So option 1 should be enough to start with. But given the known limitations, we might as well go for option 2 directly?
I'm happy to work on either implementation, but I'm interested to know what others think about this.