Skip to content

kvindexer/0.34/bugfixes in range queries and result deduplication#9884

Closed
jmalicevic wants to merge 8 commits intov0.34.xfrom
jasmina/kvindexer-fix-0.34
Closed

kvindexer/0.34/bugfixes in range queries and result deduplication#9884
jmalicevic wants to merge 8 commits intov0.34.xfrom
jasmina/kvindexer-fix-0.34

Conversation

@jmalicevic
Copy link
Contributor

@jmalicevic jmalicevic commented Dec 15, 2022

This PR fixes two bugs when matching attributes within events:

  • When multiple events match in the same transaction or block, the query would return multiple times the same result.
  • When the query contains a height range and another range, the height range would get ignored under certain conditions.
  • A query containing both a height range and height equality would process them both. Now the equality is ignored when a range exists.
  • Queries containing CONTAINS and EXISTS would ignore the height requirement when match.events = 1.

There have been minor improvements to the readability of the code:

  • As we need to know the height range or the requested height to match events at and both whether the height related conditions are the only ones (beside match.events), there is now a heightInfo struct that encapsulates all of that. Additionally, spuradious checks on whether the length of the conditions is a certain number has been replaced with simple bool flags which are derived within the dedupHeight method.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C:indexer Component: Indexer stale for use by stalebot T:bug Type Bug (Confirmed)

Projects

Status: Done/Merged

Development

Successfully merging this pull request may close these issues.

2 participants