-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
x/ibc: gRPC query service #6466
Conversation
This pull request introduces 2 alerts when merging e82f809 into 257354d - view on LGTM.com new alerts:
|
This pull request introduces 4 alerts when merging 447b0e5 into cb6c552 - view on LGTM.com new alerts:
|
This pull request introduces 4 alerts when merging 20c6b7a into dcd5781 - view on LGTM.com new alerts:
|
This pull request introduces 4 alerts when merging 2296bb7 into 7c0fa69 - view on LGTM.com new alerts:
|
This pull request introduces 4 alerts when merging 774185e into 98a3645 - view on LGTM.com new alerts:
|
Codecov Report
@@ Coverage Diff @@
## master #6466 +/- ##
==========================================
+ Coverage 57.30% 57.52% +0.21%
==========================================
Files 491 493 +2
Lines 29470 29539 +69
==========================================
+ Hits 16889 16991 +102
+ Misses 11372 11336 -36
- Partials 1209 1212 +3 |
…o fedekunze/ibc-grpc
remove buf file plz |
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.
left lots of suggestions, I'm open ears to doing some of the suggested changes in a followup pr since I think there will still need some refactor of cli stuff to be done. Some of my suggestions got outdated as I understood the entire pr, I'm going to leave them, but comment and resolve with the answer to them in case other reviewers have the same q
func() { | ||
_, _, _, _, channelA, _ := suite.coordinator.Setup(suite.chainA, suite.chainB) | ||
ack := types.NewPacketAckCommitment(channelA.PortID, channelA.ID, 1, []byte("hash")) | ||
suite.chainA.App.IBCKeeper.ChannelKeeper.SetPacketAcknowledgement(suite.chainA.GetContext(), channelA.PortID, channelA.ID, 1, ack.Hash) |
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.
So I think UnrelayedPackets might not be working as intended. Basically we want a query function that can indicate if given a list of packet commitment sequences:
- does the packet commitment need to be relayed? (no ack exists)
- does the ack need to be relayed? (ack exists and packet commitment exists)
looking at this test, an ack is set, but no packet commitment is created for the corresponding ack (ack has been relayed, packet cycle complete), so the sequences returned should be empty.
It's probably best to split the unrelayed packets into two funcs to avoid confusion or just add a bool in the request.
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.
It's probably best to split the unrelayed packets into two funcs to avoid confusion or just add a bool in the request.
Do you want to split the command as well?
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.
yea that sounds good, a bool flag could work as well. Whichever is easier
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.
bool flag might be easier:
gaia q ibc channel unrelayed-packets --acknowledgements true
would return all unrelayed acknowledgements
Co-authored-by: colin axner <[email protected]>
…o fedekunze/ibc-grpc
seqStrs := strings.Split(args[2], ",") | ||
|
||
seqs := make([]uint64, len(seqStrs)) | ||
seqSlice, err := cmd.Flags().GetInt64Slice(flagSequences) |
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.
ah I meant if the sequence flag is unused that the default behaviour is to query for the packet commitments and supply them as the sequence arg. This can be done in a followup pr though
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.
loogs good @fedekunze , added a few comments
|
||
page, _ := cmd.Flags().GetInt(flags.FlagPage) | ||
limit, _ := cmd.Flags().GetInt(flags.FlagLimit) | ||
page, err := cmd.Flags().GetInt(flags.FlagPage) |
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.
Page
is confusing, we might need to introduce Offset
flag
page, err := cmd.Flags().GetInt(flags.FlagPage) | |
offset, err := cmd.Flags().GetInt(flags.FlagOffset) |
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.
FlagOffset
is not defined. We should also add a FlagPaginationKey
👍
} | ||
|
||
// Connections implements the Query/Connections gRPC method | ||
func (q Keeper) Connections(c context.Context, req *types.QueryConnectionsRequest) (*types.QueryConnectionsResponse, error) { |
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.
Do we have any filters for Connections? May be would be good to introduce them.
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.
I agree, not in this PR tho 👍
Description
ref: #5921
TODO:
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorer