-
Notifications
You must be signed in to change notification settings - Fork 942
xpay notify attempts #8354
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
base: master
Are you sure you want to change the base?
xpay notify attempts #8354
Changes from all commits
dd68a20
faf08f8
2c96968
3562641
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -567,3 +567,85 @@ Where: | |
- `plugin_name`: The short name of the plugin. | ||
- `plugin_path`: The full file path to the plugin executable. | ||
- `methods`: An array of RPC method names that the plugin registered. | ||
|
||
|
||
### `xpay_attempt_start` (v25.09 onward) | ||
|
||
Emitted by `xpay` when part of a payment begins. `payment_hash` and | ||
`groupid` uniquely identify this xpay invocation, and `partid` then identifies | ||
this particular attempt to pay part of that. | ||
|
||
`total_payment_msat` is the total amount (usually the invoice amount), | ||
which will be the same across all parts, adn `attempt_msat` is the | ||
amount being delivered to the destination by this part. | ||
|
||
Each element in `hops` shows the amount going into the node (i.e. with | ||
fees, `channel_in_msat`) and the amount we're telling it to send | ||
to the other end (`channel_out_msat`). The `channel_out_msat` will | ||
be equal to the next `channel_in_msat. The final | ||
`channel_out_msat` will be equal to the `attempt_msat`. | ||
|
||
The example shows a payment from this node via 1x2x3 (direction 1) to 035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d, then via 2x3x4 (direction 0) to 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59. | ||
|
||
```json | ||
{ | ||
"xpay_attempt_start": { | ||
"payment_hash": "f5a6a059a25d1e329d9b094aeeec8c2191ca037d3f5b0662e21ae850debe8ea2", | ||
"groupid": 1, | ||
"partid": 1, | ||
"total_payment_msat": 200000, | ||
"attempt_msat": 100000, | ||
"hops": [ | ||
{ | ||
"next_node": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", | ||
"short_channel_id": "1x2x3", | ||
"direction": 1, | ||
"channel_in_msat": 100030, | ||
"channel_out_msat": 100030 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be 100000 in this example? (also If I understand correctly, in this example the user's node pays |
||
}, | ||
{ | ||
"next_node": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59", | ||
"short_channel_id": "2x3x4", | ||
"direction": 0, | ||
"channel_in_msat": 100030, | ||
"channel_out_msat": 100000 | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
### `xpay_attempt_end` (v25.09 onward) | ||
|
||
Emitted by `xpay` when part of a payment ends. `payment_hash`, `groupid` and `partid` | ||
will match a previous `xpay_attempt_start`. | ||
|
||
`status` will be "success" or "failure". `duration` will be a number of seconds, with 9 decimal places. This is the time between `xpay` telling lightningd to send the onion, to when `xpay` processes the response. | ||
|
||
If `status` is "failure", there will always be an `error_message`: the other fields below | ||
will be missing in the unusual case where the error onion is corrupted. | ||
|
||
`failed_node_id`: If it's a non-local error, the source of the error. | ||
`failed_short_channel_id`: if it's not the final node, the channel it's complaining about. | ||
`failed_direction`: if it's not the final node, the channel direction. | ||
`failed_msg`: the decrypted onion message, in hex, if it was valid. | ||
`error_code`: the error code returned (present unless onion was corrupted). | ||
`error_message`: always present: if `failed_node_id` is present it's just the name of the `error_code`, but otherwise it can be a more informative error from our own node. | ||
|
||
```json | ||
{ | ||
"xpay_attempt_end": { | ||
"payment_hash": "f5a6a059a25d1e329d9b094aeeec8c2191ca037d3f5b0662e21ae850debe8ea2", | ||
"groupid": 12345677890, | ||
"partid": 1, | ||
"duration": 1.123456789, | ||
"status": "failure", | ||
"failed_node_id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d", | ||
"failed_msg": "1007008a01024eb43f5212a864e19c426ec0278fb1c506eb043a1cdfde88bd1747080f711dbb472ecce9b1c44f2df7dbbc501a78451fe3ac93b6b9a2aac1bddc9dbb86e81b1b06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f0000670000010000684e64ea010000060000000000000000000000010000000a000000003b023380", | ||
"failed_short_channel_id": "1x2x3", | ||
"failed_direction": 1, | ||
"error_code": 4103, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Can we include the full failure message here somewhere too? To extract things like the channel update? |
||
"error_message": "temporary_channel_failure" | ||
} | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.