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

ABCI query should use Request Height not Context height in setting query height #9433

Closed
4 tasks
colin-axner opened this issue Jun 1, 2021 · 4 comments · Fixed by #9879
Closed
4 tasks

Comments

@colin-axner
Copy link
Contributor

colin-axner commented Jun 1, 2021

Summary

ABCI query should use the request height not the context height

Related to: 7ba386f

Problem Definition

The current ABCI query sets the opts to use a height from the context height. From my understanding, this is incorrect behaviour. It should use req.Height in the same way it uses req.Prove to set the Prove value for ABCIQueryWithOptions. I believe the current request height value is unused, which is misleading.

This lead to a bug in the helper function exposed from the IBC module. It set the request height correctly, but the context height was incorrectly set (since it was never assumed to be used)

Proposal

Change to use req.Height. This may have implications for dependencies which rely on the context height instead of the request height


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alexanderbez
Copy link
Contributor

Your reasoning sounds correct to me 👍

@robert-zaremba
Copy link
Collaborator

oh, so we were always responding based on the "latest" state, not the requested state?

@alexanderbez
Copy link
Contributor

I believe we were always using the Context's height, which when zero, uses the latest height/state. However, when a specific height is requested, I don't think it worked in specific query paths. Correct me if I'm wrong @colin-axner

@colin-axner
Copy link
Contributor Author

I believe we were always using the Context's height, which when zero, uses the latest height/state. However, when a specific height is requested, I don't think it worked in specific query paths.

This is correct. The height field in the request was unused and it instead relied solely on the context height

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

Successfully merging a pull request may close this issue.

4 participants