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]: Specifying an empty account sequence and valid account number is considered valid for client context #15953

Closed
chatton opened this issue Apr 26, 2023 · 3 comments · Fixed by #16075
Labels

Comments

@chatton
Copy link
Contributor

chatton commented Apr 26, 2023

Summary of Bug

When the account sequence is zero but the account number is non zero, the tx will always fail here.

with account sequence mismatch, expected X got 0

I would expect an error to occur when validating the client context in this siuation.

See this comment for full details.

Version

v0.47.1

Steps to Reproduce

Create a client context with a non 0 account number and an account sequence of 0 and provide it to BroadcastTx

@alexanderbez
Copy link
Contributor

@chatton where do you expect an error to be triggered in the client code? TBH, I'm not sure why the || was changed to a &&.

@chatton
Copy link
Contributor Author

chatton commented Apr 26, 2023

Actually it might make sense to just populate the sequence if we have the account number.

cc @colin-axner

@julienrbrt
Copy link
Member

julienrbrt commented Apr 26, 2023

TBH, I'm not sure why the || was changed to a &&.

It was changed to && because in offline mode it would actually make a query (#15123). The check here https://github.com/cosmos/cosmos-sdk/pull/15123/files#diff-1bf4d968b3fc3ed4c599df25aa47747ae29dfde84244f1f2e24916581a060bcdR68-R75 could have been sufficient if we checked for 0 value there however I think.

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.

4 participants