Skip to content

Extract log config package#573

Merged
AlCutter merged 2 commits into
transparency-dev:mainfrom
AlCutter:extract_config
Jul 1, 2026
Merged

Extract log config package#573
AlCutter merged 2 commits into
transparency-dev:mainfrom
AlCutter:extract_config

Conversation

@AlCutter

@AlCutter AlCutter commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

This PR extracts the abstract log config and public witness network support from omniwitness in order to be reusable by other witness instances built from this repo.

@codecov-commenter

codecov-commenter commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 51.12782% with 65 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.18%. Comparing base (1350e9a) to head (2291b3b).

Files with missing lines Patch % Lines
config/public_witness_network.go 57.47% 28 Missing and 9 partials ⚠️
persistence/spanner/persistence.go 30.76% 9 Missing ⚠️
persistence/sqlite/sql.go 50.00% 6 Missing ⚠️
persistence/inmemory/inmemory.go 28.57% 5 Missing ⚠️
omniwitness/configs.go 66.66% 2 Missing ⚠️
omniwitness/omniwitness.go 0.00% 2 Missing ⚠️
omniwitness/public_witness_network.go 0.00% 2 Missing ⚠️
cmd/omniwitness/monolith.go 0.00% 1 Missing ⚠️
cmd/omniwitness_gcp/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #573      +/-   ##
==========================================
- Coverage   25.19%   25.18%   -0.02%     
==========================================
  Files          27       28       +1     
  Lines        2040     2045       +5     
==========================================
+ Hits          514      515       +1     
- Misses       1414     1417       +3     
- Partials      112      113       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread config/public_witness_network.go Outdated
}
candidate.Origin = strings.TrimSpace(bits[1])
case "qpd":
// qpd is the number of queries the log is permitted to send to the witness per dat.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// qpd is the number of queries the log is permitted to send to the witness per dat.
// qpd is the number of queries the log is permitted to send to the witness per day.

Comment thread config/public_witness_network.go Outdated
v := strings.TrimSpace(bits[1])
qpd, err := strconv.ParseFloat(v, 64)
if err != nil {
return nil, fmt.Errorf("invalid qps value %q: %v", v, err)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
return nil, fmt.Errorf("invalid qps value %q: %v", v, err)
return nil, fmt.Errorf("invalid qpd value %q: %v", v, err)

Should it be QPD instead of QPS?

Comment on lines +49 to +52
resp, err := opts.Client.Do(req)
if err != nil {
return nil, fmt.Errorf("http.Do: %w", err)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A non-2xx status code doesn't cause an error. The handling is missing here as the resp.Body could be empty.

https://pkg.go.dev/net/http#Client.Do

}
if !foundHeader {
return nil, fmt.Errorf("invalid config, no 'logs/v0' header found")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

foundHeader is true even the logs/v0 is not placed at the top line.

https://github.com/transparency-dev/witness-network/blob/main/log-list-format.md

@AlCutter

AlCutter commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Added fixes for pre-existing issues.

@AlCutter AlCutter merged commit 54dbcdd into transparency-dev:main Jul 1, 2026
14 checks passed
@AlCutter AlCutter deleted the extract_config branch July 1, 2026 14:56
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