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

feat: support disc v4/v5 mix mode in bootnode #312

Open
wants to merge 1 commit into
base: optimism
Choose a base branch
from

Conversation

2129zxl
Copy link

@2129zxl 2129zxl commented May 6, 2024

PR to upstream link

Description

The p2p module in op-geth has already implemented sharedUdp to enable coexistence of node discovery protocols for both v4 and v5. However, node discovery in the bootnode currently supports only a single protocol. This PR has achieved a mix of v4 and v5 protocols for the bootnode, allowing it to provide node discovery functionality to geth nodes running different versions simultaneously.

Tests

3 scenarios has been tested:

  1. v4=true and v5=false, it only supported discv4
  2. v5=true and v4=false, it only supported discv5 (defalut config)
  3. v5=true and v4=true, it supported both discv5 and discv4

Additional context

A new configuration option --v4 has been added. The configuration method is similar to that of geth. When both are set to true, both protocols are supported simultaneously. The default values are --v5=true --v4=false, meaning only the v5 protocol is supported by default.

Metadata

N/A

@2129zxl 2129zxl requested a review from a team as a code owner May 6, 2024 16:02
@2129zxl 2129zxl requested review from sebastianst and removed request for a team May 6, 2024 16:02
@2129zxl 2129zxl force-pushed the feat/bootnode_discv4v5_mix branch from e2ddf61 to f4f9773 Compare May 6, 2024 16:16
Copy link
Collaborator

@protolambda protolambda left a comment

Choose a reason for hiding this comment

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

This would be a good feature to submit as PR to upstream go-ethereum.

@2129zxl 2129zxl force-pushed the feat/bootnode_discv4v5_mix branch from f4f9773 to c11ca90 Compare May 6, 2024 23:44
@2129zxl
Copy link
Author

2129zxl commented May 8, 2024

This would be a good feature to submit as PR to upstream go-ethereum.

Your proposal is indeed more reasonable; here is the link to the PR for upstream.

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