thehubbleproject / hubble-contracts

Hubble optimistic rollup
https://thehubbleproject.github.io/docs/
MIT License
133 stars 28 forks source link

Unnecessary restriction on MassMigration commitments #683

Open msieczko opened 2 years ago

msieczko commented 2 years ago

The current implementation of claimTokens method blacklists a pubkeyID for given withdrawRoot to prevent claiming the same token amount twice. https://github.com/thehubbleproject/hubble-contracts/blob/c22ce258c8e9453a8d1d64d302f51544e67ec245/contracts/WithdrawManager.sol#L81-L84 As a result this introduces a restriction on the MassMigration transactions that can be put into a single commitment. Namely, there can be no two transactions from UserStates with the same pubkeyID in a single MassMigration commitment.

Instead we could blacklist a specific path in withdraw states tree to drop this unnecessary restriction.