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

Implement query packet pending command #1862

Closed
mzabaluev opened this issue Feb 9, 2022 · 8 comments · Fixed by #2096
Closed

Implement query packet pending command #1862

mzabaluev opened this issue Feb 9, 2022 · 8 comments · Fixed by #2096
Assignees
Labels
I: CLI Internal: related to the relayer's CLI O: usability Objective: cause to improve the user experience (UX) and ease using the product
Milestone

Comments

@mzabaluev
Copy link
Contributor

mzabaluev commented Feb 9, 2022

Add a hermes query packet subcommand that shows all pending packets for a channel at both ends.

Originally posted by @ancazamfir in #1834 (comment)

@mzabaluev mzabaluev added I: CLI Internal: related to the relayer's CLI O: usability Objective: cause to improve the user experience (UX) and ease using the product labels Feb 9, 2022
@adizere adizere added this to the v0.12.1 milestone Feb 14, 2022
@adizere adizere added the P-high label Feb 22, 2022
@adizere adizere modified the milestones: v0.13.0, v0.14.0 Mar 24, 2022
@romac romac changed the title Implement query packets command Implement query packet pending command Apr 7, 2022
@mzabaluev
Copy link
Contributor Author

I need some more clue on how the pending packets should be represented in the output of the command.

If this command is to display packets pending at both ends of a channel, should the output:

  1. provide a structured representation of the queues at each end as named fields; or
  2. dump all packets in a flat list, but include the information about the chain the packets are pending on?

Cc @mircea-c @ancazamfir

@ancazamfir
Copy link
Collaborator

I think 1. @mircea-c should have a big say here.
For me, the problem with the current CLIs is that a lot of concentration is required to figure things out.
I usually do:

  • query local commitments
  • query unreceived packets on counterparty
  • query unreceived acks locally

And obtain something like this:

pending_local_commitments: [1, 2, 3]
not_received_on_counterparty: [2, 3]
received_on_counterparty_but_not_acked_locally: [1]

Then repeat the same for the other side. It would be nice to have ^ with one CLI.

The other problem with the current CLIs is with the formatting, we display one sequence per line. When there are tens/ hundreds of packets the output is pretty much useless without some extra parsing. Something like this would be nice for human eyes:

pending_local_commitments: [100-200, 202, 207]
not_received_on_counterparty: [150-200, 202, 207]
received_on_counterparty_but_not_acked_locally: [100-149]

But then probably not good for tooling/ automation.

@mzabaluev
Copy link
Contributor Author

@ancazamfir So it seems that in addition to the directionality information, the output would classify pending packets by kind. Should there be any details on the packet items themselves, or just IDs, possibly collated as you suggest?

But then probably not good for tooling/ automation.

We've got the JSON mode for that, so we can make it nice for the Debug impl.

@ancazamfir
Copy link
Collaborator

@ancazamfir So it seems that in addition to the directionality information, the output would classify pending packets by kind. Should there be any details on the packet items themselves, or just IDs, possibly collated as you suggest?

just IDs imo. collated would be great!

But then probably not good for tooling/ automation.

We've got the JSON mode for that, so we can make it nice for the Debug impl.

perfect!

@mircea-c
Copy link

I think what @ancazamfir suggested is excellent. It gets my vote.

@mzabaluev
Copy link
Contributor Author

pending_local_commitments: [1, 2, 3]
not_received_on_counterparty: [2, 3]
received_on_counterparty_but_not_acked_locally: [1]

@ancazamfir As the first set is strictly a union of the other two, do we need to display it? Perhaps in text mode, but for JSON it would be redundant information.

@mzabaluev
Copy link
Contributor Author

I'm implementing this as another subcommand of query packet, tentatively named pending as suggested by @romac. This will show a structured summary of unreceived-acks and unreceived-packets queries in both directions, where each commitment set is assigned to the channel end where the commitments are pending.

Meanwhile, we could continue redesigning the CLI so that this new command supersedes the more elementary commitments, unreceived-acks, and unreceived-packets, with some flags to select portions of the information if needed.

@ancazamfir
Copy link
Collaborator

@ancazamfir As the first set is strictly a union of the other two, do we need to display it? Perhaps in text mode, but for JSON it would be redundant information.

sure, we can have that in text mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: CLI Internal: related to the relayer's CLI O: usability Objective: cause to improve the user experience (UX) and ease using the product
Projects
No open projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

4 participants