Skip to content

fix(identify): push should not dial a new connection - #3035

Merged
MarcoPolo merged 2 commits into
masterfrom
marco/id-push-fix
Nov 18, 2024
Merged

MarcoPolo merged 2 commits into
masterfrom
marco/id-push-fix

Conversation

@MarcoPolo

@MarcoPolo MarcoPolo commented Nov 12, 2024 •

Copy link
Copy Markdown
Collaborator

There is a small window after a peer disconnects, but before identify has updated its conn map that would cause the host to dial a peer in order to send a push message. This prevents that

@MarcoPolo
MarcoPolo requested a review from sukunrt November 12, 2024 03:57
@MarcoPolo MarcoPolo self-assigned this Nov 12, 2024
Comment thread p2p/protocol/identify/id.go Outdated
// We only want to send an identify push if we already have an open
// connection.
ctx = network.WithNoDial(ctx, "id push")
str, err := ids.Host.NewStream(ctx, c.RemotePeer(), IDPush)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we create the stream explicitly on the connection and do multistream select explicitly like we do for identify(non push). This might use a different connection to open the stream.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, that's better. done on b53c174

@MarcoPolo MarcoPolo changed the title fix: identify: push should not dial a new connection fix(identify): push should not dial a new connection Nov 18, 2024
@MarcoPolo
MarcoPolo merged commit 708eb30 into master Nov 18, 2024
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