Files
pezkuwi-subxt/substrate/client
Max Inden 62d551a063 client/network/req-resp: Prevent request id collision (#7957)
* client/network/req-resp: Add unit test for request id collision

* client/network/req-resp: Prevent request id collision

`RequestId` is a monotonically increasing integer, starting at
`1`. A `RequestId` is unique for a single `RequestResponse`
behaviour, but not across multiple `RequestResponse` behaviours. Thus
when handling `RequestId` in the context of multiple
`RequestResponse` behaviours, one needs to couple the protocol name
with the `RequestId` to get a unique request identifier.

This commit ensures that pending requests (`pending_requests`) and
pending responses (`pending_response_arrival_time`) are tracked both by
their protocol name and `RequestId`.

* client/network/req-resp: Remove unused import

* client/network/req-resp: Introduce ProtocolRequestId struct

* client/network/req-resp: Update test doc comment

Treat `RequestId` as an opaque type.

* client/network/req-resp: Improve expect proof
2021-01-25 13:09:45 +00:00
..
2021-01-12 09:25:47 +01:00
2021-01-12 09:25:47 +01:00
2021-01-20 12:28:56 +01:00
2021-01-24 17:45:08 +00:00
2021-01-21 13:12:42 +01:00
2021-01-20 12:28:56 +01:00
2021-01-12 09:25:47 +01:00
2021-01-12 09:25:47 +01:00
2021-01-04 09:03:13 +00:00
2021-01-20 12:28:56 +01:00
2021-01-20 12:28:56 +01:00