This repository was archived by the owner on Nov 15, 2023. It is now read-only.
client/network/req-resp: Prevent request id collision#7957
Merged
6 commits merged intoparitytech:masterfrom Jan 25, 2021
Merged
client/network/req-resp: Prevent request id collision#79576 commits merged intoparitytech:masterfrom
6 commits merged intoparitytech:masterfrom
Conversation
`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`.
romanb
approved these changes
Jan 22, 2021
Contributor
romanb
left a comment
There was a problem hiding this comment.
I only left minor comments / suggestions. Overall looks good to me!
pepyakin
approved these changes
Jan 23, 2021
Contributor
pepyakin
left a comment
There was a problem hiding this comment.
I haven't checked the code, however, I did rerun the test. All 3 validators are running fine on my localnet for a little bit more than one day.
bkchr
reviewed
Jan 24, 2021
Contributor
Author
|
Thanks everyone for the testing and reviews! Very much appreciated. Judging by the comments / emojis / resolved conversations all suggestions have been addressed, thus I am merging here. In case there is anything else missing I am happy to create another pull request. |
Contributor
Author
|
bot merge |
|
Trying merge. |
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RequestIdis a monotonically increasing integer, starting at1. ARequestIdis unique for a singleRequestResponsebehaviour, but not across multiple
RequestResponsebehaviours. Thuswhen handling
RequestIdin the context of multipleRequestResponsebehaviours, one needs to couple the protocol namewith the
RequestIdto get a unique request identifier.This commit ensures that pending requests (
pending_requests) andpending responses (
pending_response_arrival_time) are tracked both bytheir protocol name and
RequestId.Fixes paritytech/polkadot#2307.