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

Integration test for nodes running on different versions of /fuel/req_res protocol #2374

Open
3 tasks
acerone85 opened this issue Oct 21, 2024 · 0 comments
Open
3 tasks
Assignees

Comments

@acerone85
Copy link
Contributor

acerone85 commented Oct 21, 2024

Follow-up from #2362

Context:

After #2362 we have two versions of the /fuel/req_res protocol. Both protocols use the same type for requests, but differ on the type of responses.

  • /fuel/req_res/0.0.1: nodes can send an empty (None) response when they cannot fulfill a request incoming from a remote peer,
  • /fuel/req_res/0.0.2: nodes send an error response with an error code when they cannot fulfill a request incoming from a remote peer. A special error code 0: V1ProtocolEmptyResponse is reserved for dealing with empty responses coming from peers using version 0.0.1 of the protocol, and used at a higher level.

The request_response behaviour implementing these two protocols should guarantee backwards-compatibility among fuel-core nodes running different version of the protocol. In particular, the following should hold:

  • Nodes both supporting version 0.0.2 of the protocol should communicate using this version,
  • A node supporting both versions 0.0.1 and 0.0.2 of the protocol can send requests to a node supporting only version 0.0.1 of the protocol using this version. However, Empty responses received by this peer will automatically be converted to a response with error code 0: V1ProtocolEmptyResponse.
  • A node supporting both version 0.0.1 and 0.0.2 of the protocol can send responses to requests made by a node that supports version 0.0.1, using that version. In this case, any error response is automatically converted to an empty response.

At present, we do not have tests in place that check for the behaviour above, and these should be implemented.

Definition of done:

Implement different integration tests that check the behaviour above. The tests should be executed and pass in the CI checks.

  • Nodes supporting /fuel/req_res/0.0.2 communicate using that version of the protocol,
  • A node supporting /fuel/req_res/0.0.1 can answer requests from nodes supporting both /fuel/req_res/0.0.1 and /fuel/req_res/0.0.2,
  • A node supporting /fuel/req_res/0.0.1 can send request to nodes supporting both /fuel/req_res/0.0.1 and /fuel/req_res/0.0.2 and receive a response back

It might be best implementing these as backward compatibility tests, using both a new and older version of the node

Relevant files:

@acerone85 acerone85 self-assigned this Oct 21, 2024
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

When branches are created from issues, their pull requests are automatically linked.

1 participant