lightning icon indicating copy to clipboard operation
lightning copied to clipboard

[track] RPC pagination and sorting

Open cdecker opened this issue 2 years ago • 5 comments

This issue tracks our progress on pagination and sorting.

Since we had a number of requests asking for pagination, offsetting or limiting of the RPC results, or variants thereof, such as getting the most recent entries and inverting the order, it is a probably a good idea to track this group of features explicitly.

@rustyrussell has a plan on how we should be able to implement pagination without being racy

  • Each result has an explicit sorting order
  • A page is a window over that sorted sequence, with a first and last element in that page
  • The next disjoint window is defined as sequence of elements whose sorting key is larger than the largest from the previous window (next page) or whose sorting key is smaller than the smallest from the previous window

cdecker avatar Jun 19 '23 11:06 cdecker

Another point I brought up is that the paginator that will expose should also be UI framework friendly.

All the modern frameworks provide a standard way to paginate content so that no one will implement code for paginator on the UI side nowadays.

Maybe we should do some research on the API that we want to expose

A good feedback is here https://github.com/ElementsProject/lightning/issues/6098#issuecomment-1490744619

vincenzopalazzo avatar Jun 19 '23 13:06 vincenzopalazzo

I hope to support status filtering in listinvoices like listsendpays.

arronzhang avatar Jul 27 '23 03:07 arronzhang

Now that pagination was added (v23.08) for invoices could we plan pagination for payment for v23.11? 🙏

2Fast2BCn avatar Sep 05 '23 13:09 2Fast2BCn

Forwards should also be paginated, because some big nodes are gonna have an enormous number of (failed) forwards. We have been running CLN for barely over a week and lightning-cli listforwards is already getting very slow

michael1011 avatar Sep 06 '23 12:09 michael1011

we have pagination for listforwards and listinvoices but not for listpays. I'd love to see it for listpays aswell, @rustyrussell ? :pray:

daywalker90 avatar May 20 '24 08:05 daywalker90