polytope-labs / solidity-merkle-trees

The most advanced solidity library for merkle (multi) proof verification of different kinds of merkle trees
Apache License 2.0
183 stars 33 forks source link

fix: patricia trie decoding #41

Closed jstinhw closed 7 months ago

jstinhw commented 7 months ago

Solve #40

  1. Ensure that the leading shared nibble is retained with odd number of shared nibbles.
  2. Involves adjusting the slicing mechanism to account for the original offset of keyNibbles.
seunlanlege commented 7 months ago

I didn't implement the ethereum trie verifier, so i can't comment on if this fix is correct or not. But i'll tag the original author @ripa1995 to get his thoughts

ripa1995 commented 7 months ago

Sorry for late reply, it was a busy week. Anyway, LGTM Just one minor comment, I would move the test you've added from test/MerklePatricia.t.sol to integration-tests/src/merkle_patricia.rs.

@seunlanlege, looks like integration tests are not run as part of the GHA, is that intentional?

seunlanlege commented 7 months ago

Sorry for late reply, it was a busy week.

Anyway, LGTM

Just one minor comment, I would move the test you've added from test/MerklePatricia.t.sol to integration-tests/src/merkle_patricia.rs.

@seunlanlege, looks like integration tests are not run as part of the GHA, is that intentional?

Yeah they're broken atm on CI haven't had the time to bring them back.