Add checks to TxSelector & other:

- Upgrade go-merkletree version to include the last changes of Pebble
that fixes the cgo issues (which should fix #453), from:
c2b05f12d7
- TxSelector
	- Remove parameter batchNum for GetL2TxSelection & GetL1L2TxSelection
	- Add checks of ToBJJ & ToEthAddr when ToIdx>255
	- Avoid getting the sender account twice to get the TokenID of a l2tx
	- Add test to check that selected L2Txs are sorted by Nonce
	- Discard L2Tx that return error at ProcessL2Txs
- executed `go mod tidy`
This commit is contained in:
arnaucube
2021-01-05 15:19:31 +01:00
parent 6fa4a2e799
commit 962b9e4712
8 changed files with 208 additions and 71 deletions

View File

@@ -824,14 +824,14 @@ func (p *Pipeline) forgeBatch(batchNum common.BatchNum) (*BatchInfo, error) {
return nil, tracerr.Wrap(err)
}
coordIdxs, auths, l1UserTxsExtra, l1CoordTxs, poolL2Txs, err =
p.txSelector.GetL1L2TxSelection(selectionCfg, batchNum, l1UserTxs)
p.txSelector.GetL1L2TxSelection(selectionCfg, l1UserTxs)
if err != nil {
return nil, tracerr.Wrap(err)
}
} else {
// 2b: only L2 txs
coordIdxs, auths, l1CoordTxs, poolL2Txs, err =
p.txSelector.GetL2TxSelection(selectionCfg, batchNum)
p.txSelector.GetL2TxSelection(selectionCfg)
if err != nil {
return nil, tracerr.Wrap(err)
}