Skip to content

Unexpected behaviour when a circuit relay server is also relayed #1690

@marcus-pousette

Description

@marcus-pousette
  • Version:
    0.44.0

  • Subsystem:
    Circuit Relay

Severity:

Medium

Description:

I have three nodes running locally (A,B,C) each as a circuit relay server and with circuit transport where discoverRelays: 1

First A is dials and connects B.

Both A and B will obtain an relayed address in .getMultiaddrs() (expected)

Then, when B directly dials C address

Unexpectedly (?), I am receiving "onConnect" events on node A from C after this when observering changes

this.topology = createTopology({
	onConnect: ...
});

The incoming connection event on A is as follows.

remotePeer: 12D3KooWDv7TfQ5Ct8jfQ98Vcs3mNSJYXABnKJvHPe4M1ZiGmqoC   (Node C)
remoteAddr: /ip4/127.0.0.1/tcp/61655

Then, additionally, C recieves an incoming connection from A

remotePeer: 12D3KooWR9JDmVK72ZZNEARjArap8SnFyV2v5Exq1jzANSKdDyrr  (Node  A)
remoteAddr: /ip4/127.0.0.1/tcp/61623/ws/p2p/12D3KooWR9JDmVK72ZZNEARjArap8SnFyV2v5Exq1jzANSKdDyrr

A

"/ip4/127.0.0.1/tcp/61623/ws/p2p/12D3KooWR9JDmVK72ZZNEARjArap8SnFyV2v5Exq1jzANSKdDyrr"
"/ip4/127.0.0.1/tcp/61622/ws/p2p/12D3KooWHw7m2xHFQjJJH3ozx59Z6AWT7yWyMHgfj1x3fELa8Baz/p2p-circuit/p2p/12D3KooWR9JDmVK72ZZNEARjArap8SnFyV2v5Exq1jzANSKdDyrr"```

B

"/ip4/127.0.0.1/tcp/61622/ws/p2p/12D3KooWHw7m2xHFQjJJH3ozx59Z6AWT7yWyMHgfj1x3fELa8Baz"
"/ip4/127.0.0.1/tcp/61623/ws/p2p/12D3KooWR9JDmVK72ZZNEARjArap8SnFyV2v5Exq1jzANSKdDyrr/p2p-circuit/p2p/12D3KooWHw7m2xHFQjJJH3ozx59Z6AWT7yWyMHgfj1x3fELa8Baz"

C

"/ip4/127.0.0.1/tcp/61625/ws/p2p/12D3KooWDv7TfQ5Ct8jfQ98Vcs3mNSJYXABnKJvHPe4M1ZiGmqoC"
"/ip4/127.0.0.1/tcp/61622/ws/p2p/12D3KooWHw7m2xHFQjJJH3ozx59Z6AWT7yWyMHgfj1x3fELa8Baz/p2p-circuit/p2p/12D3KooWDv7TfQ5Ct8jfQ98Vcs3mNSJYXABnKJvHPe4M1ZiGmqoC"

I am not expecting this, and wonder what part of the configuration is wrong?
It seems like if you are dialing a node, are you automatically also dial all relayed connections that starts with the same address?
In this case, if C dials B (/ip4/127.0.0.1/tcp/61622/ws/p2p/12D3KooWHw7m2xHFQjJJH3ozx59Z6AWT7yWyMHgfj1x3fELa8Baz)

It seems like both

/ip4/127.0.0.1/tcp/61622/ws/p2p/12D3KooWHw7m2xHFQjJJH3ozx59Z6AWT7yWyMHgfj1x3fELa8Baz

and

/ip4/127.0.0.1/tcp/61622/ws/p2p/12D3KooWHw7m2xHFQjJJH3ozx59Z6AWT7yWyMHgfj1x3fELa8Baz/p2p-circuit/p2p/12D3KooWR9JDmVK72ZZNEARjArap8SnFyV2v5Exq1jzANSKdDyrr

would receive connection events?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugA bug in existing code (including security flaws)need/analysisNeeds further analysis before proceeding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions