-
Notifications
You must be signed in to change notification settings - Fork 636
indexer-respect-height-params-on-query #1436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
indexer-respect-height-params-on-query #1436
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass minor review, the team will review the logic change ASAP.
### BUG FIXES | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### BUG FIXES |
@@ -0,0 +1,3 @@ | |||
### BUG FIXES | |||
|
|||
- `[state/indexer]` Respect both height params while quering for events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ensure there's a link to this PR at the end of the changelog entry line, e.g. https://github.com/cometbft/cometbft/blob/58cfaf973bcd88808e130ea454fe7fc5015e3078/.changelog/unreleased/enhancements/1096-state-background-pruning.md
@kstoykov we generally do not submit PRs to specific release branches. We usually submit them to |
@thanethomson should I close this PR and make a new one to main branch? |
@@ -87,14 +87,13 @@ func (qr QueryRange) UpperBoundValue() interface{} { | |||
func LookForRangesWithHeight(conditions []query.Condition) (queryRange QueryRanges, indexes []int, heightRange QueryRange) { | |||
queryRange = make(QueryRanges) | |||
for i, c := range conditions { | |||
heightKey := false | |||
heightKey := c.CompositeKey == types.BlockHeightKey || c.CompositeKey == types.TxHeightKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heightKey := c.CompositeKey == types.BlockHeightKey || c.CompositeKey == types.TxHeightKey | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why I removed it here before the RangeOperation
check is that it might still be a height
key but not a range operation. That is then yet another special case we need to handle. Otherwise the fix is legit ,thanks a lot for catching and fixing this!
queryRange = make(QueryRanges) | ||
for i, c := range conditions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
queryRange = make(QueryRanges) | |
for i, c := range conditions { | |
queryRange = make(QueryRanges) | |
heightKey := false | |
for i, c := range conditions { |
Hi, yes, we need this bugfix in main, so please submit it there, we'll backport it then. Thank you for this! |
I had to create a new branch (therefore and a new PR) in order to fix the bug on main branch. The new PR is: #1529 |
Closes #1435
PR checklist
.changelog
(we use unclog to manage our changelog)docs/
orspec/
) and code comments