Skip to content

publishCheckpoint returns the next publication time instead of the previous + nanoseconds for AWS#966

Merged
phbnf merged 2 commits into
transparency-dev:mainfrom
phbnf:refactor-pub-time
May 21, 2026
Merged

publishCheckpoint returns the next publication time instead of the previous + nanoseconds for AWS#966
phbnf merged 2 commits into
transparency-dev:mainfrom
phbnf:refactor-pub-time

Conversation

@phbnf
Copy link
Copy Markdown
Contributor

@phbnf phbnf commented May 21, 2026

Fixes #965.

This PR makes publishCheckpoint return the timestamp at which Tessera should try again to publish a checkpoint, instead of the last time that it successfully updated it. This allows better scheduling, especially when the tree doesn't grow.

While we're here, also make the AWS implementation store the last publication timestamp in nanoseconds rather than seconds, like other implementation. This allows for sub-second scheduling.

This PR adds some test (contrary to #940). It checks that:

  • the returned timestamps is always far enough in the future, but not too far away. Implementing tighter bounds is challenging.
  • adds a specific test for when minStaleRepub is set to 0.

@phbnf phbnf requested a review from AlCutter May 21, 2026 15:22
@phbnf phbnf requested a review from a team as a code owner May 21, 2026 15:22
Comment thread storage/aws/aws.go
var pubAt time.Time
// Tessera used to store publishedAt in seconds, and now stores it in nanoseconds.
// This handles the transition.
const nanosecondThreshold = 1_310_324_790_000
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe, nice :)

@phbnf phbnf merged commit ab720fc into transparency-dev:main May 21, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Too many checkpoint updates attempts when a tree isn't growing

2 participants