Skip to content

Change flood de-duplication to be by NodeID (not address)#5341

Open
drebelsky wants to merge 1 commit into
stellar:masterfrom
drebelsky:flood-by-id
Open

Change flood de-duplication to be by NodeID (not address)#5341
drebelsky wants to merge 1 commit into
stellar:masterfrom
drebelsky:flood-by-id

Conversation

@drebelsky

Copy link
Copy Markdown
Contributor

Changes flood de-duplication to be done by peer node ids (which are unique for each connection we have) instead of addresses (which may not be unique since addresses are constructed using the peer port from the node, not the port they connected on). This way, we can properly flood to multiple nodes behind the same public IP (e.g., k8s nodes, nodes behind NAT, etc...). I believe the only situation where this change won't flood data where the previous version would is if a node disconnects and reconnects with the same key but different IP.

@drebelsky drebelsky marked this pull request as ready for review July 8, 2026 17:14
Copilot AI review requested due to automatic review settings July 8, 2026 17:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR changes Floodgate’s per-message de-duplication key from a peer address string (Peer::toString() / PeerBareAddress) to the peer’s authenticated NodeID, so multiple distinct peers that share the same public IP (and potentially the same advertised peer port) will still each receive flooded messages.

Changes:

  • Track “peers told” as std::set<NodeID> instead of std::set<std::string> in Floodgate::FloodRecord.
  • Use Peer::getPeerID() consistently when recording / checking which peers have already seen a flooded item.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/overlay/Floodgate.h Switch FloodRecord’s “told set” element type to NodeID.
src/overlay/Floodgate.cpp Record and check flood de-duplication using Peer::getPeerID() instead of Peer::toString().

Comment thread src/overlay/Floodgate.cpp
@anupsdf anupsdf requested a review from graydon July 8, 2026 17:33

@graydon graydon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh, well, if that's all it takes, haha.

@anupsdf anupsdf added this pull request to the merge queue Jul 8, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jul 8, 2026
@anupsdf anupsdf added this pull request to the merge queue Jul 8, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jul 8, 2026
@anupsdf anupsdf added this pull request to the merge queue Jul 9, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 9, 2026
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.

3 participants