-
Notifications
You must be signed in to change notification settings - Fork 626
feat(rollup-relayer): add blob fee tolerance #1773
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
WalkthroughAdds an absolute blob fee tolerance to relayer batch submission: new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings🔇 Additional comments (1)
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 |
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/config/relayer.go (1)
51-55: Consider documenting zero-value behavior.The implementation looks good. However, consider explicitly documenting what happens when
BlobFeeToleranceis set to 0 (it would revert to no tolerance, matching the previous behavior). This would help operators understand the default/fallback behavior.Optionally, you could add a note in the comment:
// BlobFeeTolerance is the absolute tolerance (in wei) added to the target blob fee. // If the current fee is below target + tolerance, we proceed with submission. // This prevents skipping submission when the price difference is negligible (e.g., 1 wei). +// Setting this to 0 disables the tolerance mechanism (strict target enforcement). // Recommended value: 10 gwei (10000000000 wei). BlobFeeTolerance uint64 `json:"blob_fee_tolerance"`
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
rollup/conf/config.json(1 hunks)rollup/internal/config/relayer.go(1 hunks)rollup/internal/controller/relayer/l2_relayer.go(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: Thegaram
Repo: scroll-tech/scroll PR: 1769
File: rollup/internal/config/relayer.go:112-114
Timestamp: 2025-11-27T18:50:44.578Z
Learning: In `rollup/internal/config/relayer.go`, the fields `L1BaseFeeLimit` and `L1BlobBaseFeeLimit` in `GasOracleConfig` should never be set to 0. Zero values would break the gas oracle fee enforcement logic in `l1_relayer.go` by capping all fees to 0.
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.
📚 Learning: 2025-11-27T18:50:44.578Z
Learnt from: Thegaram
Repo: scroll-tech/scroll PR: 1769
File: rollup/internal/config/relayer.go:112-114
Timestamp: 2025-11-27T18:50:44.578Z
Learning: In `rollup/internal/config/relayer.go`, the fields `L1BaseFeeLimit` and `L1BlobBaseFeeLimit` in `GasOracleConfig` should never be set to 0. Zero values would break the gas oracle fee enforcement logic in `l1_relayer.go` by capping all fees to 0.
Applied to files:
rollup/internal/config/relayer.gorollup/internal/controller/relayer/l2_relayer.gorollup/conf/config.json
📚 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/config/relayer.gorollup/internal/controller/relayer/l2_relayer.go
🧬 Code graph analysis (1)
rollup/internal/controller/relayer/l2_relayer.go (1)
rollup/internal/config/relayer.go (1)
BatchSubmission(42-56)
⏰ 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: check
- GitHub Check: tests
- GitHub Check: tests
🔇 Additional comments (3)
rollup/conf/config.json (1)
61-62: LGTM! Configuration value is appropriate.The addition of
blob_fee_tolerancewith a value of 10 gwei (10000000000 wei) is reasonable for the stated use case of handling negligible blob fee fluctuations (1-2 wei). The JSON formatting with the trailing comma is correct.rollup/internal/controller/relayer/l2_relayer.go (2)
1258-1261: LGTM! Tolerance calculation is correct.The implementation correctly applies the absolute tolerance offset to the target blob fee. Using
big.Intarithmetic ensures no overflow issues, and the calculation is straightforward:threshold = target + tolerance.
1268-1272: LGTM! Skip condition and error message are well-implemented.The updated logic correctly checks
current > thresholdinstead ofcurrent > target, which aligns with the PR objective. The error message provides comprehensive debugging information by including all relevant values (current, target, threshold, tolerance, and age). This will be helpful for operators monitoring batch submission behavior.
Purpose or design rationale of this PR
Problem
When blob price stays very low (e.g., 1-2 wei), any tiny increase causes current > target, stopping batch submission unnecessarily.
Solution
Add blob_fee_tolerance config. Now we only skip submission when current > target + tolerance, avoiding delays due to negligible price differences.
The main changes are:
rollup/internal/config/relayer.gowe introduce a new config fieldBlobFeeTolerance uint64json:"blob_fee_tolerance"`, which we can configurate the tolerance.rollup/internal/controller/relayer/l2_relayer.go, we check ifcurrent > target + tolerance.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.