In the process of decoding extension nodes within the Patricia tree, an issue arises where the leading shared nibble 0 is mistakenly discarded.
The problem manifests when decoding the following RLP data:
decoded_rlp=["0x10”, ”0xb798089c35eabfa9992866d0ff2d19040e85326547b79dad85be810b5482bfb2"]
Two issues found when dealing with extension node
In the process of decoding extension nodes within the Patricia tree, an issue arises where the leading shared nibble 0 is mistakenly discarded. The problem manifests when decoding the following RLP data:
decoded_rlp=["0x10”, ”0xb798089c35eabfa9992866d0ff2d19040e85326547b79dad85be810b5482bfb2"]
In the second issue, the concern is with the handling of keyNibbles slicing. The current implementation fails to slice the keyNibbles starting from its original offset, effectively ignoring this offset. This oversight leads to incorrect slicing of keyNibbles. https://github.com/polytope-labs/solidity-merkle-trees/blob/5836535046cfaeb6edb2fadb34c9b793c1b51184/src/MerklePatricia.sol#L169-L171