Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate storage implementations to Appender lifecycle model #482

Merged
merged 23 commits into from
Feb 13, 2025

Conversation

AlCutter
Copy link
Collaborator

@AlCutter AlCutter commented Feb 12, 2025

This PR moves all the of the storage implementations fully over to the lifecycle model introduced in #433.

The functionality related to managing an append-only log, which was previously present on the drivers themselves, is moved to a new Appender type. While there have been a few small refactors and tweaks to make the transition easier/cleaner, no functional changes in the way each of the drivers manages append-only logs is intended.

StorageOptions functionality has been moved into tessera and merged with the new appendOptions struct introduced in #443.

Towards #471 #472 #473 #474

lifecycle.go Outdated
Comment on lines 95 to 91
// NewCPFunc is the signature of a function which knows how to format and sign checkpoints.
type NewCPFunc func(size uint64, hash []byte) ([]byte, error)

// ParseCPFunc is the signature of a function which knows how to verify and parse checkpoints.
type ParseCPFunc func(raw []byte) (*f_log.Checkpoint, error)

// EntriesPathFunc is the signature of a function which knows how to format entry bundle paths.
type EntriesPathFunc func(n uint64, p uint8) string

// AppendOptions holds optional settings for all storage implementations.
type AppendOptions struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not immediately convinced that all of these need to be publicly exposed from the API?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've removed the func types for now, we can figure out whether/how to reintroduce in a less polluting way later on.

AppendOptions needs to be exported so that storage impls can accept it, but again I think we can return to this and see if there's a better way/place - the primary goal of this PR is just to get us over the mark of broadly adopting the lifecycle API changes as it's blocking other work.

@AlCutter AlCutter force-pushed the options_to_tessera branch 2 times, most recently from adced4d to c103690 Compare February 13, 2025 12:31
@AlCutter AlCutter changed the title Options to tessera Migrate storage implementations to Appender lifecycle model Feb 13, 2025
@AlCutter AlCutter force-pushed the options_to_tessera branch 6 times, most recently from 921ded2 to 467967e Compare February 13, 2025 13:34
@AlCutter AlCutter marked this pull request as ready for review February 13, 2025 13:47
@AlCutter AlCutter requested a review from a team as a code owner February 13, 2025 13:47
@AlCutter AlCutter requested a review from mhutchinson February 13, 2025 13:47
@AlCutter AlCutter added the enhancement New feature or request label Feb 13, 2025
@AlCutter AlCutter added this to the beta milestone Feb 13, 2025
lifecycle.go Outdated Show resolved Hide resolved
@AlCutter AlCutter merged commit 8c5dff7 into transparency-dev:main Feb 13, 2025
14 of 15 checks passed
@AlCutter AlCutter deleted the options_to_tessera branch February 13, 2025 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants