mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
TxSel avoid L1CoordTx for L2Tx that have a L1UserTx in the frozen queue
For the L2Txs of TransferToEthAddr & TransferToBJJ for a not-yet existing accounts, in the TxSelector check if L2Tx receiver account will be created by a L1UserFrozenTxs (in the next batch, the current frozen queue). In that case, the L2Tx will be discarded at the current batch, even if there is an AccountCreationAuth for the account, as there is a L1UserTx in the frozen queue that will create the receiver Account. The L2Tx is discarded to avoid the Coordinator creating a new L1CoordinatorTx to create the receiver account, which will be also created in the next batch from the L1UserFrozenTx, ending with the user having 2 different accounts for the same TokenID. The double account creation is supported by the Hermez zkRollup specification, but it was decided to mitigate it at the TxSelector level for the explained cases.
This commit is contained in:
@@ -22,7 +22,7 @@ type L1Tx struct {
|
||||
// - L1UserTx: 0
|
||||
// - L1CoordinatorTx: 1
|
||||
TxID TxID `meddler:"id"`
|
||||
// ToForgeL1TxsNum indicates in which the tx was forged / will be forged
|
||||
// ToForgeL1TxsNum indicates in which L1UserTx queue the tx was forged / will be forged
|
||||
ToForgeL1TxsNum *int64 `meddler:"to_forge_l1_txs_num"`
|
||||
Position int `meddler:"position"`
|
||||
// UserOrigin is set to true if the tx was originated by a user, false if it was
|
||||
|
||||
Reference in New Issue
Block a user