diff --git a/synchronizer/synchronizer.go b/synchronizer/synchronizer.go index 2a1d8f4..81d861f 100644 --- a/synchronizer/synchronizer.go +++ b/synchronizer/synchronizer.go @@ -929,9 +929,15 @@ func (s *Synchronizer) rollupSync(ethBlock *common.Block) (*common.RollupData, e return nil, tracerr.Wrap(err) } if s.stateDB.CurrentBatch() != batchNum { - return nil, tracerr.Wrap(fmt.Errorf("stateDB.BatchNum (%v) != evtForgeBatch.BatchNum = (%v)", + return nil, tracerr.Wrap(fmt.Errorf("stateDB.BatchNum (%v) != "+ + "evtForgeBatch.BatchNum = (%v)", s.stateDB.CurrentBatch(), batchNum)) } + if s.stateDB.MT.Root().BigInt().Cmp(forgeBatchArgs.NewStRoot) != 0 { + return nil, tracerr.Wrap(fmt.Errorf("stateDB.MTRoot (%v) != "+ + "forgeBatchArgs.NewStRoot (%v)", + s.stateDB.MT.Root().BigInt(), forgeBatchArgs.NewStRoot)) + } // Transform processed PoolL2 txs to L2 and store in BatchData l2Txs, err := common.PoolL2TxsToL2Txs(poolL2Txs) // NOTE: This is a big uggly, find a better way