-
Notifications
You must be signed in to change notification settings - Fork 10
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
Make Fetcher
client function more flexible
#278
Comments
Hi @cmurphy, Thanks for taking the time to write this up! I think what we'll do near term is have each storage impl also provide an implementation of I understand your point about using the string containing the resource path being used here, and another way to think about it is that this string is essentially the Tessera public read API. The MySQL storage is unusual/unique in that it is the one storage infra which doesn't directly expose a filesystem-like view of that API based on resource path. What you're suggesting is adding a second semi-public/private read API for application developers because one of the storage types is a bit unusual - all others absolutely do use that resource path as their primary key equivalent. In that framing, it does feel reasonable to me that the burden of complying with that API should fall on the MySQL storage impl. Of course, we could think about having the I did hack up a quick experiment of what such a change might look like here: https://github.com/transparency-dev/trillian-tessera/compare/main...AlCutter:trillian-tessera:client_more_specific_fetch_interfaces_playground?expand=1 Separately, though, I think there would be value in taking a step back to think about what an "ideal" client package API might look like, both from Tessera log application developers and developers of clients of those log applications. |
Hi again, Thanks for your patience, I'm back after dealing with summit stuff and taking some vacation. I've been playing around with this quite a bit recently, trying a few things out to see how they feel - I'm warming up to your idea and I've merged #281, and that plus #292 adds add a more fine-grained set of read primitives to the storage contract and updates the How do those changes look from your PoV? |
In integrating Tessera into the Rekor log personality, we would like to have the Rekor server be able to return an inclusion proof to a client. In Tessera's model, this effectively makes Rekor its own client, since it needs to query its internal storage to fetch the tiles needed for the proof.
Tessera's
client.NewProofBuilder
constructor requires a function of typeFetcher
as input, which takes a path string as a parameter and returns a tile. This makes sense when the tile is stored in a posix-like file storage organized by directory paths. It makes less sense when using MySQL as the storage backend, and is awkward to use when the server has direct access to the MySQL storage provider instance.Consider the tile fetcher constructor:
trillian-tessera/client/client.go
Lines 272 to 286 in 0c3daf4
It takes the log size, tile level, and entry index to construct the tile path and then calls the fetcher function on that path to retrieve the tile from storage.
When using the MySQL storage instance directly, the path has no meaning. So to construct a proof builder, we have to deconstruct the path, reversing the work of the
newTileFetcher
:This works, it's just a bit strange and roundabout. It would be nice to be able to construct a proof builder that can work natively with any of the storage providers, or at least doesn't assume that the tile is indexed by its path.
The text was updated successfully, but these errors were encountered: