You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (nodes[0] == self.lastSubtrees[i][0] || nodes[4] == self.lastSubtrees[i][4]) {
self.lastSubtrees[i][proofPathIndices[i]] = hash;
}
when the updated node is on a path different from the more recently inserted path, which is recorded in self.lastSubtrees, we still might get (nodes[0] == self.lastSubtrees[i][0] || nodes[4] == self.lastSubtrees[i][4])==True, so self.lastSubtrees may be updated in
This optimization with nodes to keep track the most recent nodes does not work even if the tree does not allow for duplicated values, since update/delete may result in duplicated zero values. Also there is no mechanism to enforce always adding unique leaves, if that is the intention.
The text was updated successfully, but these errors were encountered:
zk-kit.solidity/packages/imt/contracts/InternalQuinaryIMT.sol
Lines 147 to 149 in a4e7136
when the updated node is on a path different from the more recently inserted path, which is recorded in self.lastSubtrees, we still might get (nodes[0] == self.lastSubtrees[i][0] || nodes[4] == self.lastSubtrees[i][4])==True, so self.lastSubtrees may be updated in
zk-kit.solidity/packages/imt/contracts/InternalQuinaryIMT.sol
Lines 147 to 149 in a4e7136
However, _insert would be using wrong values in
zk-kit.solidity/packages/imt/contracts/InternalQuinaryIMT.sol
Line 93 in a4e7136
This optimization with nodes to keep track the most recent nodes does not work even if the tree does not allow for duplicated values, since update/delete may result in duplicated zero values. Also there is no mechanism to enforce always adding unique leaves, if that is the intention.
The text was updated successfully, but these errors were encountered: