Skip to content

Conversation

@lexnv
Copy link
Collaborator

@lexnv lexnv commented Mar 18, 2024

This PR ensures that lazily negotiated protocols can be closed before the specific protocol message has been received.

Closes: #60

cc @paritytech/networking

@lexnv lexnv self-assigned this Mar 18, 2024
Comment on lines 550 to 552
// However, for the Litep2p the negotation must conclude before closing the
// lazy negotation of protocol. We'll wait for the close until the
// server has produced a message, in this test that means forever.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm curious why it was implemented like this in the first place. Aren't we in a Chesterton's fence situation here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep indeed, I wonder if this affects something in substrate. Proly would be good to have it running in versi for a while. I'll wait a bit for that and group this PR with the clippy PR (and any others) for testing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cc @altonen would love to get your feedback on this if you remember why the change was needed 🙏

Copy link
Contributor

Choose a reason for hiding this comment

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

I honestly don't even remember touching the multistream-select code. Did you check the behavior in this test against the latest multistream-select that libp2p uses or some other version? I wonder if it could be related to this: paritytech/substrate#14691

Base automatically changed from lexnv/awaitheader-once to master April 24, 2024 12:40
lexnv added a commit that referenced this pull request Jan 29, 2025
This PR backports https://github.com/libp2p/rust-libp2p/pull/4019/files,
effectively ensuring that our `poll_close` flushes any data immediately
without waiting for negotiation to complete.

Closes an outdated PR: #62

cc @paritytech/networking

---------

Signed-off-by: Alexandru Vasile <[email protected]>
@lexnv
Copy link
Collaborator Author

lexnv commented Feb 27, 2025

No longer needed, this has been included in the latest v0.9.1 release

@lexnv lexnv closed this Feb 27, 2025
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.

multistream: Lazy negotiated protocol cannot be closed before receiving messages

4 participants