Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
gruve-p committed Dec 19, 2024
2 parents 95889f0 + fa10323 commit 2c57b85
Show file tree
Hide file tree
Showing 26 changed files with 454 additions and 134 deletions.
12 changes: 11 additions & 1 deletion .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -1809,6 +1809,7 @@
"InjectpaymentonionRequest": {
"InjectPaymentOnion.amount_msat": 3,
"InjectPaymentOnion.cltv_expiry": 4,
"InjectPaymentOnion.destination_msat": 10,
"InjectPaymentOnion.groupid": 6,
"InjectPaymentOnion.invstring": 8,
"InjectPaymentOnion.label": 7,
Expand All @@ -1820,7 +1821,8 @@
"InjectpaymentonionResponse": {
"InjectPaymentOnion.completed_at": 2,
"InjectPaymentOnion.created_at": 1,
"InjectPaymentOnion.created_index": 3
"InjectPaymentOnion.created_index": 3,
"InjectPaymentOnion.payment_preimage": 4
},
"InvoiceRequest": {
"Invoice.amount_msat": 10,
Expand Down Expand Up @@ -7547,6 +7549,10 @@
"added": "v24.11",
"deprecated": null
},
"InjectPaymentOnion.destination_msat": {
"added": "v24.11.1",
"deprecated": null
},
"InjectPaymentOnion.groupid": {
"added": "v24.11",
"deprecated": null
Expand Down Expand Up @@ -7575,6 +7581,10 @@
"added": "v24.11",
"deprecated": null
},
"InjectPaymentOnion.payment_preimage": {
"added": "v24.11",
"deprecated": null
},
"Invoice": {
"added": "pre-v0.10.1",
"deprecated": null
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,35 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [24.11.1] - 2024-12-16: "The lightning-dev Mailing List II"

Minor fixes, particularly for xpay users.

### Changed

- JSON-RPC: `xpay` now gives the same JSON success return as documented by `pay` when `xpay-handle-pay` is set. ([#7938], [#7952])
- JSON-RPC: With `xpay-handle-pay` set, xpay will now be used even if `pay` uses maxfeeprecent or exemptfee parameters (e.g. Zeus) ([#7942])
- JSON-RPC: `xpay` now populates more fields, so `listsendpays` and `listpays` show `destination` and `amount_msat` fields for xpay payments. ([#7941])
- Logging: we no longer suppress DEBUG messages from subdaemons. ([#7935])

### Fixed

- JSON-RPC: xpay now works through unannounced channels. ([#7937])
- lightning-cli: fix "malformed response" bug ([#7924])
- Plugins: `xpay` no longer logs "Got command" at info level. ([#7933])
- Build: Alpine/OpenBSD compilation fix ([#7940])

[#7942]: https://github.com/ElementsProject/lightning/pull/7942
[#7933]: https://github.com/ElementsProject/lightning/pull/7933
[#7941]: https://github.com/ElementsProject/lightning/pull/7941
[#7937]: https://github.com/ElementsProject/lightning/pull/7937
[#7924]: https://github.com/ElementsProject/lightning/pull/7924
[#7935]: https://github.com/ElementsProject/lightning/pull/7935
[#7938]: https://github.com/ElementsProject/lightning/pull/7938
[#7940]: https://github.com/ElementsProject/lightning/pull/7940
[#7952]: https://github.com/ElementsProject/lightning/pull/7952
[24.11.1]: https://github.com/ElementsProject/lightning/releases/tag/v24.11.1

## [24.11] - 2024-12-09: "The lightning-dev Mailing List"

This release named by Dusty Daemon.
Expand Down
6 changes: 2 additions & 4 deletions cli/lightning-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,10 +860,8 @@ int main(int argc, char *argv[])
default:
if (handle_notify(resp, toks, notification_level,
&last_was_progress)) {
/* +2 for \n\n */
size_t len = toks[0].end - toks[0].start + 2;
memmove(resp, resp + len, off - len);
off -= len;
memmove(resp, resp + toks[0].end, off - toks[0].end);
off -= toks[0].end;
jsmn_init(&parser);
toks[0].type = JSMN_UNDEFINED;
/* Don't force another read! */
Expand Down
2 changes: 2 additions & 0 deletions cln-grpc/proto/node.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions cln-grpc/src/convert.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions cln-rpc/src/model.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/splice_script.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <common/json_parse_simple.h>
#include <common/splice_script.h>
#include <ctype.h>
#include <errno.h>
#include <inttypes.h>
#include <sys/errno.h>

#define SCRIPT_DUMP_TOKENS 0
#define SCRIPT_DUMP_SEGMENTS 0
Expand Down
25 changes: 5 additions & 20 deletions common/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
static int status_fd = -1;
static struct daemon_conn *status_conn;
volatile bool logging_io = false;
bool logging_trace = false;
static bool was_logging_io;

/* If we're more than this many msgs deep, don't add debug messages. */
#define TRACE_QUEUE_LIMIT 20
static size_t traces_suppressed;

static void got_sigusr1(int signal UNUSED)
{
logging_io = !logging_io;
Expand Down Expand Up @@ -149,22 +146,10 @@ void status_vfmt(enum log_level level,
{
char *str;

/* We only suppress async debug msgs. IO messages are even spammier
* but they only occur when explicitly asked for */
if ((level == LOG_DBG || level == LOG_TRACE) && status_conn) {
size_t qlen = daemon_conn_queue_length(status_conn);

/* Once suppressing, we keep suppressing until we're empty */
if (traces_suppressed && qlen == 0) {
size_t n = traces_suppressed;
traces_suppressed = 0;
/* Careful: recursion! */
status_trace("...[%zu debug/trace messages suppressed]...", n);
} else if (traces_suppressed || qlen > TRACE_QUEUE_LIMIT) {
traces_suppressed++;
return;
}
}
/* These are spammy, so only log if requested (or IO logging)*/
if (level == LOG_TRACE && (!logging_trace && !logging_io))
return;

str = tal_vfmt(NULL, fmt, ap);
status_send(take(towire_status_log(NULL, level, peer, str)));
tal_free(str);
Expand Down
2 changes: 2 additions & 0 deletions common/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ void status_vfmt(enum log_level level,

/* Usually we only log the packet names, not contents. */
extern volatile bool logging_io;
/* Usually we don't bother with TRACE spam */
extern bool logging_trace;

/* This logs a debug summary if IO logging not enabled. */
void status_peer_io(enum log_level iodir,
Expand Down
2 changes: 2 additions & 0 deletions common/subdaemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ bool subdaemon_setup(int argc, char *argv[])
for (int i = 1; i < argc; i++) {
if (streq(argv[i], "--log-io"))
logging_io = true;
if (streq(argv[i], "--log-trace"))
logging_trace = true;
}

developer = daemon_developer_mode(argv);
Expand Down
3 changes: 0 additions & 3 deletions connectd/test/run-netaddress.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ u8 *b32_decode(const tal_t *ctx UNNEEDED, const char *str UNNEEDED, size_t len U
/* Generated stub for b32_encode */
char *b32_encode(const tal_t *ctx UNNEEDED, const void *data UNNEEDED, size_t len UNNEEDED)
{ fprintf(stderr, "b32_encode called!\n"); abort(); }
/* Generated stub for daemon_conn_queue_length */
size_t daemon_conn_queue_length(const struct daemon_conn *dc UNNEEDED)
{ fprintf(stderr, "daemon_conn_queue_length called!\n"); abort(); }
/* Generated stub for daemon_conn_send */
void daemon_conn_send(struct daemon_conn *dc UNNEEDED, const u8 *msg UNNEEDED)
{ fprintf(stderr, "daemon_conn_send called!\n"); abort(); }
Expand Down
31 changes: 23 additions & 8 deletions contrib/msggen/msggen/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16143,14 +16143,14 @@
"lightning-injectpaymentonion.json": {
"$schema": "../rpc-schema-draft.json",
"type": "object",
"additionalProperties": false,
"rpc": "injectpaymentonion",
"title": "Send a payment with a custom onion packet",
"description": [
"The **injectpaymentonion** RPC command causes the node to receive a payment attempt similar to the way it would receive one from a peer. The onion packet is unwrapped, then handled normally: either as a local payment, or forwarded to the next peer.",
"Compared to lightning-sendonion(7): the handling of blinded paths and self-payments is trivial, and the interface blocks until the payment succeeds or fails. The call also fails if this payment_hash has already been successfully paid."
],
"request": {
"additionalProperties": false,
"required": [
"onion",
"payment_hash",
Expand All @@ -16175,7 +16175,7 @@
"amount_msat": {
"type": "msat",
"description": [
"The amount for the first HTLC in millisatoshis. This is also the amount which will be forwarded to the first peer (if any) as we do not charge fees on our own payments."
"The amount for the first HTLC in millisatoshis. This is also the amount which will be forwarded to the first peer (if any) as we do not charge fees on our own payments. Note: this is shown in listsendpays as `amount_sent_msat`."
]
},
"cltv_expiry": {
Expand Down Expand Up @@ -16213,10 +16213,18 @@
"description": [
"`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7)."
]
},
"destination_msat": {
"type": "msat",
"added": "v24.11.1",
"description": [
"Amount that is actually delivered to the destination (i.e. `amount_msat` minus fees), for showing in listsendpays (confusingly, as `amount_msat`)."
]
}
}
},
"response": {
"additionalProperties": false,
"required": [
"created_index",
"created_at",
Expand All @@ -16241,6 +16249,13 @@
"description": [
"1-based index indicating order this payment was created in."
]
},
"payment_preimage": {
"added": "v24.11",
"type": "secret",
"description": [
"The proof of payment: SHA256 of this is the invoice's **payment_hash**."
]
}
}
},
Expand Down Expand Up @@ -36413,10 +36428,10 @@
},
"response": {
"payment_preimage": "paymentpreimgxp1010101010101010101010101010101010101010101010101",
"failed_parts": 0,
"successful_parts": 1,
"amount_msat": 10000,
"amount_sent_msat": 10002
"amount_sent_msat": 10002,
"failed_parts": 0,
"successful_parts": 1
}
},
{
Expand All @@ -36429,10 +36444,10 @@
},
"response": {
"payment_preimage": "paymentpreimgxp2020202020202020202020202020202020202020202020202",
"failed_parts": 0,
"successful_parts": 1,
"amount_msat": 1000,
"amount_sent_msat": 1000
"amount_sent_msat": 1000,
"failed_parts": 0,
"successful_parts": 1
}
}
]
Expand Down
72 changes: 36 additions & 36 deletions contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions contrib/pyln-testing/pyln/testing/grpc2py.py
Original file line number Diff line number Diff line change
Expand Up @@ -3218,6 +3218,7 @@ def injectpaymentonion2py(m):
"completed_at": m.completed_at, # PrimitiveField in generate_composite
"created_at": m.created_at, # PrimitiveField in generate_composite
"created_index": m.created_index, # PrimitiveField in generate_composite
"payment_preimage": hexlify(m.payment_preimage), # PrimitiveField in generate_composite
})


Expand Down
3 changes: 1 addition & 2 deletions doc/lightningd-config.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,7 @@ command, so they invoices can also be paid onchain.

* **xpay-handle-pay**=*BOOL* [plugin `xpay`, *dynamic*]

Setting this makes `xpay` intercept simply `pay` commands (default `false`). Note that the
response will be different from the normal pay command, however.
Setting this makes `xpay` intercept simply `pay` commands (default `false`).

### Networking options

Expand Down
19 changes: 17 additions & 2 deletions doc/schemas/lightning-injectpaymentonion.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"additionalProperties": false,
"rpc": "injectpaymentonion",
"title": "Send a payment with a custom onion packet",
"description": [
"The **injectpaymentonion** RPC command causes the node to receive a payment attempt similar to the way it would receive one from a peer. The onion packet is unwrapped, then handled normally: either as a local payment, or forwarded to the next peer.",
"Compared to lightning-sendonion(7): the handling of blinded paths and self-payments is trivial, and the interface blocks until the payment succeeds or fails. The call also fails if this payment_hash has already been successfully paid."
],
"request": {
"additionalProperties": false,
"required": [
"onion",
"payment_hash",
Expand All @@ -33,7 +33,7 @@
"amount_msat": {
"type": "msat",
"description": [
"The amount for the first HTLC in millisatoshis. This is also the amount which will be forwarded to the first peer (if any) as we do not charge fees on our own payments."
"The amount for the first HTLC in millisatoshis. This is also the amount which will be forwarded to the first peer (if any) as we do not charge fees on our own payments. Note: this is shown in listsendpays as `amount_sent_msat`."
]
},
"cltv_expiry": {
Expand Down Expand Up @@ -71,10 +71,18 @@
"description": [
"`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7)."
]
},
"destination_msat": {
"type": "msat",
"added": "v24.11.1",
"description": [
"Amount that is actually delivered to the destination (i.e. `amount_msat` minus fees), for showing in listsendpays (confusingly, as `amount_msat`)."
]
}
}
},
"response": {
"additionalProperties": false,
"required": [
"created_index",
"created_at",
Expand All @@ -99,6 +107,13 @@
"description": [
"1-based index indicating order this payment was created in."
]
},
"payment_preimage": {
"added": "v24.11",
"type": "secret",
"description": [
"The proof of payment: SHA256 of this is the invoice's **payment_hash**."
]
}
}
},
Expand Down
Loading

0 comments on commit 2c57b85

Please sign in to comment.