Skip to content
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

Cannot search tags within a range of blocks #2759

Closed
fumecow opened this issue Nov 5, 2018 · 3 comments
Closed

Cannot search tags within a range of blocks #2759

fumecow opened this issue Nov 5, 2018 · 3 comments
Assignees
Labels
C:rpc Component: JSON RPC, gRPC T:bug Type Bug (Confirmed)
Milestone

Comments

@fumecow
Copy link

fumecow commented Nov 5, 2018

Tendermint version (use tendermint version or git rev-parse --verify HEAD if installed from source):
0.25.0-0c9c3292

Environment: LotionJS

  • OS (e.g. from /etc/os-release): Linux
  • Install tools: npm

What happened:

Issuing a query with an inequality comparison for tx.height results in a string comparison. Specific example is the following query:

tx_search?query="event='value' AND tx.height>=15"

results in matches:

15, 15545, 15555, 151808...

and the following query

tx_search?query="event='value' AND tx.height<100000"

returns an empty array []

What this means is that every attempt to query for tags within a range (which by definition includes a > and < operator) will return an empty array.

What you expected to happen:

tx.height should be compared as an integer so tags can be queried in a range of blocks. It appears that tx.height is stored as a string in the transaction which is perhaps the underlying problem:

{
        "hash": "75B0775C6003225B456F1975817DADB97B00F90A",
        "height": "154248",
        "index": 0,
...
}
@melekes melekes added the T:bug Type Bug (Confirmed) label Nov 5, 2018
@melekes
Copy link
Contributor

melekes commented Nov 5, 2018

Do you index tx.height tag? (config.toml#tx_index#index_tags / index_all_tags)

@fumecow
Copy link
Author

fumecow commented Nov 5, 2018

yes - index_all_tags is set

@ebuchman ebuchman added this to the v1.0 milestone Nov 7, 2018
@ebuchman ebuchman added the C:rpc Component: JSON RPC, gRPC label Nov 11, 2018
melekes added a commit that referenced this issue Nov 22, 2018
previously, it was returning a height even for range conditions: "height
< 10000".

Refs #2759
melekes added a commit that referenced this issue Nov 22, 2018
previously, it was returning a height even for range conditions: "height
< 10000".

Refs #2759
melekes added a commit that referenced this issue Nov 22, 2018
Modify lookForHeight to return a height only there's a equal operator.
Previously, it was returning a height even for range conditions: "height
< 10000".

Fixes #2759
ebuchman pushed a commit that referenced this issue Nov 27, 2018
Modify lookForHeight to return a height only there's a equal operator.
Previously, it was returning a height even for range conditions: "height
< 10000".

Fixes #2759
@ebuchman
Copy link
Contributor

Fixed on develop. Should be in v0.26.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:rpc Component: JSON RPC, gRPC T:bug Type Bug (Confirmed)
Projects
None yet
Development

No branches or pull requests

3 participants