Skip to content

Fix bug in mocked inclusion proof #649

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

Merged
merged 2 commits into from
Jul 28, 2023
Merged

Fix bug in mocked inclusion proof #649

merged 2 commits into from
Jul 28, 2023

Conversation

bdehamer
Copy link
Collaborator

Summary

Fixes a bug in the inclusion proof returned as part of the mocked transaction log entry. The previous implementation was predicated on a bug that was recently discovered in the inclusion proof verification logic (see #646). With the verification bug fixed, we can need to adjust the fake inclusion proof generated for the mocked Rekor service.

Also took this opportunity to refactor the code in the mock TLog class to make SET and inclusion proof calculations more readable.

@bdehamer bdehamer requested a review from a team as a code owner July 27, 2023 17:00
@changeset-bot
Copy link

changeset-bot bot commented Jul 27, 2023

🦋 Changeset detected

Latest commit: de5b7f2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sigstore/mock Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

treeSize: treeSize,
checkpoint,
hashes: [leafHash.toString('hex')],
hashes: [],
Copy link
Member

Choose a reason for hiding this comment

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

Do you not need any hashes here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@feelepxyz as a result of fixing that verification bug we can now represent the simplest possible merkle tree which has a single node. In this scenario, the root hash of the tree is equal to the leaf hash of the sole node -- no other node hashes are required to verify the integrity of the tree.

@bdehamer bdehamer merged commit 917f48c into main Jul 28, 2023
@bdehamer bdehamer deleted the bdehamer/mock-merkle-fix branch July 28, 2023 14:54
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