-
Notifications
You must be signed in to change notification settings - Fork 119
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
Digest-generic MerkleTreeGadget #167
Conversation
a8c56d3
to
4e3a09c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM.
As per the discussion on the first commit, I've gone back to the initial solution by reverting the second commit. |
3372f0b
to
364dadf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work! Will approve if comments are addressed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Making the circuit equivalent of MerkleTree generic over a digest algorithm is more tricky, because both the
MerkleTreeGadget
andDigestAlgorithmGadget
need to be implemented forPlonkCircuit
.I'm proposing two designs here. One is to add it as a generic parameter to
MerkleTreeGadget
, see the last commit. The other option is to addDigestAlgorithmGadget
as an associated type on theMerkleTreeGadget
trait, see here. Both options work, it's just a matter of convenience and ergonomics. Please let me know your opinions.(Note that initially I thought that the associated type would not work in the case where in the future we need to provide multiple implementations of the
MerkleTreeGadget
trait. But since the trait already is generic overMerkleTreeScheme
, which, implicitly, will be using the counterpart ofDigestAlgorithmGadget
, it should still be possible to provide multiple impl even withDigestAlgorithmGadget
being an associated type. See the rust book for more explanation on the difference between the two.)closes: #142
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
Pending
section inCHANGELOG.md
Files changed
in the GitHub PR explorer