-
Notifications
You must be signed in to change notification settings - Fork 620
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
fix(rollup-relayer): update finalize status atomically #1558
fix(rollup-relayer): update finalize status atomically #1558
Conversation
WalkthroughThe changes include an update to the version number in Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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
🧹 Outside diff range and nitpick comments (3)
rollup/internal/orm/bundle.go (3)
Line range hint 215-235
: Consider using consistent timestamp handling across methods.
While the transaction handling is correct, there's an inconsistency in timestamp handling:
UpdateFinalizeTxHashAndRollupStatus
usestime.Now()
- Other methods use
utils.NowUTC()
Consider standardizing the timestamp handling across all methods for consistency.
- updateFields["proved_at"] = time.Now()
+ updateFields["proved_at"] = utils.NowUTC()
Line range hint 266-290
: Enhance error handling for JSON marshaling.
The error handling for JSON marshaling could be improved by including more context in the error message.
proofBytes, err := json.Marshal(proof)
if err != nil {
- return err
+ return fmt.Errorf("Bundle.UpdateProofAndProvingStatusByHash failed to marshal proof: %w, bundle hash: %v", err, hash)
}
192-192
: Add documentation for transaction parameter usage.
Consider adding documentation to explain:
- The purpose of the optional transaction parameter
- Whether the method commits/rolls back the transaction
- Example usage with and without transactions
Example documentation:
// UpdateFinalizeTxHashAndRollupStatus updates the finalize transaction hash and rollup status for a bundle.
// If dbTX is provided, the update will be performed within the given transaction.
// The transaction is not committed by this method and should be handled by the caller.
Also applies to: 215-215, 266-266
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- common/version/version.go (1 hunks)
- rollup/internal/controller/relayer/l2_relayer.go (1 hunks)
- rollup/internal/orm/bundle.go (1 hunks)
✅ Files skipped from review due to trivial changes (1)
- common/version/version.go
🔇 Additional comments (2)
rollup/internal/orm/bundle.go (1)
192-203
: LGTM! Well-implemented transaction support for atomic updates.
The transaction handling is implemented correctly, allowing for atomic updates of both the finalize transaction hash and rollup status. This aligns well with the PR objective of updating finalize status atomically.
rollup/internal/controller/relayer/l2_relayer.go (1)
888-893
: LGTM! Good improvement to transaction handling.
The changes ensure atomic updates of finalize status for both batch and bundle records within a single database transaction. This prevents potential inconsistencies where one update succeeds while the other fails.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1558 +/- ##
===========================================
- Coverage 52.84% 52.83% -0.02%
===========================================
Files 157 157
Lines 12641 12644 +3
===========================================
Hits 6680 6680
- Misses 5382 5384 +2
- Partials 579 580 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Purpose or design rationale of this PR
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
New Features
Bug Fixes
Refactor