cln/plugins
Rusty Russell 0c9a35e2d5 plugins/sql: add payment_hash index to channelmoves table.
This significantly speeds up the query which bookkeeper often does:

		      "SELECT created_index"
		      " FROM channelmoves"
		      " WHERE payment_hash = X'%s'"
		      "   AND credit_msat = %"PRIu64
		      "   AND created_index <= %"PRIu64,

On large databases this scan is expensive, and a payment_hash index
cuts it down a great deal.  It does take longer to load the channelmoves
in the first place though (about 3x).

Before:
	$ while sleep 10; do wc -l /tmp/bkpr-progress; done
	169505 /tmp/bkpr-progress
	196010 /tmp/bkpr-progress
	219370 /tmp/bkpr-progress
	235671 /tmp/bkpr-progress
	244242 /tmp/bkpr-progress
	255362 /tmp/bkpr-progress
	265636 /tmp/bkpr-progress
	276966 /tmp/bkpr-progress
	284451 /tmp/bkpr-progress
	288836 /tmp/bkpr-progress
	296578 /tmp/bkpr-progress
	304571 /tmp/bkpr-progress

After:
	$ while sleep 10; do wc -l /tmp/bkpr-progress; done
	161421 /tmp/bkpr-progress
	238273 /tmp/bkpr-progress
	281185 /tmp/bkpr-progress
	305787 /tmp/bkpr-progress

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: plugins: the sql plugin now keeps an index on `channelmoves` by `payment_hash`.
2025-10-20 11:19:22 +10:30
..
askrene askrene: add maxparts 2025-08-15 16:13:19 +09:30
bip353-plugin docker: Dockerfile fixes after poetry to uv migration 2025-09-09 10:46:23 +09:30
bkpr bookkeeper: fix reloading of rebalances. 2025-10-01 15:35:50 +09:30
examples cln-plugin: trace level logging support 2025-05-05 09:31:22 -07:00
grpc-plugin plugins: generate certificates with required extensions 2025-08-26 13:52:15 +09:30
lsps-plugin rust: Bump cln-plugin==0.5 2025-08-19 15:47:58 +09:30
renepay unit tests: update all the gossmaps to have the GOSSIP_STORE_COMPLETED_BIT set. 2025-10-01 13:29:33 +09:30
rest-plugin plugins: generate certificates with required extensions 2025-08-26 13:52:15 +09:30
spender splice: Splice script should not abort on sign 2025-05-13 14:52:15 +09:30
src cln-plugin: adapt send_custom_notification to send modern-style notifications. 2025-08-18 10:01:07 +09:30
test unit tests: update all the gossmaps to have the GOSSIP_STORE_COMPLETED_BIT set. 2025-10-01 13:29:33 +09:30
wss-proxy-plugin plugins: generate certificates with required extensions 2025-08-26 13:52:15 +09:30
xpay BOLT12: Update recurrence to latest spec draft. 2025-10-01 15:31:30 +09:30
.gitignore lsps: Add service implementation for LSPS0 2025-05-02 13:34:21 -07:00
autoclean.c autoclean: rest between cleanup calls. 2024-11-12 10:42:18 +01:00
bcli.c plugins/bcli: use -rpcwait to simplify waiting for bitcoind to warm up 2025-09-04 13:33:32 +09:30
Cargo.toml rust: Bump cln-plugin==0.5 2025-08-19 15:47:58 +09:30
chanbackup.c libplugin: make jsonrpc_set_datastore_binary() take an explicit length. 2025-08-14 19:49:09 +09:30
channel_hint.c libplugin: correctly wrap notifications we send in the notification name. 2025-08-18 10:01:07 +09:30
channel_hint.h ccan/htable: update to explicit DUPS/NODUPS types. 2025-01-21 09:18:25 +10:30
commando.c commando: remove old commando rune commands. 2025-06-25 09:06:31 +09:30
establish_onion_path.c offers: fix fetchinvoice from using disconnected peers. 2025-08-18 14:19:27 +09:30
establish_onion_path.h fetchinvoice: use common/onion_message routines. 2024-07-17 10:57:11 +02:00
exposesecret.c plugins/exposesecret: fix for API change. 2024-11-13 13:24:06 +10:30
fetchinvoice.c wire: update to slight spec neating. 2025-10-01 15:31:30 +09:30
fetchinvoice.h plugins: cancelrecurringinvoice command. 2025-10-01 15:31:30 +09:30
funder.c lightningd: deprecate (undocumented!) "unknown" old_state field in channel_state_changed notification. 2025-05-08 10:49:31 +09:30
funder_policy.c bitcoin: make input witness weight calculation explicit. 2025-05-06 12:27:53 +09:30
funder_policy.h libplugin: allow display of default values. 2024-05-15 15:50:54 -05:00
keysend.c lightningd: remove accept-htlc-tlv-types. 2025-03-12 09:26:08 +10:30
libplugin-pay.c plugins/libplugin-pay: Add a check for NaN values 2025-09-22 10:52:59 +09:30
libplugin-pay.h libplugin-pay: always use a non-NULL struct command. 2024-11-07 17:04:35 +10:30
libplugin.c libplugin: remove redundant destructor which causes exponential slowdown on large numbers of requests. 2025-10-20 11:19:22 +10:30
libplugin.h bkpr: helpers to query sql plugin for chainmoves and channelmoves. 2025-08-19 13:37:50 +09:30
Makefile makefile: use SED from configure in most places. 2025-10-17 10:40:17 +10:30
offers.c offers: remove blinding from decode JSON-RPC. 2025-10-01 15:32:54 +09:30
offers.h offers: don't send blinded path to neighbor for *invoices*. 2025-02-27 13:53:10 -06:00
offers_inv_hook.c BOLT12: remove -offers from bolt12 quotes, update them. 2025-02-11 20:19:01 -06:00
offers_inv_hook.h offers: check they use the blinded path if one is specified. 2024-07-17 10:57:11 +02:00
offers_invreq_hook.c wire: update to slight spec neating. 2025-10-01 15:31:30 +09:30
offers_invreq_hook.h offers: check they use the blinded path if one is specified. 2024-07-17 10:57:11 +02:00
offers_offer.c offers: allow quantity_max = 1 2025-10-01 15:31:30 +09:30
offers_offer.h plugins: move fetchinvoice functionality into offers plugin. 2024-07-17 10:57:11 +02:00
pay.c BOLT12: remove -offers from bolt12 quotes, update them. 2025-02-11 20:19:01 -06:00
README.md doc: fix wording in plugins/README.md 2020-01-06 12:57:59 +01:00
recklessrpc.c reckless-rpc: increase initial buffer size 2025-08-18 14:04:48 +09:30
recover.c gossmap: add (and use) logging hook. 2025-02-11 15:11:47 -06:00
sql.c plugins/sql: add payment_hash index to channelmoves table. 2025-10-20 11:19:22 +10:30
topology.c plugins/topology: remove local channels from listchannels. 2025-03-12 09:26:08 +10:30
txprepare.c txprepare: fix all amount when other amounts also specified. 2025-05-06 12:27:53 +09:30

Plugin Directory

Any file in this directory which is executable and whose name only consists of alphanumeric characters, space, '.', '-' or '_' will be automatically loaded when lightningd starts (unless suppressed with commandline options).