Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f21d441
bookkeeper: fix printing of bad JSON results.
rustyrussell Nov 20, 2025
332144b
pytest: fix changed msg on plugin failure.
rustyrussell Nov 20, 2025
f8155c3
plugins/sql: remove size limit.
rustyrussell Nov 20, 2025
c748e72
plugins/sql: print times taken to do list comand, populate table, and…
rustyrussell Nov 20, 2025
cadf6b1
bookkeeper: no longer read listchannelmoves 1000 entries at a time.
rustyrussell Nov 20, 2025
d73937a
Revert "bookkeeper: don't flood logs if we have many channelmoves all…
rustyrussell Nov 20, 2025
6827af1
pytest: latency and speed test on large coinmoves.
rustyrussell Nov 20, 2025
3cefd83
lightningd: don't copy hooks array into hook request, simply don't sh…
rustyrussell Nov 20, 2025
1adbfa3
lightningd: avoid race when runtime-added plugins register hooks.
rustyrussell Nov 20, 2025
e61351f
lightningd: log when we have to defer hook registration.
rustyrussell Nov 20, 2025
6de7218
lightningd: don't loop through all commands every time one finishes.
rustyrussell Nov 20, 2025
eff43c6
common: remove tracing exponential behaviour from large numbers of re…
rustyrussell Nov 20, 2025
02d596c
common: avoid allocations for small numbers of traces.
rustyrussell Nov 20, 2025
6b54888
pytest: increase test_generate_coinmoves to 2M entries.
rustyrussell Nov 20, 2025
fedbdd5
lightningd: handle large numbers of command outputs gracefully.
rustyrussell Nov 20, 2025
b65de91
JSONRPC: use a bigger default buffer.
rustyrussell Nov 20, 2025
3f39ba7
lightningd: support "filters" in plugins manifest to restrict when ho…
rustyrussell Nov 20, 2025
7d0cbf1
lightningd: add support for filters on "rpc_command" hook.
rustyrussell Nov 20, 2025
241688e
libplugin: allow plugins to register optional filters for each hook t…
rustyrussell Nov 20, 2025
288a882
libplugin: don't wait for clean_tmpctx() to free requests as we proce…
rustyrussell Nov 20, 2025
6f440cc
xpay: use filtering on rpc_command so we only get called on "pay".
rustyrussell Nov 20, 2025
60a0ed2
pyln-client: support hook filters.
rustyrussell Nov 20, 2025
2d8c458
lightningd: allow filtering on custommsg hook too.
rustyrussell Nov 20, 2025
4a3b063
commando, chanbackup: use custommsg hooks.
rustyrussell Nov 20, 2025
4dcecfd
common: increase jsonrpc_io buffer size temporarily to aggrevate perf…
rustyrussell Nov 20, 2025
28c23c5
common: optimize json parsing.
rustyrussell Nov 20, 2025
d54d197
ccan: update to get io_loop fairness.
rustyrussell Nov 20, 2025
833362d
lightningd: don't process more than 100 commands from a JSONRPC at once.
rustyrussell Nov 20, 2025
d573cbd
lightningd: don't process more than 100 commands from a plugin at once.
rustyrussell Nov 20, 2025
50ea030
plugins/sql: use modern data style, not globals.
rustyrussell Nov 20, 2025
9be3fa7
sql: if we use `dev-sqlfilename`, don't bother syncing it to disk.
rustyrussell Nov 20, 2025
1bc67a6
sql: use wait RPC so we don't have to check listchannelmoves/listchai…
rustyrussell Nov 20, 2025
030e7d1
lightningd: optimize find_cmd.
rustyrussell Nov 20, 2025
3afd185
bookkeeper: restore limit on asking for all channelmoves at once.
rustyrussell Nov 20, 2025
8718345
sql: limit how many chainmoves/channelmoves entries we ask for at once.
rustyrussell Nov 20, 2025
bc6c248
pytest: increase test_generate_coinmoves to 5M entries.
rustyrussell Nov 20, 2025
8f71d7e
pytest: test for 1M JSONRPC calls which don't need transactions.
rustyrussell Nov 20, 2025
3e82368
db: don't start transactions unless we really need to.
rustyrussell Nov 20, 2025
b05d609
Python: update pyproject.toml so we can run tests/benchmarks.py.
rustyrussell Nov 20, 2025
0441a77
pyln-testing: don't assume we're doing debug logging for fundwallet a…
rustyrussell Nov 20, 2025
b517514
tests/benchmark.py: tune nodes a little.
rustyrussell Nov 20, 2025
2ce0766
pytest: move test_coinmoves.py::test_generate_coinmoves and test_plug…
rustyrussell Nov 20, 2025
367cf17
libplugin: add spamlistcommand
rustyrussell Nov 20, 2025
a76fff3
db: don't actually create an explicit transaction for read commands.
rustyrussell Nov 20, 2025
deae748
lightningd: print last method we called if we abort processing loop.
rustyrussell Nov 20, 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
Loading