Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
ef5a9bd
bookkeeper: fix printing of bad JSON results.
rustyrussell Nov 20, 2025
d66e7de
pytest: fix changed msg on plugin failure.
rustyrussell Nov 20, 2025
6977800
plugins/sql: remove size limit.
rustyrussell Nov 20, 2025
459e213
plugins/sql: print times taken to do list comand, populate table, and…
rustyrussell Nov 20, 2025
2f2eaca
bookkeeper: no longer read listchannelmoves 1000 entries at a time.
rustyrussell Nov 20, 2025
673729b
Revert "bookkeeper: don't flood logs if we have many channelmoves all…
rustyrussell Nov 20, 2025
fd2bf0d
pytest: latency and speed test on large coinmoves.
rustyrussell Nov 20, 2025
6e5a5b0
lightningd: don't copy hooks array into hook request, simply don't sh…
rustyrussell Nov 20, 2025
a4f772e
lightningd: avoid race when runtime-added plugins register hooks.
rustyrussell Nov 20, 2025
576f48c
lightningd: log when we have to defer hook registration.
rustyrussell Nov 20, 2025
cfa89f6
lightningd: don't loop through all commands every time one finishes.
rustyrussell Nov 20, 2025
7f55a8e
common: remove tracing exponential behaviour from large numbers of re…
rustyrussell Nov 20, 2025
cbd52d4
common: avoid allocations for small numbers of traces.
rustyrussell Nov 20, 2025
6006467
pytest: increase test_generate_coinmoves to 2M entries.
rustyrussell Nov 20, 2025
8707b73
lightningd: handle large numbers of command outputs gracefully.
rustyrussell Nov 20, 2025
9e04d04
JSONRPC: use a bigger default buffer.
rustyrussell Nov 20, 2025
d76a905
lightningd: support "filters" in plugins manifest to restrict when ho…
rustyrussell Nov 20, 2025
d9d82ac
lightningd: add support for filters on "rpc_command" hook.
rustyrussell Nov 20, 2025
ebe5f2e
libplugin: allow plugins to register optional filters for each hook t…
rustyrussell Nov 20, 2025
1d4a1cd
libplugin: don't wait for clean_tmpctx() to free requests as we proce…
rustyrussell Nov 20, 2025
9961f6b
xpay: use filtering on rpc_command so we only get called on "pay".
rustyrussell Nov 20, 2025
81f0d05
pyln-client: support hook filters.
rustyrussell Nov 20, 2025
213cbba
lightningd: allow filtering on custommsg hook too.
rustyrussell Nov 20, 2025
aff1d6b
commando, chanbackup: use custommsg hooks.
rustyrussell Nov 20, 2025
d2a6091
common: increase jsonrpc_io buffer size temporarily to aggrevate perf…
rustyrussell Nov 20, 2025
54d4bf1
common: optimize json parsing.
rustyrussell Nov 20, 2025
5fc9e5a
ccan: update to get io_loop fairness.
rustyrussell Nov 20, 2025
b51e282
lightningd: don't process more than 100 commands from a JSONRPC at once.
rustyrussell Nov 20, 2025
94d582f
lightningd: don't process more than 100 commands from a plugin at once.
rustyrussell Nov 20, 2025
b63034b
plugins/sql: use modern data style, not globals.
rustyrussell Nov 20, 2025
bb7db39
sql: if we use `dev-sqlfilename`, don't bother syncing it to disk.
rustyrussell Nov 20, 2025
7910ee4
sql: use wait RPC so we don't have to check listchannelmoves/listchai…
rustyrussell Nov 20, 2025
98bd95c
lightningd: optimize find_cmd.
rustyrussell Nov 20, 2025
873d410
bookkeeper: restore limit on asking for all channelmoves at once.
rustyrussell Nov 20, 2025
a877e28
sql: limit how many chainmoves/channelmoves entries we ask for at once.
rustyrussell Nov 20, 2025
6865fe3
pytest: increase test_generate_coinmoves to 5M entries.
rustyrussell Nov 20, 2025
b03562b
pytest: test for 1M JSONRPC calls which don't need transactions.
rustyrussell Nov 20, 2025
bfbee05
db: don't start transactions unless we really need to.
rustyrussell Nov 20, 2025
f49818c
Python: update pyproject.toml so we can run tests/benchmarks.py.
rustyrussell Nov 20, 2025
19f0b04
pyln-testing: don't assume we're doing debug logging for fundwallet a…
rustyrussell Nov 20, 2025
5fd95b3
tests/benchmark.py: tune nodes a little.
rustyrussell Nov 20, 2025
ce425b4
pytest: move test_coinmoves.py::test_generate_coinmoves and test_plug…
rustyrussell Nov 20, 2025
b4f1750
libplugin: add spamlistcommand
rustyrussell Nov 20, 2025
47ab467
db: don't actually create an explicit transaction for read commands.
rustyrussell Nov 20, 2025
8732410
lightningd: print last method we called if we abort processing loop.
rustyrussell Nov 20, 2025
9a6486e
cln-plugin: add a hook builder to make use of before, after and filte…
daywalker90 Nov 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ccan/README
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CCAN imported from http://ccodearchive.net.

CCAN version: init-2605-gc47bf0d9
CCAN version: init-2606-g5f219f03
35 changes: 25 additions & 10 deletions ccan/ccan/io/poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ static void restore_pollfds(void)
void *io_loop(struct timers *timers, struct timer **expired)
{
void *ret;
/* This ensures we don't always service lower fds first */
static int fairness_counter;

/* if timers is NULL, expired must be. If not, not. */
assert(!timers == !expired);
Expand All @@ -384,17 +386,12 @@ void *io_loop(struct timers *timers, struct timer **expired)
while (!io_loop_return) {
int i, r, ms_timeout = -1;

if (handle_always()) {
/* Could have started/finished more. */
continue;
}

/* Everything closed? */
if (num_fds == 0)
break;

/* You can't tell them all to go to sleep! */
assert(num_waiting);
assert(num_waiting || num_always);

if (timers) {
struct timemono now, first;
Expand All @@ -417,6 +414,10 @@ void *io_loop(struct timers *timers, struct timer **expired)
}
}

/* Don't wait if we have always requests pending! */
if (num_always != 0)
ms_timeout = 0;

/* We do this temporarily, assuming exclusive is unusual */
exclude_pollfds();
r = pollfn(pollfds, num_fds, ms_timeout);
Expand All @@ -430,15 +431,29 @@ void *io_loop(struct timers *timers, struct timer **expired)
break;
}

for (i = 0; i < num_fds && !io_loop_return; i++) {
struct io_conn *c = (void *)fds[i];
int events = pollfds[i].revents;
fairness_counter++;
for (size_t rotation = 0; rotation < num_fds && !io_loop_return; rotation++) {
struct io_conn *c;
int events;

i = (rotation + fairness_counter) % num_fds;
c = (void *)fds[i];

/* Clear so we don't get confused if exclusive next time */
events = pollfds[i].revents;
pollfds[i].revents = 0;

if (r == 0)
/* Timeout? */
if (r == 0) {
handle_always();
break;
}

/* We interleave always before the first fd */
if (i == 0 && handle_always()) {
/* Could have started/finished more. */
break;
}

if (fds[i]->listener) {
struct io_listener *l = (void *)fds[i];
Expand Down
16 changes: 8 additions & 8 deletions common/json_parse_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,24 +486,24 @@ bool json_parse_input(jsmn_parser *parser,

again:
ret = jsmn_parse(parser, input, len, *toks, tal_count(*toks) - 1);

switch (ret) {
case JSMN_ERROR_INVAL:
if (ret == JSMN_ERROR_INVAL)
return false;
case JSMN_ERROR_NOMEM:
tal_resize(toks, tal_count(*toks) * 2);
goto again;
}

/* Check whether we read at least one full root element, i.e., root
* element has its end set. */
if ((*toks)[0].type == JSMN_UNDEFINED || (*toks)[0].end == -1) {
/* If it ran out of tokens, provide more. */
if (ret == JSMN_ERROR_NOMEM) {
tal_resize(toks, tal_count(*toks) * 2);
goto again;
}
/* Otherwise, must be incomplete */
*complete = false;
return true;
}

/* If we read a partial element at the end of the stream we'll get a
* ret=JSMN_ERROR_PART, but due to the previous check we know we read at
* errro, but due to the previous check we know we read at
* least one full element, so count tokens that are part of this root
* element. */
ret = json_next(*toks) - *toks;
Expand Down
3 changes: 3 additions & 0 deletions common/json_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# include <external/jsmn/jsmn.h>

#include <bitcoin/short_channel_id.h>
#include <ccan/list/list.h>
#include <ccan/time/time.h>
#include <common/amount.h>
#include <common/jsonrpc_errors.h>
Expand Down Expand Up @@ -36,6 +37,8 @@ struct wireaddr;
struct wireaddr_internal;

struct json_stream {
struct list_node list;

struct json_out *jout;

/* Who is writing to this buffer now; NULL if nobody is. */
Expand Down
7 changes: 4 additions & 3 deletions common/jsonrpc_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <errno.h>
#include <unistd.h>

#define READ_CHUNKSIZE 64
#define READ_CHUNKSIZE (1024*1024)

struct jsonrpc_io {
MEMBUF(char) membuf;
Expand All @@ -22,13 +22,14 @@ struct jsonrpc_io {
struct jsonrpc_io *jsonrpc_io_new(const tal_t *ctx)
{
struct jsonrpc_io *json_in;
const size_t bufsize = READ_CHUNKSIZE * 2;

json_in = tal(ctx, struct jsonrpc_io);
json_in->bytes_read = 0;

membuf_init(&json_in->membuf,
tal_arr(json_in, char, READ_CHUNKSIZE),
READ_CHUNKSIZE, membuf_tal_resize);
tal_arr(json_in, char, bufsize),
bufsize, membuf_tal_resize);
json_in->toks = toks_alloc(json_in);
jsmn_init(&json_in->parser);

Expand Down
Loading