You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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 code0: V1ProtocolEmptyResponse
is reserved for dealing with empty responses coming from peers using version0.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:0.0.2
of the protocol should communicate using this version,0.0.1
and0.0.2
of the protocol can send requests to a node supporting only version0.0.1
of the protocol using this version. However,Empty
responses received by this peer will automatically be converted to a response with error code0: V1ProtocolEmptyResponse
.0.0.1
and0.0.2
of the protocol can send responses to requests made by a node that supports version0.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.
/fuel/req_res/0.0.2
communicate using that version of the protocol,/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
,/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 backIt might be best implementing these as backward compatibility tests, using both a new and older version of the node
Relevant files:
fuel-core/crates/services/p2p/src/peer_manager.rs
Line 133 in b2b5b3c
The text was updated successfully, but these errors were encountered: