fix: getEvents queries with not existing block number should be bounded to [0,latest] #2963
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.
Current approach was upon receiving query on
getEvents
withto_block
greater than the height, we were bounding the range to [0, Pending] but Pending block does not have blocknumber and this behavior might be confusing for some user. What they experience is for such queries they are receiving some events for non-existing block and response does not specifies block number for such events since Pending block does not have block number. With this PR, queries with block numbers will be bounded in range [0, latest] and pending block events will be only returned when it is explicity queried withpending
orpre_confirmed
tag.Closes #2955