Commit graph

15 commits

Author SHA1 Message Date
Ken Sedgwick
6b3bdd7df1
AmountSettingsHandler: enforce the Planner's channel size precondition (#147)
The ChannelCreator Planner asserts
min_channel + min_remaining <= max_channel at construction, where
min_remaining = 2 * min_channel + 20000 sats.  Option validation
only enforced max_channel >= 2 * min_channel, so a pair such as
min-channel=1000000 max-channel=2000000 passed startup and aborted
the plugin on the first channel-creation run (#147).  The old 2x
clamp never prevented the crash: any pair it adjusted still
violated the planner precondition.

AmountSettingsHandler now enforces the precondition directly.  On
conflict it keeps max-channel, which sets typical open size, and
lowers min-channel to the largest fitting value, logging a warning.
A max-channel too low for even the smallest permitted min-channel
is raised.

ChannelCreator::Manager also re-checks both planner preconditions
before constructing the Planner and skips the creation cycle with a
log line instead of aborting.  This covers the sibling assert
min_amount * 2 <= total, which fails when onchain funds change
between the decider's trigger and the creator's run (#137).
2026-08-14 13:33:45 -07:00
Ken Sedgwick
8a25d69395
ChannelCreator: prefer spliceable peers within the no-record tier
The track-record pass orders open proposals keepers, no-record,
underperformers.  The no-record tier carries no earnings evidence,
so order it by a capability prior: nodes whose node_announcement
advertises splicing (BOLT 9 option_splice, bits 62/63) come first,
since their channels can later be resized without a close and
reopen.  Keepers and underperformers keep their earnings-based
order, and nothing moves across a tier boundary.

New Ln::feature_bit tests a bit in a BOLT 9 hex bitfield (bit 0 is
the least-significant bit of the last byte), with a unit test.
Spliceability is looked up per candidate via listnodes; an RPC
failure or absent features field counts as not spliceable, so the
lookup cannot block channel creation.  The Track records report
marks spliceable no-record nodes with an (S) suffix.
2026-08-14 13:33:37 -07:00
Ken Sedgwick
fe79e403c0
ChannelCreator: fund candidates in track-record tier order
After the size rearranger and the IP-binning reprioritizer, partition
the proposal list by track-record verdict: keepers first, then
candidates with no record, then underperformers.  Within a tier the
earlier stages' order is preserved.  Because the Planner consumes
proposals in order until funds run out, placing a tier last implements
'only used if no better candidate can absorb the funds' without an
outright veto.  The partition runs last so the earlier perturbation
stages cannot promote a candidate across a tier boundary.

Logs one Info line per creation request with the per-tier membership
and each judged candidate's TRAL and observed days.
2026-08-14 13:33:30 -07:00
Ken Sedgwick
70c54a0cdf
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-14 13:32:56 -07:00
ZmnSCPxj jxPCSnmZ
a34b8f39e8 Boss/Mod/AmountSettingsHandler.cpp: New module to centralize some size settings. 2022-04-21 12:40:02 +08:00
ZmnSCPxj jxPCSnmZ
03c0bd2b34 Boss/Mod/*: Fix pedantic warnings from clang. 2021-05-02 16:41:09 +08:00
ZmnSCPxj jxPCSnmZ
d815f406f3 Boss/Mod/ChannelCreator/Manager.cpp: Rearrange by size first, then create. 2021-04-13 12:28:00 +08:00
ZmnSCPxj jxPCSnmZ
590267a701 Boss/Mod/ChannelCreator/RearrangerBySize.cpp: Sub-module to slightly rearrange proposals by the size of channels we would make to them. 2021-04-13 12:28:00 +08:00
ZmnSCPxj jxPCSnmZ
f020b3e65d Boss/Mod/ChannelCreator/Manager.cpp: Integrate Reprioritizer. 2020-12-30 23:14:10 +00:00
ZmnSCPxj jxPCSnmZ
41bd7bc6af *: Silence clang warnings. 2020-11-02 19:02:35 +08:00
ZmnSCPxj jxPCSnmZ
9798c126ca Boss/Mod/ChannelCreator/Manager.cpp: Make sure plan is not empty. 2020-11-02 14:13:34 +08:00
ZmnSCPxj jxPCSnmZ
dd84e65af5 Boss/Mod/ChannelCreator/Manager.cpp: Remove Boss::Mod::ChannelCreator::Dowser. 2020-10-12 15:37:57 +08:00
ZmnSCPxj jxPCSnmZ
c7a65b6a95 Boss/Mod/ChannelCreator/: Reject proposals that have too little liquidity to their patrons, do not give them minimum liquidity. 2020-10-01 09:01:37 +08:00
ZmnSCPxj jxPCSnmZ
7b44afbf6c Boss/Mod/ChannelCreator/Carpenter.cpp: Implement actual channel creation. 2020-09-17 14:02:24 +08:00
ZmnSCPxj jxPCSnmZ
51fe055a44 Boss/Mod/ChannelCreator/: Fill in more. 2020-09-17 08:47:51 +08:00