-
Notifications
You must be signed in to change notification settings - Fork 626
fix(blob-uploader): orm function InsertOrUpdateBlobUpload and s3 bucket region configuration #1679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis update includes a version bump, a change to S3 uploader region configuration to only set the region if specified, a reduction in the blob uploader's upload interval from 2 seconds to 1 second, and a stricter update condition in the Changes
Sequence Diagram(s)sequenceDiagram
participant Scheduler as BlobUploader Scheduler
participant Uploader as S3Uploader
participant ORM as BlobUpload ORM
Scheduler->>Uploader: Every 1 second, call UploadBlobToS3
Uploader->>ORM: InsertOrUpdateBlobUpload(batch_index, batch_hash, platform)
ORM->>ORM: Update record WHERE batch_index, batch_hash, platform, deleted_at IS NULL
ORM-->>Uploader: Success/Failure
Uploader-->>Scheduler: Upload result
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
rollup/internal/controller/blob_uploader/s3_sender.go (1)
21-23
:region
field appears unused – consider pruning
S3Uploader.region
is set inNewS3Uploader
but never referenced in this file. If it isn’t used elsewhere, drop the field to avoid dead state and keep the struct minimal.- region string
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
common/version/version.go
(1 hunks)rollup/internal/controller/blob_uploader/s3_sender.go
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: bridgehistoryapi-fetcher
- GitHub Check: coordinator-api
- GitHub Check: bridgehistoryapi-api
- GitHub Check: coordinator-cron
- GitHub Check: rollup-db-cli
- GitHub Check: bridgehistoryapi-db-cli
- GitHub Check: blob_uploader
- GitHub Check: rollup_relayer
- GitHub Check: gas_oracle
🔇 Additional comments (2)
rollup/internal/controller/blob_uploader/s3_sender.go (1)
39-41
: Preventing empty-string region override is the right fixPassing
WithRegion("")
silently wipes out the SDK’s normal region-resolution chain and causes runtime errors.
Conditionally appending only whencfg.Region
is non-empty removes that foot-gun without altering behaviour when a region is explicitly configured. ✅common/version/version.go (1)
8-8
: Version bump acknowledgedTag update to
v4.5.24
is straightforward. Make sure accompanying release notes reflect the S3 uploader fix.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1679 +/- ##
===========================================
+ Coverage 39.86% 40.15% +0.29%
===========================================
Files 236 232 -4
Lines 18808 18243 -565
===========================================
- Hits 7498 7326 -172
+ Misses 10575 10210 -365
+ Partials 735 707 -28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
rollup/cmd/blob_uploader/app/app.go (1)
73-73
: Hard-coded 1 s polling interval – consider making this configurableMoving from 2 s to 1 s doubles DB queries and S3 PUT attempts.
If traffic patterns change, you’ll need a code change & redeploy just to tune throughput. Reading the interval fromcfg.L2Config.BlobUploaderConfig
(with a sensible default) would give you the same benefit while keeping ops knobs in config.- go utils.Loop(subCtx, 1*time.Second, blobUploader.UploadBlobToS3) + interval := cfg.L2Config.BlobUploaderConfig.Tick // e.g. time.Duration field + go utils.Loop(subCtx, interval, blobUploader.UploadBlobToS3)Also verify that
UploadBlobToS3
is re-entrant or self-serialising; at a 1 s cadence it may be invoked again while a previous call is still in flight.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
rollup/cmd/blob_uploader/app/app.go
(1 hunks)rollup/internal/controller/blob_uploader/blob_uploader.go
(2 hunks)rollup/internal/orm/blob_upload.go
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- rollup/internal/controller/blob_uploader/blob_uploader.go
🧰 Additional context used
🧬 Code Graph Analysis (1)
rollup/cmd/blob_uploader/app/app.go (1)
common/utils/utils.go (1)
Loop
(48-59)
⏰ Context from checks skipped due to timeout of 90000ms (12)
- GitHub Check: bridgehistoryapi-fetcher
- GitHub Check: coordinator-api
- GitHub Check: blob_uploader
- GitHub Check: bridgehistoryapi-db-cli
- GitHub Check: bridgehistoryapi-api
- GitHub Check: rollup_relayer
- GitHub Check: rollup-db-cli
- GitHub Check: gas_oracle
- GitHub Check: coordinator-cron
- GitHub Check: tests
- GitHub Check: check
- GitHub Check: tests
🔇 Additional comments (1)
rollup/internal/orm/blob_upload.go (1)
118-119
: 👍 Scoped update looks correctAdding the explicit
Where
(incl.deleted_at IS NULL
) prevents updating soft-deleted rows and guards against accidental cross-platform collisions. Good improvement. Note that GORM already injectsdeleted_at IS NULL
for soft-delete models, so the extra predicate is harmless but redundant.
Purpose or design rationale of this PR
Added two small fixes:
InsertOrUpdateBlobUpload
.PR title
Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:
Deployment tag versioning
Has
tag
incommon/version.go
been updated or have you addedbump-version
label to this PR?Breaking change label
Does this PR have the
breaking-change
label?Summary by CodeRabbit
Improvements
Other