Skip to content
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: Disable CL P2P Sync when EL Sync is enabled #8592

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

trianglesphere
Copy link
Contributor

@trianglesphere trianglesphere commented Dec 12, 2023

Description

The op-node will fetch missing blocks when it detects a gap in it's unsafe chain; however, op-geth when being driven with EL sync will also fetch blocks. We prefer to let op-geth do the networking because it is extensively tested and optimized.

Copy link
Contributor

semgrep-app bot commented Dec 12, 2023

Semgrep found 1 nil-check-after-call finding:

Potential p2pmetrics nil dereference when NewBandwidthCounter is called

Ignore this finding from nil-check-after-call.

@trianglesphere trianglesphere force-pushed the jg/disable_p2p_alt_sync_in_EL_mode branch from 85f1060 to 8dba7cc Compare December 12, 2023 22:42
@trianglesphere trianglesphere changed the base branch from jg/remove_rpc_alt_sync to develop December 12, 2023 22:42
@trianglesphere trianglesphere marked this pull request as ready for review December 12, 2023 22:45
@trianglesphere trianglesphere requested a review from a team as a code owner December 12, 2023 22:45
@trianglesphere trianglesphere requested a review from tynes December 12, 2023 22:45
Copy link
Contributor

coderabbitai bot commented Dec 12, 2023

Walkthrough

Walkthrough

The changes involve the introduction of a new synchronization mode in an Ethereum Optimism node. The sync package is now imported, and a new boolean argument related to the execution layer (EL) synchronization is added to the NewNodeP2P function and the initP2P method. This argument dictates whether the EL synchronization feature is enabled. The tests in host_test.go are updated to pass a new false argument to NewNodeP2P, indicating that EL sync is disabled in these cases.

Changes

File Change Summary
op-node/node/node.go
op-bootnode/bootnode/entrypoint.go
Added sync package import; modified initP2P method to include new ELSync mode argument.
op-node/p2p/host_test.go Updated NewNodeP2P function calls in tests to include a new false argument for EL sync.
op-node/p2p/node.go Modified NewNodeP2P function and NodeP2P's init method to accept and conditionally use the new elSyncEnabled boolean parameter.

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 X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can reply to a review comment made by CodeRabbit.
  • You can tag CodeRabbit on specific lines of code or files in the PR by tagging @coderabbitai in a comment.
  • You can tag @coderabbitai in a PR comment and ask one-off questions about the PR and the codebase. Use quoted replies to pass the context for follow-up questions.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@trianglesphere trianglesphere requested review from sebastianst and axelKingsley and removed request for tynes December 12, 2023 22:45
The op-node will fetch missing blocks when it detects a gap in it's unsafe chain;
however, op-geth when being driven with EL sync will also fetch blocks. We prefer
to let op-geth do the networking because it is extensively tested and optimized.
@trianglesphere trianglesphere force-pushed the jg/disable_p2p_alt_sync_in_EL_mode branch from 8dba7cc to 0f67fdf Compare December 12, 2023 22:48
Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Merging #8592 (0f67fdf) into develop (8cef01b) will decrease coverage by 14.40%.
Report is 7 commits behind head on develop.
The diff coverage is n/a.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #8592       +/-   ##
============================================
- Coverage    34.64%   20.24%   -14.40%     
============================================
  Files          167       88       -79     
  Lines         7155     2094     -5061     
  Branches      1209      478      -731     
============================================
- Hits          2479      424     -2055     
+ Misses        4525     1642     -2883     
+ Partials       151       28      -123     
Flag Coverage Δ
cannon-go-tests ?
chain-mon-tests ?
common-ts-tests ?
contracts-bedrock-tests 20.24% <ø> (-0.15%) ⬇️
contracts-ts-tests ?
core-utils-tests ?
sdk-next-tests ?
sdk-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 82 files with indirect coverage changes

Copy link
Member

@sebastianst sebastianst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@trianglesphere trianglesphere added this pull request to the merge queue Dec 13, 2023
Merged via the queue into develop with commit 4cc5188 Dec 13, 2023
4 checks passed
@trianglesphere trianglesphere deleted the jg/disable_p2p_alt_sync_in_EL_mode branch December 13, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants