@@ -183,7 +183,6 @@ func (c *client) Submit(ctx context.Context, data [][]byte, _ float64, namespace
183183}
184184
185185// getBlockTimestamp fetches the block timestamp from the DA layer header.
186- // If the header fetch fails, it falls back to time.Now() and logs a warning.
187186func (c * client ) getBlockTimestamp (ctx context.Context , height uint64 ) (time.Time , error ) {
188187 headerCtx , cancel := context .WithTimeout (ctx , c .defaultTimeout )
189188 defer cancel ()
@@ -225,7 +224,8 @@ func (c *client) Retrieve(ctx context.Context, height uint64, namespace []byte)
225224 blockTime , err := c .getBlockTimestamp (ctx , height )
226225 if err != nil {
227226 c .logger .Error ().Uint64 ("height" , height ).Err (err ).Msg ("failed to get block timestamp" )
228- // TODO: we should retry fetching the timestamp.
227+ blockTime = time .Now ()
228+ // TODO: we should retry fetching the timestamp. Current time may mess block time consistency for based sequencers.
229229 }
230230
231231 return datypes.ResultRetrieve {
@@ -262,7 +262,8 @@ func (c *client) Retrieve(ctx context.Context, height uint64, namespace []byte)
262262 blockTime , err := c .getBlockTimestamp (ctx , height )
263263 if err != nil {
264264 c .logger .Error ().Uint64 ("height" , height ).Err (err ).Msg ("failed to get block timestamp" )
265- // TODO: we should retry fetching the timestamp.
265+ blockTime = time .Now ()
266+ // TODO: we should retry fetching the timestamp. Current time may mess block time consistency for based sequencers.
266267 }
267268
268269 if len (blobs ) == 0 {
0 commit comments