Skip to content
This repository was archived by the owner on Apr 25, 2026. It is now read-only.

[BUG] Remove member is problematic on LinkableIncrementalBinaryTree #17

Description

@semaraugusto

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲Something isn't workingp2 🟡Issue should be resolved soon

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Not Started 🕧

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions