Skip to content

Commit 4e3e5e4

Browse files
authored
delete all pending txs & processed msgs before stopping batch submitter (#75)
1 parent cb1812c commit 4e3e5e4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

executor/batchsubmitter/batch.go

+9
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ func (bs *BatchSubmitter) prepareBatch(blockHeight int64) error {
5656
return errors.Wrap(err, "failed to set synced height")
5757
}
5858

59+
err = node.DeleteProcessedMsgs(bs.da.DB())
60+
if err != nil {
61+
return errors.Wrap(err, "failed to delete processed msgs")
62+
}
63+
err = node.DeletePendingTxs(bs.da.DB())
64+
if err != nil {
65+
return errors.Wrap(err, "failed to delete pending txs")
66+
}
67+
5968
// error will restart block process from nextBatchInfo.Output.L2BlockNumber + 1
6069
panic(fmt.Errorf("batch info updated: reset from %d", nextBatchInfo.Output.L2BlockNumber))
6170
}

0 commit comments

Comments
 (0)