@@ -73,8 +73,8 @@ func NewSequencer(
7373 proposer : proposer ,
7474 fiRetriever : fiRetriever ,
7575 checkpointStore : seqcommon .NewCheckpointStore (db , ds .NewKey ("/single/checkpoint" )),
76- daHeight : atomic.Uint64 {}, // empty, set by executor or submitter
7776 }
77+ s .SetDAHeight (genesis .DAStartHeight ) // default value, will be overriden by executor or submitter
7878
7979 loadCtx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
8080 defer cancel ()
@@ -86,8 +86,16 @@ func NewSequencer(
8686
8787 // Load checkpoint from DB, or initialize if none exists
8888 checkpoint , err := s .checkpointStore .Load (loadCtx )
89- if err != nil && ! errors .Is (err , seqcommon .ErrCheckpointNotFound ) {
90- return nil , fmt .Errorf ("failed to load checkpoint from DB: %w" , err )
89+ if err != nil {
90+ if errors .Is (err , seqcommon .ErrCheckpointNotFound ) {
91+ // No checkpoint exists, initialize with current DA height
92+ s .checkpoint = & seqcommon.Checkpoint {
93+ DAHeight : s .GetDAHeight (),
94+ TxIndex : 0 ,
95+ }
96+ } else {
97+ return nil , fmt .Errorf ("failed to load checkpoint from DB: %w" , err )
98+ }
9199 } else {
92100 s .checkpoint = checkpoint
93101 // If we had a non-zero tx index, we're resuming from a crash mid-block
@@ -142,7 +150,7 @@ func (c *Sequencer) GetNextBatch(ctx context.Context, req coresequencer.GetNextB
142150 daHeight := c .GetDAHeight ()
143151
144152 // checkpoint init path, only hit when sequencer is bootstrapping
145- if daHeight > 0 && c .checkpoint == nil {
153+ if c .checkpoint . DAHeight == 0 {
146154 c .checkpoint = & seqcommon.Checkpoint {
147155 DAHeight : daHeight ,
148156 TxIndex : 0 ,
0 commit comments