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

Make sure that we always select the V2 version of the RequestResponseProtocol, when possible #2458

Open
acerone85 opened this issue Nov 26, 2024 · 0 comments

Comments

@acerone85
Copy link
Contributor

Context

We have two version of he protocol /fuel/req_res/0.0.1 (can return empty response in case of errors) and /fuel/req_res/0.0.2 (returns error codes). When a peer is dialled, one of these two protocols will be agreed for communication. However, the specification of RequestResponse in libp2p-rs does not mention how this is selected.

Suggested solution

One way to solve the problem is to allow /fuel/req_res/0.0.1 to be exchanged only for inbound or outbound connections.
Tradeoffs are discussed below:

  1. If a peer P allows /fuel/req_res/0.0.1 only for inbound connections, then all nodes can safely dial P. However, P can only dial peers that support /fuel/req_res/0.0.2. If the majority of the network did not upgrade to use /fuel/req_res/0.0.2, then P could struggle to establish outbound connections, and will need to downgrade their node version.

  2. If a peer P allows /fuel/req_res/0.0.1 only for outbound connections, then P can safely dial both nodes that support either /fuel/req_res/0.0.1 or /fuel/req_res/0.0.2, as well as nodes that support only /fuel/req_res/0.0.1. On the other hand, peers that support only /fuel/req_res/0.0.1 would not be able to dial P. If the majority of the network upgrades, nodes supporting only /fuel/req_res/0.0.1 could struggle to establish outbound connections, and will need to upgrade their node version.

I am listing both alternatives, but I believe that 2. is probably the best because it incentivises nodes to upgrade the node version.

Acceptance criteria

The P2P request response behaviour is updated to allow /fuel/req_res/0.0.1 either only for inbound or outbound connections.

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

No branches or pull requests

1 participant