Daemon RPC: high_height_ok req boolean field /getblocks.bin #9382
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.
Behavior before: when
req.start_height > chain tip
, response fails and the client is dropped and blockedBehavior after: when
req.high_height_ok && req.start_height > chain tip
, the server returns a successful empty block response that includes the chain heightThis is useful when firing parallel requests to scan the chain and the client doesn't initially know what the chain tip is. This avoids the client getting itself dropped when firing too high of a request.
The reason I implemented this new optional
high_height_ok
field rather than changing the default behavior to return a successful response when the request includes too high of a height is to maintain backwards compatibility with clients that perhaps currently rely on a failure response when requesting too high a height. Perhaps this is overkill and I could be convinced that making "high height ok" the server's default behavior (and not implementing the request field) is the better call.Used in the Seraphis lib async scanner: UkoeHB#23