diff --git a/coordinator/internal/orm/batch.go b/coordinator/internal/orm/batch.go index fd31d66d8..9914dc403 100644 --- a/coordinator/internal/orm/batch.go +++ b/coordinator/internal/orm/batch.go @@ -74,6 +74,10 @@ func (*Batch) TableName() string { // GetUnassignedBatch retrieves unassigned batch based on the specified limit. // The returned batch are sorted in ascending order by their index. func (o *Batch) GetUnassignedBatch(ctx context.Context, maxActiveAttempts, maxTotalAttempts uint8) (*Batch, error) { + t := time.Now() + defer func() { + log.Info("GetUnassignedBatch cost", "duration(ms)", time.Since(t).Milliseconds()) + }() db := o.db.WithContext(ctx) db = db.Where("proving_status = ?", int(types.ProvingTaskUnassigned)) db = db.Where("total_attempts < ?", maxTotalAttempts) @@ -95,6 +99,10 @@ func (o *Batch) GetUnassignedBatch(ctx context.Context, maxActiveAttempts, maxTo // GetAssignedBatch retrieves assigned batch based on the specified limit. // The returned batch are sorted in ascending order by their index. func (o *Batch) GetAssignedBatch(ctx context.Context, maxActiveAttempts, maxTotalAttempts uint8) (*Batch, error) { + t := time.Now() + defer func() { + log.Info("GetAssignedBatch cost", "duration(ms)", time.Since(t).Milliseconds()) + }() db := o.db.WithContext(ctx) db = db.Where("proving_status = ?", int(types.ProvingTaskAssigned)) db = db.Where("total_attempts < ?", maxTotalAttempts) diff --git a/coordinator/internal/orm/chunk.go b/coordinator/internal/orm/chunk.go index 965157a3b..45910a517 100644 --- a/coordinator/internal/orm/chunk.go +++ b/coordinator/internal/orm/chunk.go @@ -69,6 +69,10 @@ func (*Chunk) TableName() string { // GetUnassignedChunk retrieves unassigned chunk based on the specified limit. // The returned chunks are sorted in ascending order by their index. func (o *Chunk) GetUnassignedChunk(ctx context.Context, height int, maxActiveAttempts, maxTotalAttempts uint8) (*Chunk, error) { + t := time.Now() + defer func() { + log.Info("GetUnassignedChunk cost", "duration(ms)", time.Since(t).Milliseconds()) + }() db := o.db.WithContext(ctx) db = db.Model(&Chunk{}) db = db.Where("proving_status = ?", int(types.ProvingTaskUnassigned)) @@ -91,6 +95,10 @@ func (o *Chunk) GetUnassignedChunk(ctx context.Context, height int, maxActiveAtt // GetAssignedChunk retrieves assigned chunk based on the specified limit. // The returned chunks are sorted in ascending order by their index. func (o *Chunk) GetAssignedChunk(ctx context.Context, height int, maxActiveAttempts, maxTotalAttempts uint8) (*Chunk, error) { + t := time.Now() + defer func() { + log.Info("GetAssignedChunk cost", "duration(ms)", time.Since(t).Milliseconds()) + }() db := o.db.WithContext(ctx) db = db.Model(&Chunk{}) db = db.Where("proving_status = ?", int(types.ProvingTaskAssigned)) diff --git a/l2geth b/l2geth index 25fe3ba69..38a3a9c91 160000 --- a/l2geth +++ b/l2geth @@ -1 +1 @@ -Subproject commit 25fe3ba69a28781fa015460d8e53d589f8a6af47 +Subproject commit 38a3a9c9198ce54513506ddd93d03e6d99618bad