Repository navigation
Enforce C2SP decimal integer rules and bounds across parsers - #293
Open
mhutchinson wants to merge 1 commit into
Open
mhutchinson wants to merge 1 commit into
mhutchinson wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #293 +/- ##
==========================================
+ Coverage 82.57% 90.44% +7.87%
==========================================
Files 5 10 +5
Lines 241 1057 +816
==========================================
+ Hits 199 956 +757
- Misses 30 101 +71
+ Partials 12 0 -12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
C2SP specs (tlog-proof@v1, tlog-checkpoint, tlog-cosignature, and tlog-policy) define decimal integers as base-10 representations without leading zeros (except for 0 itself), with tlog-proof leaf indices bounded to 0..2^63-1 and tlog-policy group thresholds bounded to 1..n (with n >= 1).
Previously:
- proof.TLogProof.Unmarshal used strconv.ParseUint(idxStr, 10, 64), accepting leading zeros (e.g. 007) and indices >= 2^63.
- log.Checkpoint.Unmarshal and note.formatRFC6962STH accepted leading zeros on the checkpoint tree size line.
- policy.TLogPolicy.Unmarshal and witness.ParsePolicy accepted leading zeros on numeric group thresholds.
- witness.ParsePolicy accepted group thresholds of 0 and groups with 0 members, producing a Group{N: 0} that trivially satisfied any checkpoint.
Reject leading zeros across all decimal integer parsers, bound tlog-proof leaf indices to 63 bits, and require group thresholds in witness.ParsePolicy to satisfy 1 <= k <= n with at least one member.
mhutchinson
force-pushed
the
strict-decimal-int
branch
from
November 4, 2026 11:39
3bd42fc to
6818d47
Compare
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.
C2SP specs (tlog-proof@v1, tlog-checkpoint, tlog-cosignature, and tlog-policy) define decimal integers as base-10 representations without leading zeros (except for 0 itself), with tlog-proof leaf indices bounded to 0..2^63-1 and tlog-policy group thresholds bounded to 1..n (with n >= 1).
Previously:
Reject leading zeros across all decimal integer parsers, bound tlog-proof leaf indices to 63 bits, and require group thresholds in witness.ParsePolicy to satisfy 1 <= k <= n with at least one member.