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

fix: use entry uuid uniformly in return responses #1012

Merged
merged 1 commit into from Sep 2, 2022

Conversation

asraa
Copy link
Contributor

@asraa asraa commented Aug 29, 2022

Signed-off-by: Asra Ali asraa@google.com

Summary

Fixes #980

Release Note

Documentation

@priyawadhwa could you please take a look at sharding tests to make sure i didn't omit something purposely tested?

@asraa asraa requested a review from a team as a code owner August 29, 2022 19:44
@@ -96,6 +96,13 @@ func logEntryFromLeaf(ctx context.Context, signer signature.Signer, tc TrillianC
}

uuid := hex.EncodeToString(leaf.MerkleLeafHash)
activeTree := fmt.Sprintf("%x", tc.logID)
Copy link
Member

Choose a reason for hiding this comment

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

are we guaranteed to only be pulling from the activeTree?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm I assumed the passed tc was the one who's log ID would be matching, but I also see a tid parameter in this function.

Regardless, if the comment was just on naming, yes, i don't think this is always the active tree. will update

@asraa
Copy link
Contributor Author

asraa commented Aug 29, 2022

Trying to figure out the json end of line issue with attestations...

@asraa
Copy link
Contributor Author

asraa commented Aug 30, 2022

Fixed, it was an error handling mistake! I thought !errors.Is would only work on non-nil errors, which is stupid, because it's negated.

@asraa
Copy link
Contributor Author

asraa commented Aug 30, 2022

@lkatalin could i get your LGTM on this? I'm not sure if I'm breaking this comment. I'm allowing long EntryUUIDs to be passed in

// NOTE: This undoes the change that let people pass in longer UUIDs without
// trouble even if their client is old, a.k.a. it will be able to use the TreeID
// (if present) for routing in the GetLogEntryByUUIDHandler

@priyawadhwa
Copy link
Contributor

I'm not sure if I'm breaking this comment. I'm allowing long EntryUUIDs to be passed in

I think that comment addresses an earlier change in which EntryIDs would be shortened to UUIDs since they were unsupported. That should have been fixed in #671, so I think this change is safe.

This LGTM, think it just needs a rebase.

@asraa
Copy link
Contributor Author

asraa commented Sep 1, 2022

all set! (or I can ninja remove that comment since it seems to no longer apply?)

@priyawadhwa
Copy link
Contributor

or I can ninja remove that comment since it seems to no longer apply?

up to you! i'll lgtm for now & i can lgtm again if you want to remove it

priyawadhwa
priyawadhwa previously approved these changes Sep 1, 2022
Signed-off-by: Asra Ali <asraa@google.com>

update

Signed-off-by: Asra Ali <asraa@google.com>

update tree id

Signed-off-by: Asra Ali <asraa@google.com>

update

Signed-off-by: Asra Ali <asraa@google.com>

fix errors

Signed-off-by: Asra Ali <asraa@google.com>

update

Signed-off-by: Asra Ali <asraa@google.com>
@bobcallaway
Copy link
Member

this change lgtm, I wonder when/if it would be good to update openapi.yaml to only accept the full entryID (80 characters) instead of the 64 character leaf hash we started with.

@asraa
Copy link
Contributor Author

asraa commented Sep 2, 2022

this change lgtm, I wonder when/if it would be good to update openapi.yaml to only accept the full entryID (80 characters) instead of the 64 character leaf hash we started with.

I'll file a tracking issue for this for some discussion. i THINK people will either have the full entry UUID, OR they will be querying by proposed entry or log index, so i think it will be safe to start restricting but not sure.

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.

API: Always return EntryUUID (treeID+leafHash) in all responses
3 participants