Commit graph

11 commits

Author SHA1 Message Date
Ken Sedgwick
a2296177ba
Dowser, ActiveProber: restore self-exclusion via a shared clboss-self layer
The getroute -> getroutes migrations dropped the legacy
exclude=[self_id] argument in the two probing modules whose askrene
source is a remote node.  Nothing replaced it: askrene's gossmap
includes our public channels like anyone else's, and an empty layers
array applies no exclusions.  Consequences:

- Dowser capacity probes could route part of the candidate->patron
  flow through our own node, counting our own liquidity toward a
  candidate's capacity -- retaining weak candidates and over-sizing
  the channels ChannelCreator opens.

- ActiveProber probes could pick path[0] = peer->us, degenerating
  into a circular us->peer->us payment that measures our own shared
  channel's peer->us balance instead of the peer's outward reach,
  with SendpayResultMonitor crediting the peer destination_reached
  for it.

Introduce AskreneLayer::self_layer_name ("clboss-self"): a tiny
persistent layer whose only content is our node in disabled_nodes,
maintained by AskreneLayer::ensure_self_layer() (idempotent create,
deduped disable).  Both modules resolve it before probing and name it
in their getroutes layers array; when askrene is unavailable they
probe without it, as before.  Kept separate from the clboss layer --
whose disabled_nodes also carries self -- because that layer's
learned constraints would bias what the probes measure.
2026-08-04 11:01:55 -07:00
Ken Sedgwick
b22a9c21b5
Dowser: migrate getroute -> getroutes for CLN v26.06 compat
CLN v26.06 deprecates getroute in favor of askrene's getroutes.
Replace the Dowser's getroute+listchannels loop (up to ~40 RPC
round-trips) with a single getroutes call and let askrene's
min-cost-flow solver enumerate multi-path capacity directly. Response
parsing follows the getroutes schema; 205/206 (no route / too
expensive) maps to zero capacity.

Size the probe to the caller's threshold. The Dowser is a flow
estimator: callers compare the dowsed flow against a channel size (the
janitor and preinvestigator min-channel acceptance test, the channel
creator's sizing). A fixed probe amount caps the estimate, so any
threshold at or above that cap rejects every candidate regardless of
real capacity. RequestDowser now carries a min_amount; callers that
test against a channel size set it, and the probe runs at
min_amount / reserve_factor so a full-flow result clears the threshold
for any configured channel size. The channel creator dowses at
max-channel so new channels size toward the operator ceiling instead
of being pinned at the min-channel floor. The manual clboss-dowser
command keeps the fixed default probe.
2026-08-04 11:01:39 -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