Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Remove member is problematic on LinkableIncrementalBinaryTree #17

Open
semaraugusto opened this issue Nov 2, 2022 · 0 comments
Open
Labels
bug 🪲 Something isn't working p2 🟡 Issue should be resolved soon

Comments

@semaraugusto
Copy link

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

  1. Set historySize=1.
    This avoids the problem, but introduces a front-running opportunity for denying service to some user.

  2. 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.

@semaraugusto semaraugusto changed the title [BUG] Remove member is problematic on the cross-chain setting [BUG] Remove member is problematic on LinkableIncrementalBinaryTree Nov 2, 2022
@dutterbutter dutterbutter added bug 🪲 Something isn't working p2 🟡 Issue should be resolved soon labels Nov 2, 2022
@dutterbutter dutterbutter moved this to Not Started 🕧 in Webb Universe Nov 2, 2022
@dutterbutter dutterbutter moved this from Not Started 🕧 to Building 🏗️ in Webb Universe Nov 2, 2022
@dutterbutter dutterbutter moved this from Building 🏗️ to Not Started 🕧 in Webb Universe Nov 7, 2022
@semaraugusto semaraugusto removed their assignment Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working p2 🟡 Issue should be resolved soon
Projects
Status: Not Started 🕧
Development

No branches or pull requests

2 participants