rust-libp2p icon indicating copy to clipboard operation
rust-libp2p copied to clipboard

Circuit relay v2 should return limit to dialer

Open MarcoPolo opened this issue 1 year ago • 1 comments

Summary

When returning the "hop" message for circuit establishment, the rust-libp2p relay server does not fill in a value for the Limit field in the protobuf. Thus the dialer does not know if the connection is limited and can only assume it's unlimited (which is likely rarely true).

Issue here: https://github.com/libp2p/rust-libp2p/blob/master/protocols/relay/src/protocol/inbound_hop.rs#L130 go-libp2p sets it here: https://github.com/libp2p/go-libp2p/blob/master/p2p/protocol/circuitv2/relay/relay.go#L398

Expected behavior

rust-libp2p circuitv2 server should fill in the Limit field in returned hop message.

Actual behavior

It doesn't

Relevant log output

No response

Possible Solution

Should be an easy fix. CircuitReq needs to store the resource limits so it can set the field.

Version

all released

Would you like to work on fixing this bug ?

Maybe

MarcoPolo avatar Jun 11 '24 22:06 MarcoPolo

A simple fix. I may do it quickly if nobody else has already done it

dariusc93 avatar Jun 13 '24 12:06 dariusc93