Skip to content
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

fix anchor generation #225

Merged
merged 2 commits into from
Oct 9, 2023
Merged

fix anchor generation #225

merged 2 commits into from
Oct 9, 2023

Conversation

XuyangSong
Copy link
Collaborator

The normal note anchor is generated from the path and note leaf, while the dummy(padding or intent) note anchor is from an existing valid root.

@@ -381,6 +381,7 @@ pub fn generate_input_token_note_proving_info<R: RngCore>(
InputNoteProvingInfo::new(
input_note,
merkle_path,
None,
Copy link
Contributor

@bazzilic bazzilic Oct 9, 2023

Choose a reason for hiding this comment

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

So if this is None, then it is calculated by the new constructor?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the argument for anchor in the new method should be called custom_anchor, and if no custom anchor is provided then the standard one is calculated. Just to make it a bit easier to understand for the user.

Copy link
Contributor

@bazzilic bazzilic left a comment

Choose a reason for hiding this comment

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

LGTM

@XuyangSong XuyangSong merged commit 6746604 into main Oct 9, 2023
7 checks passed
@XuyangSong XuyangSong deleted the xuyang/fix_anchor_generation branch October 9, 2023 09: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