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]: Querying a pruned height returns a generic error code #19992

Closed
1 task done
gibson042 opened this issue Apr 9, 2024 · 0 comments · Fixed by #19993
Closed
1 task done

[Bug]: Querying a pruned height returns a generic error code #19992

gibson042 opened this issue Apr 9, 2024 · 0 comments · Fixed by #19993
Labels

Comments

@gibson042
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

When trying to query anything with a --height that is pruned, the response is an error with codespace "sdk" and code 18 ("invalid request") as seen in e.g. Agoric/agoric-sdk#9033 . This is the same code as is used for responding to a proof-covered query when height <= 1, but unlike that case, the client's request is not invalid—rather, it is unserviceable due to server-side state that is not known a priori. As such, the response should indicate that difference by not reusing the code.

Looking at types/errors/errors.go, code 38 ("not found") or possibly code 26 ("invalid height") would seem more appropriate (but of the two, I much prefer "not found" because "invalid height" is already used for request height > lastBlockHeight, which like height <= 1 is actually a problem on the client side.

Cosmos SDK Version

0.50.5, main

How to reproduce?

Query a node with --height <pruned_height_number> for a pruned block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant