Skip to content

Commit c0f773c

Browse files
committed
Merge remote-tracking branch 'origin/develop' into refactor/zkvm
2 parents a300fa2 + 826357a commit c0f773c

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

.github/workflows/intermediate-docker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ on:
2424
options:
2525
- nightly-2023-12-03
2626
- nightly-2022-12-10
27+
- 1.86.0
2728
default: "nightly-2023-12-03"
2829
PYTHON_VERSION:
2930
description: "Python version"
@@ -47,6 +48,7 @@ on:
4748
type: choice
4849
options:
4950
- 0.1.41
51+
- 0.1.71
5052
BASE_IMAGE:
5153
description: "which intermediate image you want to update"
5254
required: true

common/version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"runtime/debug"
66
)
77

8-
var tag = "v4.5.7"
8+
var tag = "v4.5.8"
99

1010
var commit = func() string {
1111
if info, ok := debug.ReadBuildInfo(); ok {

rollup/internal/orm/batch.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,12 @@ func (o *Batch) UpdateRollupStatus(ctx context.Context, hash string, status type
386386
func (o *Batch) UpdateCommitTxHashAndRollupStatus(ctx context.Context, hash string, commitTxHash string, status types.RollupStatus, dbTX ...*gorm.DB) error {
387387
updateFields := make(map[string]interface{})
388388
updateFields["commit_tx_hash"] = commitTxHash
389-
updateFields["rollup_status"] = int(status)
389+
updateFields["rollup_status"] = gorm.Expr(
390+
`CASE
391+
WHEN rollup_status NOT IN (?, ?) THEN ?
392+
ELSE rollup_status
393+
END`,
394+
types.RollupFinalizing, types.RollupFinalized, int(status))
390395
if status == types.RollupCommitted {
391396
updateFields["committed_at"] = utils.NowUTC()
392397
}
@@ -397,15 +402,6 @@ func (o *Batch) UpdateCommitTxHashAndRollupStatus(ctx context.Context, hash stri
397402
}
398403
db = db.WithContext(ctx)
399404

400-
var currentBatch Batch
401-
if err := db.Where("hash", hash).First(&currentBatch).Error; err != nil {
402-
return fmt.Errorf("Batch.UpdateCommitTxHashAndRollupStatus error when querying current status: %w, batch hash: %v", err, hash)
403-
}
404-
405-
if types.RollupStatus(currentBatch.RollupStatus) == types.RollupFinalizing || types.RollupStatus(currentBatch.RollupStatus) == types.RollupFinalized {
406-
return nil
407-
}
408-
409405
db = db.Model(&Batch{})
410406
db = db.Where("hash", hash)
411407

rollup/internal/orm/orm_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ func TestBatchOrm(t *testing.T) {
314314
updatedBatch, err = batchOrm.GetLatestBatch(context.Background())
315315
assert.NoError(t, err)
316316
assert.NotNil(t, updatedBatch)
317-
assert.Equal(t, "", updatedBatch.CommitTxHash)
317+
assert.Equal(t, "commitTxHash", updatedBatch.CommitTxHash)
318318
assert.Equal(t, types.RollupFinalized, types.RollupStatus(updatedBatch.RollupStatus))
319319

320320
err = batchOrm.UpdateFinalizeTxHashAndRollupStatus(context.Background(), batchHash2, "finalizeTxHash", types.RollupFinalizeFailed)

0 commit comments

Comments
 (0)