Skip to content

Conversation

@blockchaindevsh
Copy link
Collaborator

This PR squashes all devp2p changes we need for bootnode.

return nil, errors.New("duplicate record")
}
seen[node.ID()] = struct{}{}
if t.nodeFilter != nil && !t.nodeFilter(node) {
Copy link

Choose a reason for hiding this comment

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

Since we’ve added node filtering in handleAddNode, what additional cases does this change cover?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

handleAddNode is table-level validation, verifyResponseNode is UDP protocol-level
validation, this ensures only matching peers can respond toFindnode request.

Copy link

Choose a reason for hiding this comment

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

IIUC, this change filters out invalid peers from the FindNode response.
But we already validate peers when inserting them into the routing table, so those invalid peers shouldn’t be added to the table anyway.

So is the goal here just to drop invalid peers earlier (at response-processing time), even though they would be rejected later during table insertion?

Copy link
Collaborator Author

@blockchaindevsh blockchaindevsh Dec 17, 2025

Choose a reason for hiding this comment

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

This filter affects the result returned from Findnode, which has many callers , e.g., it will also affect result returned from RandomNodes. The filter in handleAddNode is only applied on boot node's direct peers, not on indirect peers like what Findnode may return.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks like it's not necessary for bootnode, I've removed this change.

@blockchaindevsh blockchaindevsh merged commit 975ca8c into bootnode Dec 18, 2025
1 check passed
blockchaindevsh added a commit that referenced this pull request Dec 18, 2025
…ence (#45)

* discv5: add dump, opstack-chainid, chainid flags and fix peer persistence

* fix log

* remove unnecessary change
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.

4 participants