-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Return transactions in blocks #3729
Comments
This seems like a pretty common sense feature request. |
You can query txs by height, it’s just not documented |
In that case I'm going to backlog this issue as it can be done with two requests. |
I try to call this endpoint, but it seems unexist. On testnet: gaia-13003. |
It's weird, but I just calculate the txid from encoded raw transaction data. And I call the |
@fedekunze |
Hello,how to calculate the txid from encoded raw transaction data? |
@jackzampolin more people seem to create hacks around this issue. Should this maybe be implemented? |
@ruanqunfeng you misspelled height. There are two endpoints in question here:
So (1) is just a simple request proxy to the Tendermint RPC. What we can do is simply take the response and decode the txs for the user like we do in (2). |
This would be extremely helpful! |
second this please!! |
|
## Description Closes: #3729 - adds a new query to the tx service in Auth, which gets block information + decoded txs - added a new function to get the protoBlock from the node. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
## Description Closes: #3729 - adds a new query to the tx service in Auth, which gets block information + decoded txs - added a new function to get the protoBlock from the node. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit dd65ef8) # Conflicts: # CHANGELOG.md # api/cosmos/group/v1beta1/types.pulsar.go # api/cosmos/tx/v1beta1/service.pulsar.go # api/cosmos/tx/v1beta1/service_grpc.pb.go # client/grpc/tmservice/block.go # testutil/testdata_pulsar/query.pulsar.go # testutil/testdata_pulsar/testdata.pulsar.go # testutil/testdata_pulsar/tx.pulsar.go # testutil/testdata_pulsar/unknonwnproto.pulsar.go # types/tx/service.pb.go
…11248) * feat: include transactions in QueryBlockByHeight (#10880) ## Description Closes: #3729 - adds a new query to the tx service in Auth, which gets block information + decoded txs - added a new function to get the protoBlock from the node. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit dd65ef8) # Conflicts: # CHANGELOG.md # api/cosmos/group/v1beta1/types.pulsar.go # api/cosmos/tx/v1beta1/service.pulsar.go # api/cosmos/tx/v1beta1/service_grpc.pb.go # client/grpc/tmservice/block.go # testutil/testdata_pulsar/query.pulsar.go # testutil/testdata_pulsar/testdata.pulsar.go # testutil/testdata_pulsar/tx.pulsar.go # testutil/testdata_pulsar/unknonwnproto.pulsar.go # types/tx/service.pb.go * fix conflicts * remove pulsar Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com> Co-authored-by: marbar3778 <marbar3778@yahoo.com>
…) (cosmos#11248) * feat: include transactions in QueryBlockByHeight (cosmos#10880) ## Description Closes: cosmos#3729 - adds a new query to the tx service in Auth, which gets block information + decoded txs - added a new function to get the protoBlock from the node. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit dd65ef8) # Conflicts: # CHANGELOG.md # api/cosmos/group/v1beta1/types.pulsar.go # api/cosmos/tx/v1beta1/service.pulsar.go # api/cosmos/tx/v1beta1/service_grpc.pb.go # client/grpc/tmservice/block.go # testutil/testdata_pulsar/query.pulsar.go # testutil/testdata_pulsar/testdata.pulsar.go # testutil/testdata_pulsar/tx.pulsar.go # testutil/testdata_pulsar/unknonwnproto.pulsar.go # types/tx/service.pb.go * fix conflicts * remove pulsar Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com> Co-authored-by: marbar3778 <marbar3778@yahoo.com>
…) (cosmos#11248) * feat: include transactions in QueryBlockByHeight (cosmos#10880) ## Description Closes: cosmos#3729 - adds a new query to the tx service in Auth, which gets block information + decoded txs - added a new function to get the protoBlock from the node. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit dd65ef8) # Conflicts: # CHANGELOG.md # api/cosmos/group/v1beta1/types.pulsar.go # api/cosmos/tx/v1beta1/service.pulsar.go # api/cosmos/tx/v1beta1/service_grpc.pb.go # client/grpc/tmservice/block.go # testutil/testdata_pulsar/query.pulsar.go # testutil/testdata_pulsar/testdata.pulsar.go # testutil/testdata_pulsar/tx.pulsar.go # testutil/testdata_pulsar/unknonwnproto.pulsar.go # types/tx/service.pb.go * fix conflicts * remove pulsar Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com> Co-authored-by: marbar3778 <marbar3778@yahoo.com>
…) (cosmos#11248) * feat: include transactions in QueryBlockByHeight (cosmos#10880) ## Description Closes: cosmos#3729 - adds a new query to the tx service in Auth, which gets block information + decoded txs - added a new function to get the protoBlock from the node. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit dd65ef8) # Conflicts: # CHANGELOG.md # api/cosmos/group/v1beta1/types.pulsar.go # api/cosmos/tx/v1beta1/service.pulsar.go # api/cosmos/tx/v1beta1/service_grpc.pb.go # client/grpc/tmservice/block.go # testutil/testdata_pulsar/query.pulsar.go # testutil/testdata_pulsar/testdata.pulsar.go # testutil/testdata_pulsar/tx.pulsar.go # testutil/testdata_pulsar/unknonwnproto.pulsar.go # types/tx/service.pb.go * fix conflicts * remove pulsar Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com> Co-authored-by: marbar3778 <marbar3778@yahoo.com>
…) (cosmos#11248) * feat: include transactions in QueryBlockByHeight (cosmos#10880) ## Description Closes: cosmos#3729 - adds a new query to the tx service in Auth, which gets block information + decoded txs - added a new function to get the protoBlock from the node. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit dd65ef8) # Conflicts: # CHANGELOG.md # api/cosmos/group/v1beta1/types.pulsar.go # api/cosmos/tx/v1beta1/service.pulsar.go # api/cosmos/tx/v1beta1/service_grpc.pb.go # client/grpc/tmservice/block.go # testutil/testdata_pulsar/query.pulsar.go # testutil/testdata_pulsar/testdata.pulsar.go # testutil/testdata_pulsar/tx.pulsar.go # testutil/testdata_pulsar/unknonwnproto.pulsar.go # types/tx/service.pb.go * fix conflicts * remove pulsar Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com> Co-authored-by: marbar3778 <marbar3778@yahoo.com>
…) (cosmos#11248) * feat: include transactions in QueryBlockByHeight (cosmos#10880) Closes: cosmos#3729 - adds a new query to the tx service in Auth, which gets block information + decoded txs - added a new function to get the protoBlock from the node. --- *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit dd65ef8) * fix conflicts * remove pulsar Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com> Co-authored-by: marbar3778 <marbar3778@yahoo.com>
…) (cosmos#11248) * feat: include transactions in QueryBlockByHeight (cosmos#10880) ## Description Closes: cosmos#3729 - adds a new query to the tx service in Auth, which gets block information + decoded txs - added a new function to get the protoBlock from the node. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit dd65ef8) # Conflicts: # CHANGELOG.md # api/cosmos/group/v1beta1/types.pulsar.go # api/cosmos/tx/v1beta1/service.pulsar.go # api/cosmos/tx/v1beta1/service_grpc.pb.go # client/grpc/tmservice/block.go # testutil/testdata_pulsar/query.pulsar.go # testutil/testdata_pulsar/testdata.pulsar.go # testutil/testdata_pulsar/tx.pulsar.go # testutil/testdata_pulsar/unknonwnproto.pulsar.go # types/tx/service.pb.go * fix conflicts * remove pulsar Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com> Co-authored-by: marbar3778 <marbar3778@yahoo.com>
Summary
We should return the transactions in a block when querying
GET /blocks/{height}
.Problem Definition
Currently the txs inside the response are base64 as the response comes from Tendermint. The transactions should at least be their hashes so that we don't mix content and the response is easy to parse.
Better would be to directly return the transactions as part of the response. The assumption is, that apps querying for blocks will mostly include some information about the blocks in it.
Alternative: Is it possible to query all transactions by height?
Proposal
Decode the raw Tendermint txs in
data.txs
tosdk.StdTx
s in the/blocks/{height}
query.For Admin Use
The text was updated successfully, but these errors were encountered: