Allow 1 count block request to return 0 blocks#5554
Merged
mergify[bot] merged 2 commits intosigp:unstablefrom Apr 12, 2024
Merged
Allow 1 count block request to return 0 blocks#5554mergify[bot] merged 2 commits intosigp:unstablefrom
mergify[bot] merged 2 commits intosigp:unstablefrom
Conversation
Member
|
@Mergifyio queue |
✅ The pull request has been merged automaticallyDetailsThe pull request has been merged automatically at 5fdd3b3 |
This was referenced Apr 12, 2024
5 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue Addressed
Noted the following bug in ReqResp logic:
RPCError::IncompleteStreamNot having a block or blob is tolerated as per the req resp spec. It's the downstream caller that should decide if the peer should have or not that specific element.
Proposed Changes
Rename
expected_responsestomax_responses, as for multiple responses that what the number really represents. The peer is allow to return less than the request count of elements, including 0.Add a new function
expect_exactly_one_responseto differentiate those request where closing the stream before the first element is actually a protocol violation (e.g. status method)I have reversed some of the if else cases, (from
if !condition A else Btoif condition B else A, but the actual logic is unchanged.Additional Info
Please provide any additional information. For example, future considerations
or information useful for reviewers.