Extract log config package#573
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
roger2hk
approved these changes
Jul 1, 2026
| } | ||
| 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. |
Contributor
There was a problem hiding this comment.
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. |
| 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) |
Contributor
There was a problem hiding this comment.
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) | ||
| } |
Contributor
There was a problem hiding this comment.
A non-2xx status code doesn't cause an error. The handling is missing here as the resp.Body could be empty.
| } | ||
| if !foundHeader { | ||
| return nil, fmt.Errorf("invalid config, no 'logs/v0' header found") | ||
| } |
Contributor
There was a problem hiding this comment.
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
Contributor
Author
|
Added fixes for pre-existing issues. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR extracts the abstract log config and public witness network support from
omniwitnessin order to be reusable by other witness instances built from this repo.