-
Notifications
You must be signed in to change notification settings - Fork 627
feat(blob-uploader): upload blob once proposed #1759
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
feat(blob-uploader): upload blob once proposed #1759
Conversation
WalkthroughVersion is bumped from v4.7.1 to v4.7.2. The blob uploader logic is modified to allow uploading batches with empty CommitTxHash by commenting out the conditional that previously enforced committed-only uploads. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
e62942f to
494b836
Compare
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
rollup/internal/controller/blob_uploader/blob_uploader.go (1)
200-252: Align function comment and behavior now that CommitTxHash check is disabledThe doc comment still states “The batch must have a commit_tx_hash (committed).” but the actual
CommitTxHashguard is now commented out, soGetFirstUnuploadedBatchByPlatformwill return batches even whenCommitTxHashis empty.This is a non-trivial behavioral change (uploading blobs for uncommitted batches) and the existing comment is now misleading.
Consider:
- Updating the function comment to explicitly state that uncommitted batches are now eligible for upload, and why (to avoid S3 race conditions).
- Optionally adjusting the inline comment to make it clear this is an intentional, permanent behavior change rather than a temporary hack.
This keeps future maintainers from assuming that a commit hash is still a precondition for uploads.
rollup/internal/controller/relayer/l2_relayer.go (1)
372-403: Disabling timeout/backlog/fee heuristics fundamentally changes when batches are submittedBy commenting out the
TimeoutSec/BacklogMax/skipSubmitByFeelogic:
forceSubmitis never set totrue, so the “too old” and “backlog too big” fast‑paths are effectively disabled.skipSubmitByFeeis never called; blob‑fee target pricing and its metrics become dead code.- Submission is now driven solely by
len(batchesToSubmit) >= minBatches— regardless of batch age, backlog size, or current blob fee.This is a significant behavior change compared to the function’s comment (“forceSubmit”, backlog, fee target), which is now stale. It can impact both:
- Cost behavior: batches will be sent even when blob fees are well above the previous target.
- Backlog behavior: timeouts and backlog thresholds no longer force inclusion; only
minBatcheslimits apply.If this simplification is intentional (e.g., for an experiment or a new strategy), I’d suggest:
- Updating the
ProcessPendingBatchesdoc comment to describe the new, simpler policy.- Adding a brief inline comment where the old logic is commented out, clarifying whether this is temporary and whether config knobs like
TimeoutSec/BacklogMaxare currently ignored.- Optionally gating the old heuristics behind a feature flag instead of commenting them out, so you can re‑enable them without code changes.
If it’s not intended that fee/timeout/backlog controls are dropped, this needs to be revisited before release.
Also applies to: 471-479
🧹 Nitpick comments (2)
rollup/internal/controller/sender/sender.go (1)
31-32: Clean up new blob hash and raw transaction logging for long‑term useThe new logic to compute and log the versioned blob hash and raw transaction looks functionally fine, but the logging patterns are a bit ad‑hoc:
- Log messages use
"------------------------------Morty ..."which reads like temporary debug text.- For blob txs with multiple blobs, only the first blob’s versioned hash is logged; that may be confusing when correlating with multiple S3 objects.
- Logging full raw tx hex at
Infolevel can be very noisy in production.Suggested tweaks:
- Replace the “Morty” messages with stable, descriptive strings (e.g.,
"blob tx versioned hash"and"raw transaction for eth_sendRawTransaction"), and include context likelen(blobs)or a slice of hashes if you need to correlate multiple blobs.- Consider lowering the raw‑tx log to
Debugor guarding it behind a config flag so production logs don’t get flooded.No correctness issues, just polish for observability and log hygiene.
Also applies to: 329-336, 359-366
rollup/internal/controller/relayer/l2_relayer.go (1)
124-147: Document or reconsider removal of commit/finalize sender address validationThe pre‑flight parsing and validation of commit/finalize signer addresses (
addrFromSignerConfig+ “must be different” check) is now fully commented out, so:
- Misconfigured signer addresses (including commit and finalize being identical) will only be detected much later, if at all.
- The helper
addrFromSignerConfigis effectively unused outside this commented block.If the intent is to allow shared signers or to relax these checks, consider:
- Updating comments around this switch case to spell out the new expectations (e.g., “commit/finalize may share an address; we rely on contract‑level checks only”).
- Or, if safety is still desired, keeping a minimal validation (e.g., non‑empty addresses, optional inequality check behind a config flag).
This makes the configuration contract for relayer signers clearer and avoids surprising operator errors.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
common/version/version.go(1 hunks)rollup/internal/controller/blob_uploader/blob_uploader.go(1 hunks)rollup/internal/controller/relayer/l2_relayer.go(2 hunks)rollup/internal/controller/sender/sender.go(3 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: Thegaram
Repo: scroll-tech/scroll PR: 1746
File: rollup/internal/controller/sender/sender.go:637-640
Timestamp: 2025-10-18T06:49:24.796Z
Learning: In the file `rollup/internal/controller/sender/sender.go`, the resubmission logic in `createReplacingTransaction` does not convert V0 blob sidecars to V1 when resubmitting transactions after the Fusaka upgrade. This is an accepted edge case because it's unlikely to occur, geth is expected to handle it gracefully, and manual recovery is available if needed.
Learnt from: colinlyguo
Repo: scroll-tech/scroll PR: 1714
File: rollup/internal/controller/relayer/l2_relayer.go:1548-1555
Timestamp: 2025-07-29T16:38:24.647Z
Learning: In rollup/internal/controller/relayer/l2_relayer.go, the validateBatchFields function should error out when GetBatchByHash fails to find a parent batch. This is intentional behavior - missing parent batches represent genuine error conditions that should halt batch submission processing. Genesis batch handling occurs separately from normal batch validation flow.
📚 Learning: 2025-10-18T06:49:24.796Z
Learnt from: Thegaram
Repo: scroll-tech/scroll PR: 1746
File: rollup/internal/controller/sender/sender.go:637-640
Timestamp: 2025-10-18T06:49:24.796Z
Learning: In the file `rollup/internal/controller/sender/sender.go`, the resubmission logic in `createReplacingTransaction` does not convert V0 blob sidecars to V1 when resubmitting transactions after the Fusaka upgrade. This is an accepted edge case because it's unlikely to occur, geth is expected to handle it gracefully, and manual recovery is available if needed.
Applied to files:
rollup/internal/controller/blob_uploader/blob_uploader.gorollup/internal/controller/sender/sender.gorollup/internal/controller/relayer/l2_relayer.go
📚 Learning: 2025-07-29T16:38:24.647Z
Learnt from: colinlyguo
Repo: scroll-tech/scroll PR: 1714
File: rollup/internal/controller/relayer/l2_relayer.go:1548-1555
Timestamp: 2025-07-29T16:38:24.647Z
Learning: In rollup/internal/controller/relayer/l2_relayer.go, the validateBatchFields function should error out when GetBatchByHash fails to find a parent batch. This is intentional behavior - missing parent batches represent genuine error conditions that should halt batch submission processing. Genesis batch handling occurs separately from normal batch validation flow.
Applied to files:
rollup/internal/controller/blob_uploader/blob_uploader.gorollup/internal/controller/relayer/l2_relayer.go
📚 Learning: 2024-10-20T16:13:20.397Z
Learnt from: colinlyguo
Repo: scroll-tech/scroll PR: 1530
File: rollup/internal/controller/watcher/batch_proposer.go:291-294
Timestamp: 2024-10-20T16:13:20.397Z
Learning: In `batch_proposer.go`, it's acceptable to call `utils.CalculateBatchMetrics` multiple times within the loop because the batch's chunks are increasing in the loop, and each calculation reflects the updated batch state.
Applied to files:
rollup/internal/controller/relayer/l2_relayer.go
🧬 Code graph analysis (1)
rollup/internal/controller/sender/sender.go (1)
common/utils/blob.go (1)
CalculateVersionedBlobHash(11-23)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: tests
- GitHub Check: tests
- GitHub Check: check
🔇 Additional comments (1)
common/version/version.go (1)
8-8: Version bump looks consistentOnly the
tagconstant is updated to"v4.7.2"; the surrounding versioning logic is unchanged and remains correct.
Purpose or design rationale of this PR
This PR applies a feature to blob-uploader to upload blobs before it's committed. This is to alleviate the case nodes try to fetch the blob from s3 before its uploaded.
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
tagincommon/version.gobeen updated or have you addedbump-versionlabel to this PR?Breaking change label
Does this PR have the
breaking-changelabel?Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.