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

New P2P node implementation #395

Closed
wants to merge 136 commits into from
Closed

New P2P node implementation #395

wants to merge 136 commits into from

Conversation

trinhdn2
Copy link

@trinhdn2 trinhdn2 commented Oct 27, 2023

This PR is the long-announced change to clean up p2p node information handling throughout the codebase.

Porting to enode.Node brings support for ENR features to every place that deals with node information, but more work will be needed to actually start relaying node records across protocols. For now, most records handled in code
are unsigned records created through enode.NewV4. Changes in devp2p and discovery will enable relaying signed records and updating them.

The new p2p/enode package

The new package defines a type Node, which wraps a node record and provides access to common information such as IP address and ports as methods. This package is the new home of the enode URL parser and the node database.

Changes to existing code

The core of this change are the following replacements across the codebase:

discover.Node -> enode.Node
discover.NodeID (pubkey) -> enode.ID (hash of pubkey)

Refs: ethereum/go-ethereum#17643

trinhdn97 and others added 30 commits June 16, 2023 14:30
@trinhdn2 trinhdn2 changed the base branch from master to upgrade-core-develop October 27, 2023 09:57
@trinhdn2 trinhdn2 marked this pull request as ready for review October 31, 2023 18:15
@trinhdn2 trinhdn2 mentioned this pull request Dec 5, 2023
2 tasks
@tungng98 tungng98 deleted the branch BuildOnViction:upgrade-core-develop December 10, 2023 16:51
@tungng98 tungng98 closed this Dec 10, 2023
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.

6 participants