8000 indexer-respect-height-params-on-query by kstoykov · Pull Request #1436 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Conversation

kstoykov
Copy link
Contributor
@kstoykov kstoykov commented Oct 5, 2023

Closes #1435


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments

@kstoykov kstoykov requested a review from a team as a code owner October 5, 2023 08:46
@andynog andynog requested a review from jmalicevic October 10, 2023 19:32
Copy link
Contributor
@thanethomson thanethomson left a 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.

Comment on lines +1 to +2
### BUG FIXES

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### BUG FIXES

@@ -0,0 +1,3 @@
### BUG FIXES

- `[state/indexer]` Respect both height params while quering for events
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thanethomson
Copy link
Contributor

@kstoykov we generally do not submit PRs to specific release branches. We usually submit them to main and then backport to the relevant release branches accordingly.

@kstoykov
Copy link
Contributor Author

@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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
heightKey := c.CompositeKey == types.BlockHeightKey || c.CompositeKey == types.TxHeightKey

Copy link
Contributor

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!

Comment on lines 88 to 89
queryRange = make(QueryRanges)
for i, c := range conditions {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
queryRange = make(QueryRanges)
for i, c := range conditions {
queryRange = make(QueryRanges)
heightKey := false
for i, c := range conditions {

@jmalicevic
Copy link
Contributor

@thanethomson should I close this PR and make a new one to main branch?

Hi, yes, we need this bugfix in main, so please submit it there, we'll backport it then. Thank you for this!

@kstoykov
Copy link
Contributor Author

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

@kstoykov kstoykov closed this Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants
< 2A69 /div>
0