Skip to content

Conversation

@Amxx
Copy link
Collaborator

@Amxx Amxx commented Feb 8, 2024

Fixes #4886

The hasher should be view, but the existing versions are pure. This is resulved by

  • Keeping the existing versions (pure)
  • Add new (view) versions that use the a custom hasher
  • Both for memory and calldata
  • Both for simple proofs and multiproofs

This large amount of code duplication is handled through procedural generation


  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

@changeset-bot
Copy link

changeset-bot bot commented Feb 8, 2024

🦋 Changeset detected

Latest commit: b7d56bb

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

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Minor

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

@Amxx Amxx marked this pull request as ready for review February 12, 2024 20:11
@ernestognw ernestognw mentioned this pull request Feb 16, 2024
4 tasks
Copy link
Member

@ernestognw ernestognw left a comment

Choose a reason for hiding this comment

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

I pushed some nits but the PR looks good imo. It may just need to be tested with custom hashing functions but that can't be done until we release the merkle tree library.

I'd be fine leaving an issue and merging, wdyt @Amxx? I see codecov was flagging a drop in coverage. Investigating both #4977 and this drop

@Amxx Amxx added this to the 5.1 milestone Jun 27, 2024
@Amxx Amxx force-pushed the feature/cryptography/merkle-proof-custom-hash branch from b85551a to 9c7ab66 Compare June 27, 2024 14:59
ernestognw
ernestognw previously approved these changes Jul 15, 2024
Copy link
Member

@ernestognw ernestognw left a comment

Choose a reason for hiding this comment

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

LGTM, I left a TODO for when we release the Typescript library

@socket-security
Copy link

socket-security bot commented Jul 15, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@openzeppelin/merkle-tree@1.0.7 Transitive: network +28 2.39 MB

🚮 Removed packages: npm/@openzeppelin/merkle-tree@1.0.6

View full report↗︎

@Amxx Amxx requested a review from ernestognw July 15, 2024 13:28
@Toto0712 Toto0712 mentioned this pull request Jul 15, 2024
Copy link
Member

@ernestognw ernestognw left a comment

Choose a reason for hiding this comment

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

Thanks for updating the tests with the new Merkle Tree release.
LGTM

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.

Add a MerkleProof.verify function that support arbitrary internal hashes

2 participants