clboss/Boss/Mod/ChannelCreator
Ken Sedgwick f6f7070da8
Some checks failed
Code Base Sanity Check / tests (push) Has been cancelled
Code Base Sanity Check / coverage (push) Has been cancelled
Code Base Sanity Check / build-clang (push) Has been cancelled
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-11 10:48:26 -07:00
..
Carpenter.cpp Insert exception what() value in logging messages 2024-08-19 15:04:30 -07:00
Carpenter.hpp Boss/Mod/ChannelCreator/Carpenter.cpp: Implement actual channel creation. 2020-09-17 14:02:24 +08:00
Main.cpp Boss/Mod/ChannelCreator/Carpenter.cpp: Implement actual channel creation. 2020-09-17 14:02:24 +08:00
Main.hpp Boss/Mod/ChannelCreator/Carpenter.cpp: Implement actual channel creation. 2020-09-17 14:02:24 +08:00
Manager.cpp AmountSettingsHandler: enforce the Planner's channel size precondition (#147) 2026-08-11 10:48:26 -07:00
Manager.hpp ChannelCreator: prefer spliceable peers within the no-record tier 2026-08-04 11:02:22 -07:00
Planner.cpp Boss/Mod/ChannelCreator/Planner.cpp: Change priority of a check. 2022-05-14 10:23:40 +00:00
Planner.hpp 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
README.md Boss/Mod/ChannelCreator/Planner.cpp: Initial cut at planner. 2020-09-16 22:35:28 +08:00
RearrangerBySize.cpp Boss/Mod/ChannelCreator/Manager.cpp: Rearrange by size first, then create. 2021-04-13 12:28:00 +08:00
RearrangerBySize.hpp Boss/Mod/ChannelCreator/Manager.cpp: Rearrange by size first, then create. 2021-04-13 12:28:00 +08:00
Reprioritizer.cpp Boss/Mod/ChannelCreator/Reprioritizer.cpp: Module to reprioritize channel creation proposals. 2020-12-30 23:14:10 +00:00
Reprioritizer.hpp Boss/Mod/ChannelCreator/Reprioritizer.cpp: Module to reprioritize channel creation proposals. 2020-12-30 23:14:10 +00:00

This module creates channels.

It reacts to Boss::Msg::RequestChannelCreation, then queries a Boss::Mod::ChannelCandidateInvestigator::Main for candidates, then figures out some kind of divison of available funds to those candidates.

  • Dowser - given a single candidate, attempts to figure out some recommended amount to put in a channel for this. This object is created at runtime for each recommended candidate.
  • Planner - given an amount, some proposal nodes, and how many channels we already have, creates a plan of how to build channels. This object is created at runtime when we have onchain funds we want to use.
  • Carpenter - actually constructs channels, and reports channel creation success and failure.
  • Manager - handles the above objects, and wrangles with most messages received.
  • Main - Holds the Carpenter and Manager.