Skip to content

New P2P node implementation#395

Closed
trinhdn2 wants to merge 136 commits intoBuildOnViction:upgrade-core-developfrom
trinhdn2:ft/p2p-enode
Closed

New P2P node implementation#395
trinhdn2 wants to merge 136 commits intoBuildOnViction:upgrade-core-developfrom
trinhdn2:ft/p2p-enode

Conversation

@trinhdn2
Copy link
Copy Markdown

@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

Dang Nhat Trinh 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