Skip to content

Commit 6df3f87

Browse files
on chain-tip: if batch is full - stop execution stage - to allow commit and reduce db size (#11287)
1 parent 6892e4e commit 6df3f87

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

eth/stagedsync/exec3.go

+6
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,7 @@ Loop:
923923

924924
tt = time.Now()
925925
applyTx.CollectMetrics()
926+
926927
if !useExternalTx {
927928
tt = time.Now()
928929
if err = applyTx.Commit(); err != nil {
@@ -951,6 +952,11 @@ Loop:
951952
}(); err != nil {
952953
return err
953954
}
955+
956+
// on chain-tip: if batch is full then stop execution - to allow stages commit
957+
if !execStage.CurrentSyncCycle.IsInitialCycle {
958+
break Loop
959+
}
954960
logger.Info("Committed", "time", time.Since(commitStart),
955961
"block", doms.BlockNum(), "txNum", doms.TxNum(),
956962
"step", fmt.Sprintf("%.1f", float64(doms.TxNum())/float64(agg.StepSize())),

0 commit comments

Comments
 (0)