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

Clear packets by specifying a range of sequence numbers to clear #3672

Closed
Tracked by #3750
romac opened this issue Oct 20, 2023 · 1 comment · Fixed by #3751
Closed
Tracked by #3750

Clear packets by specifying a range of sequence numbers to clear #3672

romac opened this issue Oct 20, 2023 · 1 comment · Fixed by #3751
Labels
O: new-feature Objective: cause to add a new feature or support
Milestone

Comments

@romac
Copy link
Member

romac commented Oct 20, 2023

Summary

Add a --packet-sequences=SEQS flag to the clear packets CLI for clearing only the packets with the given sequence numbers on the specified chain and channel.

Problem definition

See #3750

Proposal

Add a --packet-sequences flag to the clear packets CLI.

This flag accepts a list of ranges of sequence numbers to clear (--packet-sequences=SEQS), with the following format (in EBNF):

SEQS        = list
list        = item { "," list }
item        = seq | range
range       = upper-range | lower-range | full-range
upper-range = seq ".."
lower-range = ".." seq
full-range  = seq ".." seq
seq         = integer

Ranges are bounded inclusively below and above. The range start..end contains all values with start <= x <= end. It is empty if start > end.

Examples

Value Meaning
1 Clear a single packet with sequence 1
1,2,3 Clear packets with sequence numbers 1, 2, and 3
..20 Clear all packets with sequence numbers less than or equal to 20
10.. Clear all packets with sequence numbers greater than or equal to 10
10..20 Clear all packets with sequence numbers 10, 11, 12, ..., 20
2,4..6,12,14..17,21,30.. Clear packets with sequence numbers 2, 4, 5, 6,
30..,21,12,14..17,4..6,2 Same as previous, the order in which the ranges are specified does not matter
@github-project-automation github-project-automation bot moved this to 🩹 Triage in Hermes Oct 20, 2023
@romac romac added the O: new-feature Objective: cause to add a new feature or support label Oct 20, 2023
@romac romac removed this from Hermes Oct 20, 2023
@romac romac added this to Hermes Oct 20, 2023
@github-project-automation github-project-automation bot moved this to 🩹 Triage in Hermes Oct 20, 2023
@romac romac moved this from 🩹 Triage to 📋 Backlog in Hermes Oct 20, 2023
@sryps
Copy link

sryps commented Jan 5, 2024

I was just about to create an issue for this, I'd like to upvote the value of this! :)

@romac romac added this to the v1.8 milestone Jan 5, 2024
@romac romac moved this from 📋 Backlog to 📥 Todo in Hermes Jan 5, 2024
@romac romac changed the title Clear single specific packet via REST and CLI Clear packets by specifying a range of sequence numbers to clear Jan 8, 2024
@ancazamfir ancazamfir moved this from 📥 Todo to 🏗 In progress in Hermes Jan 11, 2024
romac added a commit that referenced this issue Jan 12, 2024
Closes: #3672

* Add list of sequence numbers to clear pending CLI

* With sequences option only clear the packets from the specified chain and not counterparty

* Fix clippy, add sequence test

* Update guide template

* Allow specifying sequences to clear as a list of ranges (#3756)

* Allow specifying sequences to clear as a list of ranges

* Make the ranges inclusive

* Update guide templates

* Add packet-sequences to the packet tx CLIs.

* Align and wording

* Update guide templates

* Improve output of `query packet pending` command

* Add integration test for clearing packets by sequence number ranges

* Add changelog entry

---------

Co-authored-by: Romain Ruetschi <romain@informal.systems>
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Hermes Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O: new-feature Objective: cause to add a new feature or support
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants