-
Notifications
You must be signed in to change notification settings - Fork 902
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
wait/pagination support for listsendpays, listforwards #6753
Merged
rustyrussell
merged 18 commits into
ElementsProject:master
from
rustyrussell:guilt/index-wait
Oct 28, 2023
Merged
wait/pagination support for listsendpays, listforwards #6753
rustyrussell
merged 18 commits into
ElementsProject:master
from
rustyrussell:guilt/index-wait
Oct 28, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rustyrussell
force-pushed
the
guilt/index-wait
branch
from
October 23, 2023 05:50
549c707
to
c73ff0f
Compare
Trivial rebase on #6802 for flake fixes. |
rustyrussell
force-pushed
the
guilt/index-wait
branch
2 times, most recently
from
October 24, 2023 01:31
1f32dfc
to
d273a7a
Compare
cdecker
force-pushed
the
guilt/index-wait
branch
from
October 24, 2023 10:40
d273a7a
to
d53dcc7
Compare
Rebased on top of |
rustyrussell
force-pushed
the
guilt/index-wait
branch
from
October 27, 2023 02:45
d53dcc7
to
2282ad2
Compare
Rebased, and wrote tests and documentation (which caused more minor fixes). |
Adding an index means: 1. Add the new subsystem, and new updated_index field to the db, and create xxx_index_deleted/created/updated APIs. 2. Hook up these functions to the points they need to be called. 3. Add index, start and limit fields to the list command. 4. Add created_index and updated_index into the list command. This does #1. Signed-off-by: Rusty Russell <[email protected]>
We generalize the invoice routine, though it's (known) buggy, so we have to copy it. We rename the invoice routine to a more specific name though. Signed-off-by: Rusty Russell <[email protected]>
rustyrussell
force-pushed
the
guilt/index-wait
branch
from
October 27, 2023 11:41
2282ad2
to
0de4d18
Compare
Rebase and PostgresSQL fix. |
Signed-off-by: Rusty Russell <[email protected]> Changelog-Added: JSON-RPC: `wait` now works for `sendpays` infrastructure.
We didn't write to db immediately, but waited until it the actual HTLC got added (or failed). That way we didn't have a separate transaction to write the payment into the db, but the complexity is not worth it: it makes the next refactors harder, since we can't use the normal iterator patterns like we do with the rest of the db (as we have to add the unstored ones). We might as well also make sendpay return immediately: we used to return once the HTLC had been confirmed sent, since we entered it in the db at that point, but we can keep it simple now. Signed-off-by: Rusty Russell <[email protected]>
Have it construct and return. No need to expose details about dbid... Signed-off-by: Rusty Russell <[email protected]>
It used to be used for both `sendpay` and `waitsendpay` but now it's only for the latter, so the name is confusing. Signed-off-by: Rusty Russell <[email protected]>
We used to have "unsaved" payments: now we don't we can use our normal "iterator" pattern rather than returning arrays. Signed-off-by: Rusty Russell <[email protected]>
Looking through logs I was surprise to see: ``` lightningd-1 2023-10-26T03:42:36.824Z INFO lightningd: Sending 200000000msat over 1 hops to deliver 200000000msat ``` On a re-payment where we simply returned from sendpay immediately! Move that log to later.
Signed-off-by: Rusty Russell <[email protected]> Changelog-Added: JSON-RPC: `sendpay`, `listsendpays`, `delpay` new fields `created_index` (old: `id`) and `updated_index`.
Changelog-Added: JSON-RPC: `listsendpays` new parameters `index`, `start` and `limit`.
peer_htlcs has become a bit of a dumping ground: move listforwards etc to its own file. Also move `struct channel_info` from peer_htlcs.h to channel.h where it more logically belongs. Signed-off-by: Rusty Russell <[email protected]>
This table doesn't have `id`, except as the implicit one in Sqlite3, so we need to add it for postgres. Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Rusty Russell <[email protected]> Changelog-Added: JSON-RPC: `wait` now works for `forwards` infrastructure.
Signed-off-by: Rusty Russell <[email protected]> Changelog-Added: JSON-RPC: `listforwards` fields `created_index` (old: `id`) and `updated_index`.
Changelog-Added: JSON-RPC: `listforwards` new parameters `index`, `start` and `limit`.
Signed-off-by: Rusty Russell <[email protected]>
Without this, we have no unique identifier for which forward happened. Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
rustyrussell
force-pushed
the
guilt/index-wait
branch
from
October 28, 2023 03:13
0de4d18
to
feb9221
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This expands wait (and pagination) to listsendpays and listforwards.
It does not cover listpays (yet, sorry), so the caller needs to collate the multiple parts (by payment_hash and groupid) to get presentable payment information (which is what the pay plugin does to create
listpays
.Closes: #6740