Commit graph

19 commits

Author SHA1 Message Date
Ken Sedgwick
e00758aac3
Add rebalancer mode selector (classic/off) as a dynamic option
Introduces a single source of truth for which rebalancing track is
active.  Boss::Mod::RebalanceModeManager owns the mode in memory (no
sqlite, so a restart reverts to the configured default, giving a
known-good baseline on every boot) and registers clboss-rebalance-mode
as a dynamic option: the config file sets the startup default and
`setconfig clboss-rebalance-mode <mode>` switches it at runtime without
a restart.  It answers RequestRebalanceMode queries and reports the mode
under clboss-status.

Modes are "classic" (run the rebalancer) and "off" (a real quiesce,
also the supported way to disable rebalancing entirely).  This is the
seam that later lets a second rebalancing track coexist and be toggled
without a restart.

The classic-track rebalancers self-gate on the mode at their existing
decision points, modeled on RebalanceUnmanager: EarningsRebalancer gates
its trigger, InitialRebalancer gates its run, and JitRebalancer gates
the top of htlc_accepted so that in off mode it does not defer the HTLC
and adds no forwarding latency.  A header-only Boss::ModG::
RebalanceModeProxy provides get_mode for the gate sites.  off composes
with the existing per-peer unmanage balance tag: off wins globally,
otherwise the per-peer tag still excludes specific peers.

The three rebalancers' unit tests now install a RebalanceModeManager on
the test bus so the self-gate query is answered (default classic, so
they behave as before).  Without a responder the RequestRebalanceMode
ReqResp is never satisfied and leaks, which the valgrind-checked tests
flag as a failure.

New files: Boss/RebalanceMode.hpp, Boss/Msg/RequestRebalanceMode.hpp,
Boss/Msg/ResponseRebalanceMode.hpp, Boss/ModG/RebalanceModeProxy.hpp,
Boss/Mod/RebalanceModeManager.{hpp,cpp}.
2026-08-04 11:01:46 -07:00
Ken Sedgwick
56f405f063 Improve the ConstructedListpeers handling diagnostics
Hopefully this pattern will prove useful in future debugging
improvements.
2024-07-16 16:01:56 -07:00
Ken Sedgwick
0bd255ce1b Convert ListpeerResult to use ConstructedListpeers
Construct a "compatibility struct" to convert `listpeerchannels`
output into legacy `listpeers` format.

Tests written using the legacy listpeers format can use the
`convert_legacy_listpeers` utility to construct a compatibility
struct.

The test_peerjudge_datagatherer malformed test needed to be malformed
differently to achieve the desired effect.
2024-06-02 16:19:56 -07:00
Ken Sedgwick
2c7ce2f5b9 remove references to the "private" field of listpeers channel info
Fixes issue ([#193])

Changelog-Fixed: Removed references to deprecated "private" field of channel info returned from API.
2024-04-16 16:37:27 -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
11bb7a6c19 Boss/Mod/InitialRebalancer.cpp: Respect unmanagement. 2022-05-11 12:09:13 +00:00
ZmnSCPxj jxPCSnmZ
4d36356732 Boss/Mod/InitialRebalancer.cpp: Add logs on result of movement attempts. 2021-05-17 09:28:29 +08:00
ZmnSCPxj jxPCSnmZ
f01a730e82 Boss/Mod/InitialRebalancer.cpp: Fix latent bug with keeping track of current sources. 2021-04-08 18:00:21 +08:00
ZmnSCPxj jxPCSnmZ
23566f3e85 Boss/Mod/InitialRebalancer.cpp: Reduce limits. 2021-02-15 11:02:11 +08:00
ZmnSCPxj jxPCSnmZ
bfdba6ca5c Boss/Mod/InitialRebalancer.cpp: Prevent multiple attempts at rebalancing in case of slow rebalances. 2021-02-11 15:01:00 +08:00
ZmnSCPxj jxPCSnmZ
4cd661c45b Boss/Mod/InitialRebalancer.cpp: Fix bug that inadvertently completely disables it. 2021-02-10 08:37:47 +08:00
ZmnSCPxj jxPCSnmZ
bd9b145461 Boss/Mod/InitialRebalancer.cpp: Limit how much this module expends. 2021-01-11 14:42:15 +08:00
ZmnSCPxj jxPCSnmZ
66274457b1 Boss/Mod/InitialRebalancer.cpp: Put a gap between sources and destinations, so that destination does not become source in the next cycle. 2020-11-22 01:55:51 +08:00
ZmnSCPxj jxPCSnmZ
6e79413e41 Boss/Mod/InitialRebalancer.cpp: Correct how we handle channels > 42.94mBTC. 2020-11-16 23:53:38 +08:00
ZmnSCPxj jxPCSnmZ
bac555539d Boss/Mod/InitialRebalancer.cpp: Scale fee according to size of transfer. 2020-10-28 08:58:51 +08:00
ZmnSCPxj jxPCSnmZ
91e1aa9eb9 Boss/Mod/InitialRebalancer.cpp, Boss/Mod/JitRebalancer.cpp: Make sure ReqResp objects are on persistent objects. 2020-10-28 08:35:08 +08:00
ZmnSCPxj jxPCSnmZ
c2311cc9d4 Boss/Mod/InitialRebalancer.cpp, Boss/Mod/JitRebalancer.cpp: Increase limits on rebalancing fees. 2020-10-27 21:40:28 +08:00
ZmnSCPxj jxPCSnmZ
7732e9d248 Boss/Mod/InitialRebalancer.cpp: Module to rebalance channels that are heavily owned by us. 2020-10-26 11:31:33 +08:00