Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3c8080b
libplugin: add command_finish_rawstr() for when we're simply repeatin…
rustyrussell Feb 16, 2026
bc27765
bitcoin: hash_scid and hash_scidd public functions.
rustyrussell Feb 16, 2026
c74ed17
askrene: make minflow() static, and remove unused linear_flow_cost.
rustyrussell Feb 16, 2026
a4d5627
askrene: fork before calling the route solver.
rustyrussell Feb 16, 2026
44c5164
askrene: add child_log function so child can do logging.
rustyrussell Feb 16, 2026
b002d22
askrene: move routines only accessed by the child process into child/.
rustyrussell Feb 16, 2026
35afcd4
askrene: move fmt_flow_full from askrene.c into flow.c.
rustyrussell Feb 16, 2026
5e3384c
askrene: move fork() entry point into its own file.
rustyrussell Feb 16, 2026
671c1c4
askrene: make children use child_log() instead of rq_log.
rustyrussell Feb 16, 2026
f154697
askrene: remove non child-friendly fields from struct route_query.
rustyrussell Feb 16, 2026
cd623f2
askrene: expose additional_costs htable so child can access it.
rustyrussell Feb 16, 2026
983115f
askrene: move route_query definition and functions into child/.
rustyrussell Feb 16, 2026
3750a7d
askrene: have child make `struct route_query` internally.
rustyrussell Feb 16, 2026
4587643
askrene: actually run children in parallel.
rustyrussell Feb 16, 2026
b1d9274
askrene: limit how many children we have.
rustyrussell Feb 16, 2026
0931848
askrene: make "child.c" to be the explicit child entry point.
rustyrussell Feb 16, 2026
eb4802e
askrene: close files in child to isolate against bugs.
rustyrussell Feb 16, 2026
ecac6de
pytest: rework test_real_data and test_real_biases to be parallel.
rustyrussell Feb 16, 2026
af5110c
common: fix `bad cupdates` count in gossmap.c
rustyrussell Feb 16, 2026
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
8 changes: 7 additions & 1 deletion bitcoin/short_channel_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static inline bool short_channel_id_eq(struct short_channel_id a,
return a.u64 == b.u64;
}

static inline size_t short_channel_id_hash(struct short_channel_id scid)
static inline size_t hash_scid(struct short_channel_id scid)
{
/* scids cost money to generate, so simple hash works here */
return (scid.u64 >> 32) ^ (scid.u64 >> 16) ^ scid.u64;
Expand Down Expand Up @@ -46,6 +46,12 @@ static inline bool short_channel_id_dir_eq(const struct short_channel_id_dir *a,
return short_channel_id_eq(a->scid, b->scid) && a->dir == b->dir;
}

static inline size_t hash_scidd(const struct short_channel_id_dir *scidd)
{
/* Bottom bit is common, so use bit 4 for direction */
return hash_scid(scidd->scid) | (scidd->dir << 4);
}

static inline u32 short_channel_id_blocknum(struct short_channel_id scid)
{
return scid.u64 >> 40;
Expand Down
4 changes: 2 additions & 2 deletions common/gossmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static bool chanidx_eq_id(const ptrint_t *pidx,
struct short_channel_id pidxid = chanidx_id(pidx);
return short_channel_id_eq(pidxid, scid);
}
HTABLE_DEFINE_NODUPS_TYPE(ptrint_t, chanidx_id, short_channel_id_hash, chanidx_eq_id,
HTABLE_DEFINE_NODUPS_TYPE(ptrint_t, chanidx_id, hash_scid, chanidx_eq_id,
chanidx_htable);

static struct node_id nodeidx_id(const ptrint_t *pidx);
Expand Down Expand Up @@ -896,7 +896,7 @@ static bool map_catchup(struct gossmap *map,
return false;
map->num_live++;
} else if (type == WIRE_CHANNEL_UPDATE)
num_bad_cupdates += update_channel(map, off);
num_bad_cupdates += !update_channel(map, off);
else if (type == WIRE_GOSSIP_STORE_DELETE_CHAN)
remove_channel_by_deletemsg(map, off);
else if (type == WIRE_NODE_ANNOUNCEMENT)
Expand Down
2 changes: 1 addition & 1 deletion connectd/connectd.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ static bool scid_to_node_id_eq_scid(const struct scid_to_node_id *scid_to_node_i
* we use this to forward onion messages which specify the next hop by scid/dir. */
HTABLE_DEFINE_NODUPS_TYPE(struct scid_to_node_id,
scid_to_node_id_keyof,
short_channel_id_hash,
hash_scid,
scid_to_node_id_eq_scid,
scid_htable);

Expand Down
4 changes: 4 additions & 0 deletions doc/lightningd-config.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,10 @@ command, so they invoices can also be paid onchain.

This option makes the `getroutes` call fail if it takes more than this many seconds. Setting it to zero is a fun way to ensure your node never makes payments.

* **askrene-max-threads**=*NUMBER* [plugin `askrene`, *dynamic*]

This option controls how many routes askrene will calculate at once: this is only useful on nodes which make multiple payments at once, and setting the number higher than your number of cores/CPUS will not help. The default is 4.

### Networking options

Note that for simple setups, the implicit *autolisten* option does the
Expand Down
2 changes: 1 addition & 1 deletion lightningd/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ static inline bool scid_to_channel_eq_scid(const struct scid_to_channel *scidcha
/* Define channel_scid_map */
HTABLE_DEFINE_NODUPS_TYPE(struct scid_to_channel,
scid_to_channel_key,
short_channel_id_hash,
hash_scid,
scid_to_channel_eq_scid,
channel_scid_map);

Expand Down
40 changes: 17 additions & 23 deletions plugins/askrene/Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
PLUGIN_ASKRENE_SRC := \
PLUGIN_ASKRENE_PARENT_SRC := \
plugins/askrene/askrene.c \
plugins/askrene/datastore_wire.c \
plugins/askrene/layer.c \
plugins/askrene/reserve.c \
plugins/askrene/mcf.c \
plugins/askrene/dijkstra.c \
plugins/askrene/flow.c \
plugins/askrene/refine.c \
plugins/askrene/explain_failure.c \
plugins/askrene/graph.c \
plugins/askrene/priorityqueue.c \
plugins/askrene/algorithm.c
plugins/askrene/reserve.c

PLUGIN_ASKRENE_HEADER := \
plugins/askrene/askrene.h \
plugins/askrene/datastore_wire.h \
plugins/askrene/layer.h \
plugins/askrene/reserve.h \
plugins/askrene/mcf.h \
plugins/askrene/dijkstra.h \
plugins/askrene/flow.h \
plugins/askrene/refine.h \
plugins/askrene/explain_failure.h \
plugins/askrene/graph.h \
plugins/askrene/priorityqueue.h \
plugins/askrene/algorithm.h
PLUGIN_ASKRENE_CHILD_SRC := \
plugins/askrene/child/child.c \
plugins/askrene/child/mcf.c \
plugins/askrene/child/dijkstra.c \
plugins/askrene/child/flow.c \
plugins/askrene/child/refine.c \
plugins/askrene/child/explain_failure.c \
plugins/askrene/child/graph.c \
plugins/askrene/child/priorityqueue.c \
plugins/askrene/child/algorithm.c \
plugins/askrene/child/child_log.c \
plugins/askrene/child/route_query.c \

PLUGIN_ASKRENE_SRC := $(PLUGIN_ASKRENE_PARENT_SRC) $(PLUGIN_ASKRENE_CHILD_SRC)
PLUGIN_ASKRENE_HEADER := $(PLUGIN_ASKRENE_SRC:.c=.h) plugins/askrene/child/additional_costs.h

PLUGIN_ASKRENE_OBJS := $(PLUGIN_ASKRENE_SRC:.c=.o)

Expand Down
Loading
Loading