Describe the bug
By changing from https://github.com/semaphore-protocol/semaphore's default merkleTree to ours LinkableIncrementalBinaryTree.sol we introduced a problem on the removeMember method.
This is caused by our historyRoot array and by the edgeHistory. If a user gets removed from the merkle tree at some block then it could still interact with the contract for at least historySize-1 group modifications. Same stands for edgeHistory, but with the updates being relayer updates for updateEdge.
Possible solutions
-
Set historySize=1.
This avoids the problem, but introduces a front-running opportunity for denying service to some user.
-
Keep historySize=30, but set currentRootIndex to 0 whenever a removal happens.
This essentially clears the history of merkleRoots, thereby resolving the late interaction problem described above.
Describe the bug
By changing from
https://github.com/semaphore-protocol/semaphore's default merkleTree to oursLinkableIncrementalBinaryTree.solwe introduced a problem on the removeMember method.This is caused by our historyRoot array and by the edgeHistory. If a user gets removed from the merkle tree at some block then it could still interact with the contract for at least
historySize-1group modifications. Same stands for edgeHistory, but with the updates being relayer updates forupdateEdge.Possible solutions
Set
historySize=1.This avoids the problem, but introduces a front-running opportunity for denying service to some user.
Keep
historySize=30, but setcurrentRootIndexto 0 whenever a removal happens.This essentially clears the history of merkleRoots, thereby resolving the late interaction problem described above.