-
Notifications
You must be signed in to change notification settings - Fork 282
fix(sync service): skip messages with lower index #1134
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
Caution Review failedThe pull request is closed. WalkthroughThe changes in the Changes
Suggested reviewers
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (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. 🪧 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
🧹 Nitpick comments (2)
rollup/sync_service/sync_service.go (2)
283-289
: Revisit queueIndex increment before comparison.
IncrementingqueueIndex
prior to checking for a mismatch could introduce off-by-one errors when unexpected queue indices appear. Consider verifying the incoming index first or gracefully handling surges inmsg.QueueIndex
without immediately aborting the sync.
290-309
: Handle RLP mismatch more gracefully.
If the stored and received messages differ, the code currently logs an error and halts the entire sync. You might want to skip or quarantine only the problematic message to avoid blocking the entire syncing process.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
rollup/sync_service/sync_service.go
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: test
🔇 Additional comments (3)
rollup/sync_service/sync_service.go (3)
4-4
: No issues with this new import.
Thebytes
package is correctly used for binary data comparisons below and doesn't introduce any concerns.
19-19
: RLP import usage is valid.
Therlp
package is used appropriately for message encoding and error-checking.
311-313
: Correct placement of database write.
Persisting the message right after the duplicate checks ensures consistency. This approach looks good.
1. Purpose or design rationale of this PR
This PR adds skipping for already existing L1 messages if the received message is equal to the already stored one. This allows us to reset
SyncedL1BlockNumber
to a lower value and simply "replaying" the L1Messages. This is needed for nodes upgrading too late toEuclidV2
:go-ethereum/rollup/sync_service/sync_service.go
Line 87 in 3186613
2. 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:
3. Deployment tag versioning
Has the version in
params/version.go
been updated?4. Breaking change label
Does this PR have the
breaking-change
label?Summary by CodeRabbit
Summary by CodeRabbit
Bug Fixes
Chores