Skip to content

Conversation

asmit27rai
Copy link

@asmit27rai asmit27rai commented Sep 22, 2025

For testing :

go test ./p2p/test/transport -v -run TestPing

Fixes: #3095

@MarcoPolo
Copy link
Collaborator

Did you use an LLM to help generate this PR? We kindly ask that you must disclose that:

If you are using any kind of AI assistance to contribute to libp2p,
it must be disclosed in the pull request.

The goal is to add circuitv2 to the existing transport integration tests, not to create a new one. See https://github.com/libp2p/go-libp2p/pull/3162/files for some initial work.

@asmit27rai
Copy link
Author

asmit27rai commented Sep 23, 2025

Did you use an LLM to help generate this PR? We kindly ask that you must disclose that:

If you are using any kind of AI assistance to contribute to libp2p,
it must be disclosed in the pull request.

The goal is to add circuitv2 to the existing transport integration tests, not to create a new one. See https://github.com/libp2p/go-libp2p/pull/3162/files for some initial work.

No there is not any LLM used here just use it to understand the thing how the curcuitv2 works.

Yes, I will mention in pr if any AI is used.

I understand what you mean for the issue I think I misunderstood this issue.
I will change the code for this.

@MarcoPolo
Copy link
Collaborator

Thank you!

@asmit27rai
Copy link
Author

@MarcoPolo Please have a look.

Comment on lines 414 to 435
finalLibp2pOpts := transformOpts(opts)
finalLibp2pOpts = append(finalLibp2pOpts,
libp2p.Identity(listenerHost.Peerstore().PrivKey(listenerHost.ID())),
libp2p.EnableRelay(),
libp2p.AddrsFactory(addrFactory),
libp2p.ListenAddrStrings("/ip4/127.0.0.1/udp/0/quic-v1"),
)

finalHost, err := libp2p.New(finalLibp2pOpts...)
require.NoError(t, err)

err = finalHost.Connect(ctx, peer.AddrInfo{
ID: relayHost.ID(),
Addrs: relayHost.Addrs(),
})
require.NoError(t, err)

_, err = client.Reserve(ctx, finalHost, peer.AddrInfo{
ID: relayHost.ID(),
Addrs: relayHost.Addrs(),
})
require.NoError(t, err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is there a 3rd host? You have the listener, relay, and "final."

Copy link
Author

Choose a reason for hiding this comment

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

Yes I think i overcomplicate this
I am making some changes

@MarcoPolo
Copy link
Collaborator

Next time, please run the tests before submitting a PR.

go test ./p2p/test/transport -v

Copy link
Collaborator

@MarcoPolo MarcoPolo left a comment

Choose a reason for hiding this comment

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

This is a good start, but there are failing tests. There might be an issue in the circuitV2 transport itself, but I haven't dived deeper yet.

@asmit27rai
Copy link
Author

@MarcoPolo I changed some part of code.
But when i trying to do the go test ./p2p/test/transport -v it is failing but yes not from the file which i changed as this test is passing by go test ./p2p/test/transport -v -run TestPing

@MarcoPolo
Copy link
Collaborator

@MarcoPolo I changed some part of code. But when i trying to do the go test ./p2p/test/transport -v it is failing but yes not from the file which i changed as this test is passing by go test ./p2p/test/transport -v -run TestPing

The purpose of these tests is to test all aspects of a transport, not just the ability to send ping a small message. The failures are likely related to something about the circuitv2 transport.

While we could skip every test that fails in circuitv2, I'd rather we attempt to fix the issues.

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.

Add transport integration tests for circuitv2
2 participants