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

transport: add in memory transport #2293

Open
p-shahi opened this issue May 15, 2023 · 11 comments · May be fixed by #3022
Open

transport: add in memory transport #2293

p-shahi opened this issue May 15, 2023 · 11 comments · May be fixed by #3022
Assignees
Labels
exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue P1 High: Likely tackled by core team if no one steps up

Comments

@p-shahi
Copy link
Member

p-shahi commented May 15, 2023

Add an in memory transport (similar to rust-libp2p) which can be used for testing https://docs.rs/libp2p/latest/libp2p/core/transport/struct.MemoryTransport.html

@sukunrt
Copy link
Member

sukunrt commented May 15, 2023

Here is something similar that tailscale does:
https://github.com/tailscale/tailscale/blob/main/tstest/natlab/natlab.go#L737

@Wondertan
Copy link
Contributor

Do I understand correctly that this should substitute mocknet ? 😃

@marten-seemann
Copy link
Contributor

Do I understand correctly that this should substitute mocknet ? 😃

Yes indeed. Mocknet shouldn't mock the swarm, only connections / streams.

@p-shahi p-shahi added help wanted Seeking public contribution on this issue exp/intermediate Prior experience is likely helpful P2 Medium: Good to have, but can wait until someone steps up P1 High: Likely tackled by core team if no one steps up and removed P2 Medium: Good to have, but can wait until someone steps up labels May 22, 2023
@MarcoPolo
Copy link
Collaborator

We have a lot of open questions, so removing help wanted for now.

@MarcoPolo MarcoPolo removed the help wanted Seeking public contribution on this issue label Jun 19, 2023
@sukunrt
Copy link
Member

sukunrt commented Jul 11, 2023

The requirement is ambiguous.

We need to decide whether we want an in memory transport for testing where we can fake IP address and possibly simulate NAT or we want to implement a /memory transport like the one implemented by rust-libp2p.

/memory is useful for testing protocols which do not depend on specific remote or local addresses but it cannot be used for testing something like AutoNATv2 without changing the /memory multiaddress intention. @mxinden is my understanding correct?

The effort required in both the cases seems similar.

@mxinden
Copy link
Member

mxinden commented Jul 12, 2023

/memory is useful for testing protocols which do not depend on specific remote or local addresses but it cannot be used for testing something like AutoNATv2 without changing the /memory multiaddress intention. @mxinden is my understanding correct?

That is correct. rust-libp2p's memory transport is very simple with a single uniform address space. It does not have any more complex mechanisms, e.g. NATs.

The effort required in both the cases seems similar.

I would assume the opposite. While I think it is very simple to port rust-libp2p's MemoryTransport to go-libp2p, I expect building a Transport "where we can fake IP address and possibly simulate NAT" is much harder.

@sukunrt
Copy link
Member

sukunrt commented Jul 12, 2023

I expect building a Transport "where we can fake IP address and possibly simulate NAT" is much harder.

I think you're right. I'll change my stance to
Building a transport where we fake IP address is a little more work than adding a /memory transport
simulating NATs is a lot more work.

@MarcoPolo
Copy link
Collaborator

I think a in-memory transport without faking IP addresses or simulating NATs is still useful for testing protocols.

I think simulating NATs should be a separate task.

I'm going to readd the help wanted label since I think we have a clearer idea of what we want here. Which is essentially the equivalent of rust-libp2p's MemoryTransport

@MarcoPolo MarcoPolo added the help wanted Seeking public contribution on this issue label Mar 22, 2024
@pyropy
Copy link

pyropy commented Oct 4, 2024

Could I claim this issue? I think it would be a good intro for me to start contributing to go-libp2p

(edit: I am part of PLDG cohort 1)

@MarcoPolo
Copy link
Collaborator

go for it

@pyropy
Copy link

pyropy commented Oct 15, 2024

Hey @MarcoPolo could you assign issue on me and maybe refer me to someone who could take a look at this

multiformats/go-multiaddr#256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue P1 High: Likely tackled by core team if no one steps up
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants