[track] RPC pagination and sorting
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
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
I hope to support status filtering in listinvoices like listsendpays.
Now that pagination was added (v23.08) for invoices could we plan pagination for payment for v23.11? 🙏
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
we have pagination for listforwards and listinvoices but not for listpays. I'd love to see it for listpays aswell, @rustyrussell ? :pray: