Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"runtime/debug"
)

var tag = "v4.5.29"
var tag = "v4.5.30"

var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {
Expand Down
2 changes: 1 addition & 1 deletion rollup/cmd/blob_uploader/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func action(ctx *cli.Context) error {
log.Crit("failed to create l2 relayer", "config file", cfgFile, "error", err)
}

go utils.Loop(subCtx, 2*time.Second, blobUploader.UploadBlobToS3)
go utils.Loop(subCtx, 1*time.Second, blobUploader.UploadBlobToS3)

// Finish start all blob-uploader functions.
log.Info("Start blob-uploader successfully", "version", version.Version)
Expand Down
6 changes: 4 additions & 2 deletions rollup/internal/controller/blob_uploader/s3_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ type S3Uploader struct {
func NewS3Uploader(cfg *config.AWSS3Config) (*S3Uploader, error) {
// load AWS config
var opts []func(*awsconfig.LoadOptions) error
opts = append(opts, awsconfig.WithRegion(cfg.Region))

// if AccessKey && SecretKey provided, use it
if cfg.AccessKey != "" && cfg.SecretKey != "" {
opts = append(opts, awsconfig.WithCredentialsProvider(
Expand All @@ -38,6 +36,10 @@ func NewS3Uploader(cfg *config.AWSS3Config) (*S3Uploader, error) {
)
}

if cfg.Region != "" {
opts = append(opts, awsconfig.WithRegion(cfg.Region))
}

awsCfg, err := awsconfig.LoadDefaultConfig(context.Background(), opts...)
if err != nil {
return nil, fmt.Errorf("failed to load default config: %w", err)
Expand Down
3 changes: 2 additions & 1 deletion rollup/internal/orm/blob_upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ func (o *BlobUpload) InsertOrUpdateBlobUpload(ctx context.Context, batchIndex ui
return fmt.Errorf("BlobUpload.InsertOrUpdateBlobUpload query error: %w, batch index: %v, batch_hash: %v, platform: %v", err, batchIndex, batchHash, platform)
}

if err := db.Model(&existing).Update("status", int16(status)).Error; err != nil {
if err := db.Model(&existing).Where("batch_index = ? AND batch_hash = ? AND platform = ? AND deleted_at IS NULL",
batchIndex, batchHash, int16(platform)).Update("status", int16(status)).Error; err != nil {
return fmt.Errorf("BlobUpload.InsertOrUpdateBlobUpload update error: %w, batch index: %v, batch_hash: %v, platform: %v", err, batchIndex, batchHash, platform)
}

Expand Down