Skip to content

Commit

Permalink
base pipeline forge batch implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Intizar-T committed Dec 21, 2024
1 parent 1dcfa60 commit 0ebf9ce
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 170 deletions.
15 changes: 15 additions & 0 deletions sequencer/batchbuilder/batchbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,18 @@ func (bb *BatchBuilder) Reset(batchNum common.BatchNum, fromSynchronizer bool) e
func (bb *BatchBuilder) LocalStateDB() *statedb.LocalStateDB {
return bb.localStateDB
}

// BuildBatch takes the transactions and returns the common.ZKInputs of the next batch
func (bb *BatchBuilder) BuildBatch(
configBatch *ConfigBatch,
l1usertxs []common.L1Tx,
) (*common.ZKInputs, error) {
bbStateDB := bb.localStateDB.StateDB
tp := txprocessor.NewTxProcessor(bbStateDB, configBatch.TxProcessorConfig)

ptOut, err := tp.ProcessTxs(l1usertxs)
if err != nil {
return nil, common.Wrap(err)
}
return ptOut.ZKInputs, nil
}
34 changes: 17 additions & 17 deletions sequencer/coordinator/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,24 @@ type Debug struct {

// BatchInfo contans the Batch information
type BatchInfo struct {
PipelineNum int
BatchNum common.BatchNum
ServerProof prover.Client
ProofStart time.Time
ZKInputs *common.ZKInputs
Proof *prover.Proof
PublicInputs []*big.Int
L1Batch bool
VerifierIdx uint8
L1UserTxs []common.L1Tx
L1CoordTxs []common.L1Tx
PipelineNum int
BatchNum common.BatchNum
ServerProof prover.Client
ProofStart time.Time
ZKInputs *common.ZKInputs
Proof *prover.Proof
PublicInputs []*big.Int
// L1Batch bool
VerifierIdx uint8
L1UserTxs []common.L1Tx
// L1CoordTxs []common.L1Tx
L1CoordinatorTxsAuths [][]byte
L2Txs []common.L2Tx
CoordIdxs []common.AccountIdx
ForgeBatchArgs *eth.RollupForgeBatchArgs
Auth *bind.TransactOpts `json:"-"`
EthTxs []*types.Transaction
EthTxsErrs []error
// L2Txs []common.L2Tx
// CoordIdxs []common.AccountIdx
ForgeBatchArgs *eth.RollupForgeBatchArgs
Auth *bind.TransactOpts `json:"-"`
EthTxs []*types.Transaction
EthTxsErrs []error
// SendTimestamp the time of batch sent to ethereum
SendTimestamp time.Time
Receipt *types.Receipt
Expand Down
Loading

0 comments on commit 0ebf9ce

Please sign in to comment.