mtca: Serve checkpoints after sequencing and signing - #8974
mtca: Serve checkpoints after sequencing and signing#8974beautifulentropy wants to merge 3 commits into
Conversation
|
@beautifulentropy, this PR appears to contain configuration and/or SQL schema changes. Please ensure that a corresponding deployment ticket has been filed with the new values. |
aarongable
left a comment
There was a problem hiding this comment.
LGTM with nits, modulo upstream PR being updated for tests to pass.
|
Could you fill out the PR description? Also, a PR naming nit: CQRP refers to "Chrome's Landmark Service", not "CQRP Landmark Service." But I think it would be simplest to say "mtca: serve checkpoints with 2 cosignatures," and mention in the description that this is a requirement of the CQRP. https://googlechrome.github.io/chromerootprogram/cqrp/draft-policy/ |
79101b0 to
d6c1da1
Compare
d6c1da1 to
108e240
Compare
57e86fa to
f3b8801
Compare
f3b8801 to
ec16d7a
Compare
| // PutObject fails with 412 Precondition Failed when IfNoneMatch is set and the | ||
| // key exists, or when IfMatch does not match the stored ETag. GetObject fails | ||
| // with 404 Not Found for a missing key. |
There was a problem hiding this comment.
I'd put these comments on PutObject and GetObject directly, since they're lacking doc comments.
| if err != nil { | ||
| return fmt.Errorf("checkpoint of tree size %d MTCA signature: %s", tree.N, err) | ||
| } | ||
| // Produce a signed note containing the MTCA's cosignature line. |
There was a problem hiding this comment.
nit: I've resisted commenting about having a blank line after every error-handling stanza because we don't have an official stance on that style, but I think we'd all agree that there should be a blank line before section-header comments.
| // Produce a signed note containing the MTCA's cosignature line. | |
| // Produce a signed note containing the MTCA's cosignature line. |
| func (m *mtca) writeCheckpoint(ctx context.Context, signedNote []byte, prevETag *string) (*string, error) { | ||
| bucket := m.s3c.Bucket() | ||
| key := path.Join(m.logID.TilePrefix(), "checkpoint") | ||
| if prevETag == nil { |
There was a problem hiding this comment.
My preference would be for the previous etag to be non-optional. That just means that the CA should read the current checkpoint file during startup, so it's initialized before the first call to writeCheckpoint.
Cleanup:
Closes #9004