Open 0xmountaintop opened 3 years ago
?? i did not know we had updatel2key
For data availability, the encoded public data may become too large if a deposit / transfer data need to comply with a L2 key (254bit). So it would be a better practice to divide a "big" tx into some separated piece if the guarantee of atomic is not needed. For depositToNew it is just that case, i.e. we can separate it into a "register L2 key" tx and a "deposit to existed address“ tx and do not require the two op is atomic.
Currently the code is still confused so we may need to do some renaming / refactoring work so they become more clearer and easier to be understood:
Naming "UpdateL2Key" to "registerL2Key" for we has no plan to make the L2 account mutable after being registered
Update DepositToNew to be a "dummy" depositing (0 amount has been deposited) so it is just an alias of register new key. This would be consistent with the action inside rollup manager in which it has replayed the "usermessage" msg (see here).
DepositToNew
to RegisterL2Key
DepositToNew
/RegisterL2Key
We only need one of them. And if having them both it will affect them performance.
So should we use UpdateL2Key or DepositToNew?