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(CLI)]: query block can no longer be used to get the most recent block #21081

Closed
1 task done
SpicyLemon opened this issue Jul 25, 2024 · 5 comments · Fixed by #21084
Closed
1 task done

[Bug(CLI)]: query block can no longer be used to get the most recent block #21081

SpicyLemon opened this issue Jul 25, 2024 · 5 comments · Fixed by #21084
Assignees

Comments

@SpicyLemon
Copy link
Collaborator

SpicyLemon commented Jul 25, 2024

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

$ simd query block
Error: accepts 1 arg(s), received 0
...

This command used to allow zero args as a way to get the most recent block.

It also used to default to taking in the height, but now defaults to hash, which was a breaking change.

Cosmos SDK Version

v0.50.7

How to reproduce?

No response

@SpicyLemon
Copy link
Collaborator Author

Related: #14659

@SpicyLemon SpicyLemon changed the title [Bug]: query block can no longer be used to get the most recent block [Bug(CLI)]: query block can no longer be used to get the most recent block Jul 26, 2024
@julienrbrt julienrbrt self-assigned this Jul 26, 2024
@julienrbrt
Copy link
Member

Hi! The breaking change was mentioned in the changelog: https://github.com/cosmos/cosmos-sdk/pull/14659/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR263.

However we can bring back the no argument behavior!

@SpicyLemon
Copy link
Collaborator Author

The breaking entry isn't really helpful. It both says that the command was removed, but that it still exists. And it doesn't mention that the height/hash is now required and that in order to provide a height, you now have to include --type height.

The --type flag should also default to height. That, combined with making the arg optional would make the command behave exactly like it did before, but with the added ability to get a block by its hash.

@SpicyLemon
Copy link
Collaborator Author

SpicyLemon commented Jul 26, 2024

Also, I just noticed that the hash fields from that command are now base64 encoded rather than hex. Hex is better for those because that's how those hashes are always referred to.

The addresses in the results are also base64 encoded which isn't how addresses are ever used.

@julienrbrt
Copy link
Member

The --type flag should also default to height. That, combined with making the arg optional would make the command behave exactly like it did before, but with the added ability to get a block by its hash.

We can't do that. That would be breaking in a patch version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🥳 Done
Development

Successfully merging a pull request may close this issue.

2 participants