-
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
feat: include transactions in QueryBlockByHeight #10880
Conversation
x/auth/client/testutil/suite.go
Outdated
s.Require().NoError(s.network.WaitForNextBlock()) | ||
height, err := s.network.LatestHeight() | ||
s.Require().NoError(err) | ||
_, err = s.network.WaitForHeight(height + 2) // this test fails unless we wait a couple blocks for some reason? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really odd side effect form this PR - had to make this test wait a couple blocks, else it fails with an error of not being able to find the tx related to the hash passed in...
@@ -7,6 +7,7 @@ import "tendermint/p2p/types.proto"; | |||
import "tendermint/types/block.proto"; | |||
import "tendermint/types/types.proto"; | |||
import "cosmos/base/query/v1beta1/pagination.proto"; | |||
import "cosmos/tx/v1beta1/tx.proto"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one question I have is that the tmservice is meant to be a simple proxy to TM, and not app-specific. I'm not sure it should do tx decoding.
For example, the /txs
endpoint to fetch txs, exposed by tendermint, is not in this tmservice, but in the Tx service. That's imo the service that decodes txs. I'm wondering if we shouldn't create a new GetBlockWithTxs there. (it's also where the protoTxProvider
is currently used).
any thoughts @alexanderbez @technicallyty ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree here @AmauryM. I don't think we should be adding custom business logic to TM proxy endpoints. I think that's a good point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i was thinking this as well. maybe a solution could be to add a query string to the request for decoding, something like: GET block/{height}?decode_txs=true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pinging here - any thoughts on previous comment? @alexanderbez @AmauryM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I don't think we should modify Tendermint proxy queries. This should be an entirely new query/route. I believe this is what @AmauryM was suggesting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, same, I think tx.Tx
should not appear in this query.proto file.
bump on this. any chance we can get this in the 0.46 release @technicallyty |
heya, i was considering if this PR really makes sense. I was looking into the tx proto's and i wasn't sure if it really makes sense to include block information here. i think it makes the most sense to just suggest to users to do the but if there's disagreement there i can proceed with this PR |
The |
d3749f8
to
efcd78f
Compare
Codecov Report
@@ Coverage Diff @@
## master #10880 +/- ##
==========================================
- Coverage 66.07% 66.00% -0.07%
==========================================
Files 662 659 -3
Lines 68217 68007 -210
==========================================
- Hits 45071 44890 -181
+ Misses 20527 20509 -18
+ Partials 2619 2608 -11
|
okay i've implemented the endpoint in the tx service w tests. r4r now @AmauryM @marbar3778 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, I also think pagination is useful here
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
added quite a bit of code for the pagination stuff. Normally I just pass the pagination to the query but with the way this query works, I had to do it sorta manually... would appreciate another round of reviews due to the amount of logic added here! @AmauryM @marbar3778 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, small nits left
Feel free to automerge at will.
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
## 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) ## 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>
Description
Closes: #3729
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
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...
!
in the type prefix if API or client breaking change