@@ -11,8 +11,9 @@ import (
1111 "gorm.io/gorm"
1212
1313 "scroll-tech/common/types"
14+ "scroll-tech/common/utils"
1415
15- "scroll-tech/rollup/internal/utils"
16+ rutils "scroll-tech/rollup/internal/utils"
1617)
1718
1819// Chunk represents a chunk of blocks in the database.
@@ -177,7 +178,7 @@ func (o *Chunk) GetChunksByBatchHash(ctx context.Context, batchHash string) ([]*
177178}
178179
179180// InsertChunk inserts a new chunk into the database.
180- func (o * Chunk ) InsertChunk (ctx context.Context , chunk * encoding.Chunk , codecVersion encoding.CodecVersion , metrics utils .ChunkMetrics , dbTX ... * gorm.DB ) (* Chunk , error ) {
181+ func (o * Chunk ) InsertChunk (ctx context.Context , chunk * encoding.Chunk , codecVersion encoding.CodecVersion , metrics rutils .ChunkMetrics , dbTX ... * gorm.DB ) (* Chunk , error ) {
181182 if chunk == nil || len (chunk .Blocks ) == 0 {
182183 return nil , errors .New ("invalid args" )
183184 }
@@ -202,7 +203,7 @@ func (o *Chunk) InsertChunk(ctx context.Context, chunk *encoding.Chunk, codecVer
202203 parentChunkStateRoot = parentChunk .StateRoot
203204 }
204205
205- chunkHash , err := utils .GetChunkHash (chunk , totalL1MessagePoppedBefore , codecVersion )
206+ chunkHash , err := rutils .GetChunkHash (chunk , totalL1MessagePoppedBefore , codecVersion )
206207 if err != nil {
207208 log .Error ("failed to get chunk hash" , "err" , err )
208209 return nil , fmt .Errorf ("Chunk.InsertChunk error: %w" , err )
@@ -261,11 +262,11 @@ func (o *Chunk) UpdateProvingStatus(ctx context.Context, hash string, status typ
261262
262263 switch status {
263264 case types .ProvingTaskAssigned :
264- updateFields ["prover_assigned_at" ] = time . Now ()
265+ updateFields ["prover_assigned_at" ] = utils . NowUTC ()
265266 case types .ProvingTaskUnassigned :
266267 updateFields ["prover_assigned_at" ] = nil
267268 case types .ProvingTaskVerified :
268- updateFields ["proved_at" ] = time . Now ()
269+ updateFields ["proved_at" ] = utils . NowUTC ()
269270 }
270271
271272 db := o .db
@@ -289,11 +290,11 @@ func (o *Chunk) UpdateProvingStatusByBatchHash(ctx context.Context, batchHash st
289290
290291 switch status {
291292 case types .ProvingTaskAssigned :
292- updateFields ["prover_assigned_at" ] = time . Now ()
293+ updateFields ["prover_assigned_at" ] = utils . NowUTC ()
293294 case types .ProvingTaskUnassigned :
294295 updateFields ["prover_assigned_at" ] = nil
295296 case types .ProvingTaskVerified :
296- updateFields ["proved_at" ] = time . Now ()
297+ updateFields ["proved_at" ] = utils . NowUTC ()
297298 }
298299
299300 db := o .db
0 commit comments