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

Improve the transport creation experience #953

Closed
tomaka opened this issue Feb 18, 2019 · 5 comments
Closed

Improve the transport creation experience #953

tomaka opened this issue Feb 18, 2019 · 5 comments

Comments

@tomaka
Copy link
Member

tomaka commented Feb 18, 2019

Creating a transport is a bit of a message because of modifiers everywhere (eg. https://github.com/paritytech/substrate/blob/ed2faf445f8849e8d90ddadc684ac2658819e55f/core/network-libp2p/src/transport.rs#L30-L60).

Needs some API design thoughts.

@romanb
Copy link
Contributor

romanb commented Mar 27, 2019

What do you mean by "modifiers"?

@elferdo
Copy link
Contributor

elferdo commented Mar 28, 2019

In the same vein, I think we should be able to test the higher level logic without depending on specific transports, for example: https://github.com/libp2p/rust-libp2p/blob/603c7be7c21164a82b5f71ad746254a36a90c02b/protocols/kad/src/behaviour/test.rs#L67.We introduce TCP just to test if one node gives the correct result back. I think we could pack all the network complexity behind proxy objects that could be substituted for shallow doubles in tests.

@tomaka
Copy link
Member Author

tomaka commented Mar 28, 2019

@elferdo There's a MemoryTransport that does the equivalent of TcpConfig but keeps communications inside the process. But then you need some multiplexing on top, and writing a multiplexing layer is quite complicated.

@elferdo
Copy link
Contributor

elferdo commented Mar 28, 2019

Ok, thanks for the pointer of MemoryTransport. What I was thinking is more that to test whether Kademlia finds a given PeerId as the closest one to another PeerId we shouldn't really need any networking stuff. I feel that the coupling between logic and networking is too strong there.

@romanb
Copy link
Contributor

romanb commented Sep 10, 2019

Closed by #953.

@romanb romanb closed this as completed Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants