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 C2SP compliance and simplify #325

Merged

Conversation

AlCutter
Copy link
Contributor

@AlCutter AlCutter commented Jan 28, 2025

This PR is a deeper fix to the C2SP tlog-witness compliance issues, which changes the internal witness API to better match.

Also removes the call to Update exposed via the local HTTP server.

TODO(al): Either in here, or in a follow-up, make Update just return the sig rather than the whole CP.

@AlCutter AlCutter requested a review from mhutchinson January 28, 2025 11:13
@AlCutter AlCutter force-pushed the fix_witness_c2sp_spec_in_witness_api branch from a5214d1 to 237fcdd Compare January 28, 2025 11:14
@codecov-commenter
Copy link

codecov-commenter commented Jan 28, 2025

Codecov Report

Attention: Patch coverage is 42.30769% with 45 lines in your changes missing coverage. Please review.

Project coverage is 23.10%. Comparing base (3c58af4) to head (5b1b9d4).
Report is 154 commits behind head on main.

Files with missing lines Patch % Lines
internal/feeder/bastion/bastion_feeder.go 50.00% 20 Missing and 1 partial ⚠️
internal/witness/witness.go 40.00% 17 Missing and 1 partial ⚠️
internal/feeder/feeder.go 0.00% 0 Missing and 2 partials ⚠️
omniwitness/omniwitness.go 0.00% 2 Missing ⚠️
cmd/feedbastion/main.go 0.00% 1 Missing ⚠️
internal/http/server.go 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (3c58af4) and HEAD (5b1b9d4). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (3c58af4) HEAD (5b1b9d4)
4 2
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #325       +/-   ##
===========================================
- Coverage   51.05%   23.10%   -27.95%     
===========================================
  Files          11       25       +14     
  Lines         903     1878      +975     
===========================================
- Hits          461      434       -27     
- Misses        374     1366      +992     
- Partials       68       78       +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AlCutter AlCutter changed the title Fix witness c2sp spec in witness api Fix C2SP compliance and simplify Jan 28, 2025
@AlCutter AlCutter force-pushed the fix_witness_c2sp_spec_in_witness_api branch from 52ea9cd to b84d22a Compare January 28, 2025 11:24
internal/feeder/bastion/bastion_feeder.go Outdated Show resolved Hide resolved
w.Header().Add("Content-Type", "text/x.tlog.size")
}
w.WriteHeader(sc)
if len(body) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor consistency nit: here you use len(x) > 0 but above you do x != "". Can we pick one style of empty checking?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sadly not: body is a []byte, so we're stuck with len here, but for strings != "" is the more "idiomatic"/concise way.

internal/witness/witness.go Outdated Show resolved Hide resolved
@AlCutter AlCutter force-pushed the fix_witness_c2sp_spec_in_witness_api branch from 568ef3c to 5b1b9d4 Compare January 30, 2025 10:43
@AlCutter AlCutter merged commit c194621 into transparency-dev:main Jan 30, 2025
6 checks passed
@AlCutter AlCutter deleted the fix_witness_c2sp_spec_in_witness_api branch January 30, 2025 13:24
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.

3 participants