mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
Add StateDB compute nonces on ProcessTx L2Tx
Add StateDB compute nonces on ProcessTx L2Tx, and update StateDB for type TypeSynchronizer, TypeTxSelector, TypeBatchBuilder
This commit is contained in:
@@ -43,7 +43,7 @@ type TxSelector struct {
|
||||
|
||||
// NewTxSelector returns a *TxSelector
|
||||
func NewTxSelector(dbpath string, synchronizerStateDB *statedb.StateDB, l2 *l2db.L2DB, maxL1UserTxs, maxL1OperatorTxs, maxTxs uint64) (*TxSelector, error) {
|
||||
localAccountsDB, err := statedb.NewLocalStateDB(dbpath, synchronizerStateDB, false, 0) // without merkletree
|
||||
localAccountsDB, err := statedb.NewLocalStateDB(dbpath, synchronizerStateDB, statedb.TypeTxSelector, 0) // without merkletree
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -89,7 +89,7 @@ func (txsel *TxSelector) GetL2TxSelection(batchNum common.BatchNum) ([]*common.P
|
||||
txs := txsel.getL2Profitable(validTxs, txsel.MaxTxs)
|
||||
|
||||
// process the txs in the local AccountsDB
|
||||
_, _, err = txsel.localAccountsDB.ProcessTxs(false, false, nil, nil, txs)
|
||||
_, _, err = txsel.localAccountsDB.ProcessTxs(nil, nil, txs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -238,7 +238,7 @@ func (txsel *TxSelector) GetL1L2TxSelection(batchNum common.BatchNum, l1Txs []*c
|
||||
l2Txs := txsel.getL2Profitable(validTxs, maxL2Txs)
|
||||
|
||||
// process the txs in the local AccountsDB
|
||||
_, _, err = txsel.localAccountsDB.ProcessTxs(false, false, l1Txs, l1CoordinatorTxs, l2Txs)
|
||||
_, _, err = txsel.localAccountsDB.ProcessTxs(l1Txs, l1CoordinatorTxs, l2Txs)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ func initTest(t *testing.T, testSet string) *TxSelector {
|
||||
|
||||
dir, err := ioutil.TempDir("", "tmpdb")
|
||||
require.Nil(t, err)
|
||||
sdb, err := statedb.NewStateDB(dir, false, 0)
|
||||
sdb, err := statedb.NewStateDB(dir, statedb.TypeTxSelector, 0)
|
||||
require.Nil(t, err)
|
||||
|
||||
txselDir, err := ioutil.TempDir("", "tmpTxSelDB")
|
||||
|
||||
Reference in New Issue
Block a user