mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
Add circuit configuration to node config
- Remove MaxL1CoordTxs parameter from the TxSelector because this parameter doesn't exist - Use ChainID in l1tx byte encoding - Pass txprocessor configuration to batch builder via an existing parameter
This commit is contained in:
@@ -24,7 +24,8 @@ type BatchBuilder struct {
|
||||
|
||||
// ConfigBatch contains the batch configuration
|
||||
type ConfigBatch struct {
|
||||
ForgerAddress ethCommon.Address
|
||||
ForgerAddress ethCommon.Address
|
||||
TxProcessorConfig txprocessor.Config
|
||||
}
|
||||
|
||||
// NewBatchBuilder constructs a new BatchBuilder, and executes the bb.Reset
|
||||
@@ -54,17 +55,11 @@ func (bb *BatchBuilder) Reset(batchNum common.BatchNum, fromSynchronizer bool) e
|
||||
}
|
||||
|
||||
// BuildBatch takes the transactions and returns the common.ZKInputs of the next batch
|
||||
func (bb *BatchBuilder) BuildBatch(coordIdxs []common.Idx, configBatch *ConfigBatch, l1usertxs, l1coordinatortxs []common.L1Tx, pooll2txs []common.PoolL2Tx, tokenIDs []common.TokenID) (*common.ZKInputs, error) {
|
||||
//nolint:gomnd
|
||||
tpc := txprocessor.Config{ // TODO TMP
|
||||
NLevels: 32,
|
||||
MaxFeeTx: 64,
|
||||
MaxTx: 512,
|
||||
MaxL1Tx: 64,
|
||||
ChainID: uint16(0),
|
||||
}
|
||||
func (bb *BatchBuilder) BuildBatch(coordIdxs []common.Idx, configBatch *ConfigBatch, l1usertxs,
|
||||
l1coordinatortxs []common.L1Tx, pooll2txs []common.PoolL2Tx,
|
||||
tokenIDs []common.TokenID) (*common.ZKInputs, error) {
|
||||
bbStateDB := bb.localStateDB.StateDB
|
||||
tp := txprocessor.NewTxProcessor(bbStateDB, tpc)
|
||||
tp := txprocessor.NewTxProcessor(bbStateDB, configBatch.TxProcessorConfig)
|
||||
|
||||
ptOut, err := tp.ProcessTxs(coordIdxs, l1usertxs, l1coordinatortxs, pooll2txs)
|
||||
return ptOut.ZKInputs, tracerr.Wrap(err)
|
||||
|
||||
Reference in New Issue
Block a user