-
Notifications
You must be signed in to change notification settings - Fork 331
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
Txs endpoint returns error on range operators #2098
Comments
Thanks @nieejl for the extremely detailed issue. I'm still investigating but sharing notes that I'll continue to update:
|
related to cosmos-sdk i believe. |
Great point! The working example here uses gaiad v10.0.2 which is on cosmos-sdk v0.45.16-ics. Relevant PR cosmos/cosmos-sdk#12474 and backport cosmos/cosmos-sdk#13598 which appears to be first released in cosmos-sdk v0.46.4. |
While debugging #2098 I frequently applied this patch to previous releases. Since these scripts exist for development purposes, I think it would save devs time by always enabling the API.
While debugging celestiaorg/celestia-app#2098 I frequently applied this patch to previous releases. Since these scripts exist for development purposes, I think it would save devs time by always enabling the API.
Summary of Bug
Endpoint to query transactions, fails when defining height ranges on transactions (tx).
Path: /cosmos/tx/v1beta1/txs
Tendermint has support for range queries using the >= and <= operators. Supported formats are described here: https://docs.tendermint.com/v0.34/rpc/#/Websocket/subscribe
Until recently (v. 0.34.20 , possibly later), this worked for Celestia nodes as well, but seems to be broken in v.0.34.28. This seems to have changed after the update to mocha-3.
Adding a filter for <= 11140, is expected to return all transactions where the height is less than 11140, but instead returns an error.
https://api-mocha.pops.one/cosmos/tx/v1beta1/txs?events=message.sender=%27celestiavaloper1amm0umxqxxw8j2q60x78xs32s089606sdmvx92%27&events=tx.height%3C=11140
Output:
I included a number of example queries below, to rule out some sources of error, and to showcase expected behavior:
Removing less than operator, returns the correct result:
https://api-mocha.pops.one/cosmos/tx/v1beta1/txs?events=message.sender=%27celestiavaloper1amm0umxqxxw8j2q60x78xs32s089606sdmvx92%27&events=tx.height=11137
Node similar to pops node which fails on same query, to rule out any configuration issues:
https://api-t.celestia.nodestake.top/cosmos/tx/v1beta1/txs?events=message.sender=%27celestiavaloper1amm0umxqxxw8j2q60x78xs32s089606sdmvx92%27&events=tx.height%3C=11140
Removing the range query, returns all transactions: https://api-mocha.pops.one/cosmos/tx/v1beta1/txs?events=message.sender=%27celestiavaloper1amm0umxqxxw8j2q60x78xs32s089606sdmvx92%27
Working example on a previous version (v 0.34.20): https://api.mocha.celestia.counterpoint.software/cosmos/tx/v1beta1/txs?events=message.sender=%27celestiavaloper1amm0umxqxxw8j2q60x78xs32s089606sdmvx92%27&events=tx.height%3C=57700
Working example on cosmos node (using v.0.34.29) at time of writing:
https://cosmos-api.polkachu.com/cosmos/tx/v1beta1/txs?events=message.sender=%27cosmosvaloper1c4k24jzduc365kywrsvf5ujz4ya6mwympnc4en%27&events=tx.height%3E=15954604&events=tx.height%3C=15968451
Failure for multiple filters as well: https://api-t.celestia.nodestake.top/cosmos/tx/v1beta1/txs?events=message.sender=%27celestiavaloper1amm0umxqxxw8j2q60x78xs32s089606sdmvx92%27&events=tx.height%3C=11140&events=tx.height%3E=11100
Version
0.34.28
Steps to Reproduce
Enter the below link in a browser:
https://api-mocha.pops.one/cosmos/tx/v1beta1/txs?events=message.sender=%27celestiavaloper1amm0umxqxxw8j2q60x78xs32s089606sdmvx92%27&events=tx.height%3C=11140
For Admin Use
The text was updated successfully, but these errors were encountered: