Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tracking issue]: Uniform substream behaviour and interface #3014

Closed
3 tasks
thomaseizinger opened this issue Oct 12, 2022 · 5 comments
Closed
3 tasks

[Tracking issue]: Uniform substream behaviour and interface #3014

thomaseizinger opened this issue Oct 12, 2022 · 5 comments

Comments

@thomaseizinger
Copy link
Contributor

thomaseizinger commented Oct 12, 2022

This a tracking issue for all sorts of efforts that concern a uniform behaviour of libp2p streams, regardless of the underlying transport or muxer.

Requirements

Done criteria

  • We have a passing test for each substream implementation1 for each requirement.

Action items

  1. Implement a first version of a test harness that covers as much possible: muxers: Add test harness for StreamMuxer implementations #2952. This first version will only assert the subset of requirements that are passing without further modification of the muxer / transport implementations.
  2. Investigate the root cause for muxers not passing certain requirements:
    1. yamux cannot read from a substream that has not been written to.
    2. yamux does not relay stream resets to the AsyncRead and AsyncWrite implementation.
    3. mplex does not relay stream resets to the AsyncRead and AsyncWrite implementation.
    4. ... to be extended as we write more tests
  3. Add tests to the harness for observing stream resets in the AsyncRead and AsyncWrite implementations.
  4. Extend test harness to test QUIC substreams
  5. Extend test harness to test WebRTC substreams
  6. Add an interface for closing the read-half of a substream.
  7. Add tests to the harness for closing the read-half of a substeam.

Open work

Footnotes

  1. mplex is considered deprecated and will not be fixed. Users should upgrade to yamux or another transport if they need a feature that is not supported.

@mxinden
Copy link
Member

mxinden commented Oct 14, 2022

Thanks for the tracking issue! I added it to our project board. I still need to prioritize it. Input welcome.

Overall looks good to me. Just one comment:

Streams should allow for closing the read and write side separately

I am not aware of a protocol that needs to close the read side. I suggest we delay implementing that half of the feature until there is need for it.

@thomaseizinger
Copy link
Contributor Author

Streams should allow for closing the read and write side separately

I am not aware of a protocol that needs to close the read side. I suggest we delay implementing that half of the feature until there is need for it.

"That half". Pun intended? 😊

Makes sense! I moved it to the bottom of the action list. If we are unaware of a protocol that uses it, perhaps we should strip it from the specification too?

@mxinden
Copy link
Member

mxinden commented Oct 19, 2022

f we are unaware of a protocol that uses it, perhaps we should strip it from the specification too?

Stripping it off the specification would prevent us from introducing it in the future, right?

@thomaseizinger
Copy link
Contributor Author

f we are unaware of a protocol that uses it, perhaps we should strip it from the specification too?

Stripping it off the specification would prevent us from introducing it in the future, right?

Maybe, I haven't thought about it much. It seems odd to have every implementation be non-compliant 🤷‍♂️

@thomaseizinger
Copy link
Contributor Author

Closing as mostly completed.

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

No branches or pull requests

2 participants