Compare commits

..

4 Commits

Author SHA1 Message Date
colin
826357ab5d fix(rollup-relayer): update commit status logic (#1656) 2025-05-10 18:46:36 +08:00
georgehao
d26381cba3 upgrade cargo chef to 0.1.71 (#1655) 2025-05-08 21:40:25 +08:00
georgehao
0e65686ce4 upgrade intermdiate rust to 1.86.0 (#1654) 2025-05-08 19:30:13 +08:00
georgehao
6dd878eaca upgrade intermediate rust version (#1653) 2025-05-08 17:57:15 +08:00
4 changed files with 10 additions and 12 deletions

View File

@@ -24,6 +24,7 @@ on:
options:
- nightly-2023-12-03
- nightly-2022-12-10
- 1.86.0
default: "nightly-2023-12-03"
PYTHON_VERSION:
description: "Python version"
@@ -47,6 +48,7 @@ on:
type: choice
options:
- 0.1.41
- 0.1.71
BASE_IMAGE:
description: "which intermediate image you want to update"
required: true

View File

@@ -5,7 +5,7 @@ import (
"runtime/debug"
)
var tag = "v4.5.7"
var tag = "v4.5.8"
var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {

View File

@@ -386,7 +386,12 @@ func (o *Batch) UpdateRollupStatus(ctx context.Context, hash string, status type
func (o *Batch) UpdateCommitTxHashAndRollupStatus(ctx context.Context, hash string, commitTxHash string, status types.RollupStatus, dbTX ...*gorm.DB) error {
updateFields := make(map[string]interface{})
updateFields["commit_tx_hash"] = commitTxHash
updateFields["rollup_status"] = int(status)
updateFields["rollup_status"] = gorm.Expr(
`CASE
WHEN rollup_status NOT IN (?, ?) THEN ?
ELSE rollup_status
END`,
types.RollupFinalizing, types.RollupFinalized, int(status))
if status == types.RollupCommitted {
updateFields["committed_at"] = utils.NowUTC()
}
@@ -397,15 +402,6 @@ func (o *Batch) UpdateCommitTxHashAndRollupStatus(ctx context.Context, hash stri
}
db = db.WithContext(ctx)
var currentBatch Batch
if err := db.Where("hash", hash).First(&currentBatch).Error; err != nil {
return fmt.Errorf("Batch.UpdateCommitTxHashAndRollupStatus error when querying current status: %w, batch hash: %v", err, hash)
}
if types.RollupStatus(currentBatch.RollupStatus) == types.RollupFinalizing || types.RollupStatus(currentBatch.RollupStatus) == types.RollupFinalized {
return nil
}
db = db.Model(&Batch{})
db = db.Where("hash", hash)

View File

@@ -314,7 +314,7 @@ func TestBatchOrm(t *testing.T) {
updatedBatch, err = batchOrm.GetLatestBatch(context.Background())
assert.NoError(t, err)
assert.NotNil(t, updatedBatch)
assert.Equal(t, "", updatedBatch.CommitTxHash)
assert.Equal(t, "commitTxHash", updatedBatch.CommitTxHash)
assert.Equal(t, types.RollupFinalized, types.RollupStatus(updatedBatch.RollupStatus))
err = batchOrm.UpdateFinalizeTxHashAndRollupStatus(context.Background(), batchHash2, "finalizeTxHash", types.RollupFinalizeFailed)