Conversation
ce995fd to
6b81e97
Compare
6b81e97 to
00709fa
Compare
arnaucube
approved these changes
Apr 18, 2025
Collaborator
arnaucube
left a comment
There was a problem hiding this comment.
LGTM, happy with moving the padding & witness preparation logic to the set_targets methods 😺
ax0
approved these changes
Apr 21, 2025
Co-authored-by: Ahmad Afuni <root@ahmadafuni.com>
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.
Resolve #183 with a twist
The issue was about processing the witness outside of the
set_targetmethod, and that processing includes padding. Part of this change was already started in #196My original arguments for this pattern were:
set_targetsand directly set all the witness valuesBut once I started applying this pattern in the MainCircuit I noticed some issues. Here are my counter arguments:
set_targetsbecause it allows reusing existing types as arguments toset_targets(and those types are not yet padded). It also allows having the padding logic in the circuit code, which makes sense because the circuit logic defines what is considered padding.set_targetsmethods that do some processingtest_set_targetsmethod that does what the test needs. Or setting the targets in the test by making theFooTargetfieldspub(crate)So for this reason I'm reverting the merkle tree padding outside of
set_targetfrom #196In this PR i also remove the
enabledfromMerkleClaimAndProoffollowing the discussion #196 (comment) because it makes things more clear and less error prone, and theenabled: boolis not actually used in the random access, it's theBoolTargetcounterpart, which still exists inside ofMerkleClaimAndProofTarget.