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

[BUG] Height param is not supported on private full nodes, but it works on public lcd.terra.dev endpoint #668

Closed
Zygimantass opened this issue Jan 25, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@Zygimantass
Copy link

Describe the bug

Height param on wasm/contracts/<address>/store REST endpoint doesn't work on private full nodes, but works on lcd.terra.dev and gRPC endpoint. However, the header x-cosmos-block-height: <height> works on both private full nodes and on the public endpoint. For consistency's sake, it would be better to support the height param on the private full nodes too.

To Reproduce
localhost:1317/terra/wasm/v1beta1/contracts/terra1jxazgm67et0ce260kvrpfv50acuushpjsz2y0p/store?height=6162743&query_msg=eyJwb29sIjoge319 produces a response with total_share: 590548093388 (among other things).
localhost:1317/terra/wasm/v1beta1/contracts/terra1jxazgm67et0ce260kvrpfv50acuushpjsz2y0p/store?height=5138774&query_msg=eyJwb29sIjoge319 (notice the different height), also produces a response with total_share: 590548093388, which doesn't make sense because there is a height difference of almost a million.

The same queries to the lcd.terra.dev endpoint produces different total_share amounts.

Context & versions
Tested on private full node versions 0.5.13 and 0.5.14

(if applicable) suggested solution
Add the height param to all of the queries in the public build of Terra

@Zygimantass Zygimantass added the bug Something isn't working label Jan 25, 2022
@yun-yeo
Copy link
Contributor

yun-yeo commented Feb 1, 2022

Did you change app.toml to keep whole state??

You need to set pruning option to nothing to use height query.

@lukanus
Copy link

lukanus commented Feb 2, 2022

@YunSuk-Yeo this shouldn't matter. The data is there, node is returning the data just fine using cosmos height header @Zygimantass has mentioned. The problem is that height GET parameter is not taken into the account as it's never parsed. Eg. setting height in query string to "asdf" is not returning bad formatting error either.

@yun-yeo
Copy link
Contributor

yun-yeo commented Feb 3, 2022

ah ok understood, this problem is already known problem
issue: cosmos/cosmos-sdk#10826
PR: cosmos/cosmos-sdk#10827

@yun-yeo yun-yeo closed this as completed Feb 3, 2022
@yun-yeo yun-yeo reopened this Feb 3, 2022
@yun-yeo
Copy link
Contributor

yun-yeo commented Feb 3, 2022

This cosmos-sdk fix already merged in our custom cosmos-sdk https://github.com/terra-money/cosmos-sdk/commits/v0.44.5-terra.2, so main branch should be find for this. I will create new tag today.

public LCD is using our latest branch which is including custom cosmos-sdk update.
terra-money/cosmos-sdk@689fcee

@yun-yeo yun-yeo closed this as completed Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants