-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
op-node: Add syncmode flag and remove old snap sync flag #8333
Conversation
WalkthroughThe changes encompass a fundamental shift in synchronization strategy within an Ethereum Optimism node, transitioning from P2P sync to EL (Execution Layer) sync. A new Changes
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 5
Configuration used: CodeRabbit UI
Files selected for processing (9)
- op-e2e/actions/l2_verifier.go (1 hunks)
- op-e2e/actions/sync_test.go (1 hunks)
- op-node/flags/flags.go (3 hunks)
- op-node/rollup/derive/engine_queue.go (4 hunks)
- op-node/rollup/derive/error.go (1 hunks)
- op-node/rollup/derive/pipeline.go (1 hunks)
- op-node/rollup/driver/state.go (1 hunks)
- op-node/rollup/sync/config.go (1 hunks)
- op-node/service.go (3 hunks)
Additional comments: 17
op-e2e/actions/l2_verifier.go (1)
- 217-222: The change from
derive.EngineP2PSyncing
toderive.EngineELSyncing
is consistent with the summary and the pull request's goal to update synchronization terminology. The logic to handle the error seems correct, as it setsl2PipelineIdle
totrue
and returns early if the error isio.EOF
orderive.EngineELSyncing
.op-e2e/actions/sync_test.go (1)
- 174-174: The code correctly reflects the changes described in the summary, updating the
sync.Config
to use the newSyncMode
field with theELSync
value.op-node/flags/flags.go (4)
9-9: The import of the
sync
package is correctly added to support the newSyncModeFlag
.49-58: The
SyncModeFlag
is added as an optional flag and is marked as hidden, which is appropriate if the feature is still in development. However, ensure that this flag is made visible once the feature is ready for use.243-250: The
L2EngineSyncEnabled
flag is deprecated with a clear usage warning. Ensure that documentation and migration guides are updated to instruct users on how to transition to the newSyncModeFlag
.46-61: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [1-251]
No further issues found in the rest of the file. All other flags and configurations appear to be unchanged and unrelated to the new
SyncModeFlag
.op-node/rollup/derive/engine_queue.go (4)
267-271: The change from
EngineP2PSyncing
toEngineELSyncing
aligns with the new synchronization terminology and logic.458-465: The updated conditional logic in
checkNewPayloadStatus
to handle the newsync.ELSync
mode is consistent with the changes described in the summary.468-474: The updated conditional logic in
checkForkchoiceUpdatedStatus
to handle the newsync.ELSync
mode is consistent with the changes described in the summary.490-496: The updated conditional logic in
tryNextUnsafePayload
to handle thesync.CLSync
mode is consistent with the changes described in the summary.op-node/rollup/derive/error.go (1)
- 100-101: Ensure that all references to the old
EngineP2PSyncing
error have been updated toEngineELSyncing
throughout the entire codebase to maintain consistency.op-node/rollup/driver/state.go (1)
- 327-330: The change from
derive.EngineP2PSyncing
toderive.EngineELSyncing
aligns with the new synchronization terminology and logic. This update should be cross-checked with all other parts of the codebase to ensure consistency.op-node/rollup/sync/config.go (2)
5-54: The implementation of the
Mode
type, its methods, and theValidMode
function are well-defined and follow Go conventions. The comments provide good context for the internal naming conventions.46-54: The
Config
struct is updated to include theSyncMode
field, and the comments provide clear explanations of the sync modes.op-node/service.go (3)
3-9: The addition of the
errors
package is appropriate for the error handling inNewSyncConfig
.250-265: The changes to
NewSyncConfig
correctly handle the deprecation of--l2.engine-sync
and the conflict with--syncmode
. Ensure that the rest of the codebase and documentation are updated to reflect these changes.256-262: The initialization of
sync.Config
correctly sets theSyncMode
based on the--syncmode
flag or the deprecated--l2.engine-sync
. It's important to ensure that thesync.Config
struct has been updated accordingly insync/config.go
to include theSyncMode
field of the newMode
type.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #8333 +/- ##
============================================
- Coverage 40.88% 21.87% -19.01%
============================================
Files 163 87 -76
Lines 6054 1938 -4116
Branches 970 438 -532
============================================
- Hits 2475 424 -2051
+ Misses 3503 1484 -2019
+ Partials 76 30 -46
Flags with carried forward coverage won't be shown. Click here to find out more. |
3566a06
to
5094728
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.
Looks good generally, but I think we need to avoid using the name snap
sync since it doesn't necessarily use snap sync - just allows the EL to sync. On L1 that's an optimistic sync but not sure that fits as well here.
Or it potentially could be a checkpoint
sync given validation will start from a specific checkpoint (though I don't think we've actually implemented that yet).
Maybe strict
or fast
sync modes? Or l1
and p2p
/engine
/el
?
5094728
to
09cadd8
Compare
@coderabbitai pause |
09cadd8
to
e752672
Compare
e52b320
to
ad4f9d7
Compare
e92ce82
to
5017e67
Compare
5017e67
to
51c47c5
Compare
51c47c5
to
e9c9540
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.
LGTM besides a few minor remarks
Co-authored-by: Sebastian Stammler <seb@oplabs.co>
Description
This PR adds a new syncmode flag and removes the old snap sync flag (though setting the old snap sync flag will still set the correct syncmode). This also rejiggers some of the configuration.
Tests
No tests. Should be cosmetic changes.
Additional context
First step (of many) to rolling out snap sync.
@coderabbitai ignore