Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
f7c0ac7
libplugin: add command_finish_rawstr() for when we're simply repeatin…
rustyrussell Dec 4, 2025
8246198
bitcoin: hash_scid and hash_scidd public functions.
rustyrussell Dec 4, 2025
0017315
askrene: make minflow() static, and remove unused linear_flow_cost.
rustyrussell Dec 4, 2025
0077857
askrene: fork before calling the route solver.
rustyrussell Dec 4, 2025
edc5ead
askrene: add child_log function so child can do logging.
rustyrussell Dec 4, 2025
30b8179
askrene: move routines only accessed by the child process into child/.
rustyrussell Dec 5, 2025
8eb900f
askrene: move fmt_flow_full from askrene.c into flow.c.
rustyrussell Dec 5, 2025
0ee92bd
askrene: move fork() entry point into its own file.
rustyrussell Dec 5, 2025
cce3512
askrene: make children use child_log() instead of rq_log.
rustyrussell Dec 5, 2025
ce0a752
askrene: remove non child-friendly fields from struct route_query.
rustyrussell Dec 5, 2025
3606cb1
askrene: expose additional_costs htable so child can access it.
rustyrussell Dec 5, 2025
d262cf6
askrene: move route_query definition and functions into child/.
rustyrussell Dec 5, 2025
7506e2d
askrene: have child make `struct route_query` internally.
rustyrussell Dec 5, 2025
4825b4a
askrene: actually run children in parallel.
rustyrussell Dec 5, 2025
e67af12
askrene: limit how many children we have.
rustyrussell Dec 5, 2025
029c62c
askrene: make "child.c" to be the explicit child entry point.
rustyrussell Dec 5, 2025
87e50f5
askrene: close files in child to isolate against bugs.
rustyrussell Dec 5, 2025
8ffb1fc
pytest: rework test_real_data and test_real_biases to be parallel.
rustyrussell Dec 5, 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
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
6 changes: 1 addition & 5 deletions common/gossmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +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);
}
static size_t scid_hash(const struct short_channel_id scid)
{
return siphash24(siphash_seed(), &scid, sizeof(scid));
}
HTABLE_DEFINE_NODUPS_TYPE(ptrint_t, chanidx_id, scid_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
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 @@ -561,6 +561,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