mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
Add HashGlobalInputs for ZKInputs
Add HashGlobalInputs for ZKInputs compatible with js & circom circuits version.
Compatible with hermeznetwork/commonjs at version: c6a1448db5bae4cda839ce36c1f35d8defccc9cd
(c6a1448db5)
This commit is contained in:
@@ -211,11 +211,18 @@ func (txsel *TxSelector) GetL1L2TxSelection(coordIdxs []common.Idx, batchNum com
|
||||
}
|
||||
|
||||
// get most profitable L2-tx
|
||||
maxL2Txs := txsel.MaxTxs - uint64(len(l1CoordinatorTxs)) // - len(l1UserTxs)
|
||||
maxL2Txs := txsel.MaxTxs - uint64(len(l1CoordinatorTxs)) // - len(l1UserTxs) // TODO if there are L1UserTxs take them in to account
|
||||
l2Txs := txsel.getL2Profitable(validTxs, maxL2Txs)
|
||||
|
||||
//nolint:gomnd
|
||||
ptc := statedb.ProcessTxsConfig{ // TODO TMP
|
||||
NLevels: 32,
|
||||
MaxFeeTx: 64,
|
||||
MaxTx: 512,
|
||||
MaxL1Tx: 64,
|
||||
}
|
||||
// process the txs in the local AccountsDB
|
||||
_, err = txsel.localAccountsDB.ProcessTxs(coordIdxs, l1Txs, l1CoordinatorTxs, l2Txs)
|
||||
_, err = txsel.localAccountsDB.ProcessTxs(ptc, coordIdxs, l1Txs, l1CoordinatorTxs, l2Txs)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
|
||||
@@ -83,9 +83,15 @@ func TestGetL2TxSelection(t *testing.T) {
|
||||
}
|
||||
addTokens(t, tokens, txsel.l2db.DB())
|
||||
|
||||
ptc := statedb.ProcessTxsConfig{
|
||||
NLevels: 32,
|
||||
MaxFeeTx: 64,
|
||||
MaxTx: 512,
|
||||
MaxL1Tx: 64,
|
||||
}
|
||||
// Process the 1st batch, which contains the L1CoordinatorTxs necessary
|
||||
// to create the Coordinator accounts to receive the fees
|
||||
_, err = txsel.localAccountsDB.ProcessTxs(nil, nil, blocks[0].Rollup.Batches[0].L1CoordinatorTxs, nil)
|
||||
_, err = txsel.localAccountsDB.ProcessTxs(ptc, nil, nil, blocks[0].Rollup.Batches[0].L1CoordinatorTxs, nil)
|
||||
require.Nil(t, err)
|
||||
|
||||
// add the 1st batch of transactions to the TxSelector
|
||||
|
||||
Reference in New Issue
Block a user