Commit graph

10 commits

Author SHA1 Message Date
Ken Sedgwick
1ce32aeef7
Dowser: migrate getroute -> getroutes for CLN v26.06 compat
CLN v26.06 deprecates the getroute JSON-RPC in favor of the
askrene-backed getroutes (plugins/topology.c:615-620,
doc/developers-guide/deprecated-features.md).  On lightningd
configurations where deprecated APIs are disabled (developer mode
or explicit allow-deprecated-apis=false), every getroute call
fails with -32601; as a result every Dowser run returns 0msat and
the Janitor rejects every candidate it considers.

The previous algorithm ran getroute up to 10 times with accumulated
excludes, then queried listchannels per hop to estimate bottleneck
capacity.  The new code makes a single getroutes call asking askrene
to deliver a 1_000_000 sat probe via up to maxparts=10 paths.  On
success the sum of routes[*].amount_msat (less a 1.5% reserve
factor preserved from the legacy code) is reported as the dowsed
capacity; on any RpcError (including 205 "Unable to find a route"
and 206 "Route too expensive") the dowsed capacity is 0msat.  ~40
RPC roundtrips per dowse collapse to 1.

Probe parameters chosen generously to avoid spurious 206 errors
masking real route availability: 5_000 sat max-fee, 14-block
final-cltv, layers ["auto.localchans","auto.sourcefree"].  These
can be tuned after observing behavior on signet.

Drive-by: Run::self_id (and the plumbing that fed it) is removed
along with three now-unused includes.  The legacy algorithm seeded
its excludes vector with self_id; the new design has no excludes.

Highest-leverage of CLBOSS's four getroute call sites; the other
three (ChannelCandidateMatchmaker, ActiveProber,
FundsMover/Attempter) follow in subsequent commits/PRs.
2026-05-20 16:06:14 -07:00
Ken Sedgwick
0c9ec733d0 Convert deprecated "msatoshi" fields to "amount_msat"
The type of the value also changes from string to integer.

Was seeing "unknown parameter: msatoshi" in the log ...
2024-04-05 12:48:08 -07:00
Ken Sedgwick
60c07a7d66 Handle JSON-RPC msat amounts in either the old or new conventions 2023-08-18 20:29:21 -07:00
ZmnSCPxj jxPCSnmZ
b2def4c51e Boss/Msg/ReqRespTraits.hpp: Use a traits class for requests and response. 2023-07-11 20:57:51 +08:00
ZmnSCPxj jxPCSnmZ
64ca360f65 *: Use Ln::CommandId for command IDs for received commands and hook events. 2022-11-23 00:36:43 +08:00
ZmnSCPxj jxPCSnmZ
a9d0ad9b18 Boss/Mod/: Use iterators instead of indexing for Jsmn::Object types.
Closes: #28
2020-11-18 16:46:20 +08:00
ZmnSCPxj jxPCSnmZ
94d779bcca Boss/Msg/RequestDowser.hpp: Make explicit that dowsing has a direction.
Channel directions can be individually active or inactive, which affects
routing directions.
Thus, a dowsing request in on direction may have a different result in
the opposite direction.

Existing clients of the `Dowser` assume the first argument is the source
(proposal) and the second argument is the destination (patron), but the
`Dowser` used the first argument as the destination instead.
This also flips the `Dowser` direction.
2020-11-17 11:57:00 +08:00
ZmnSCPxj jxPCSnmZ
22283a16f3 Boss/Mod/Dowser.cpp: Implement clboss-dowser command for testing dowser algo. 2020-11-17 11:11:26 +08:00
ZmnSCPxj jxPCSnmZ
41bd7bc6af *: Silence clang warnings. 2020-11-02 19:02:35 +08:00
ZmnSCPxj jxPCSnmZ
c39c641e05 Boss/Mod/Dowser.cpp: Move dowser to its own separate module. 2020-10-12 15:19:31 +08:00