Skip to content

Generate subtree inclusion proofs with cmd/proofgen#238

Merged
phbnf merged 2 commits into
transparency-dev:mainfrom
phbnf:proofgensubtreeinclusion
Jun 22, 2026
Merged

Generate subtree inclusion proofs with cmd/proofgen#238
phbnf merged 2 commits into
transparency-dev:mainfrom
phbnf:proofgensubtreeinclusion

Conversation

@phbnf

@phbnf phbnf commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Towards #225.

This PR gives the ability to cmd/proofgen.go to generate testdata/subtreeinclusion json files, like it generates other testdata/ files.
I was not aware that this cmd was in this repo, and generated the proofs manually back then.

This is also a good opportunity to fix the description of some of these probes, which was erroneous.

@phbnf phbnf requested a review from AlCutter June 18, 2026 12:02
@phbnf phbnf requested a review from a team as a code owner June 18, 2026 12:02
@phbnf phbnf force-pushed the proofgensubtreeinclusion branch from f930be2 to bda39b0 Compare June 18, 2026 12:03
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 151 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.40%. Comparing base (2acfad1) to head (0e03927).

Files with missing lines Patch % Lines
cmd/proofgen/main.go 0.00% 151 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #238       +/-   ##
===========================================
- Coverage   58.55%   48.40%   -10.15%     
===========================================
  Files           8        8               
  Lines         649      785      +136     
===========================================
  Hits          380      380               
- Misses        261      397      +136     
  Partials        8        8               

☔ 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 cmd/proofgen/main.go Outdated
shift := bitCeil(p.End - p.Start)
desc := p.Desc + " - subtree"
leafIdx := p.LeafIdx
if leafIdx < ^uint64(0) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

math.MaxUint64 might be clearer?

But I'm also not super sure what this is guarding against, this condition is always true unless leafIdx == MaxUint64, but if leafIdx >= MaxUint64-shift then it's going to overflow anyway?
Am I misunderstanding/missing something?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, with tighter checks. This is because some of the test use boundaries values, and we don't want to shift these.

@phbnf phbnf force-pushed the proofgensubtreeinclusion branch 3 times, most recently from 90acf8a to 3cbfd6c Compare June 19, 2026 09:49
@phbnf phbnf force-pushed the proofgensubtreeinclusion branch from 3cbfd6c to 0e03927 Compare June 19, 2026 10:25
@phbnf phbnf merged commit ecc40b1 into transparency-dev:main Jun 22, 2026
15 of 17 checks passed
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.

2 participants