clboss/tests/boss
Ken Sedgwick 986f30d1b4
Some checks are pending
Code Base Sanity Check / tests (push) Waiting to run
Code Base Sanity Check / coverage (push) Waiting to run
Code Base Sanity Check / build-clang (push) Waiting to run
PeerComplaintsDesk: defer auto-close while the peer is offline
close was issued with unilateraltimeout=180 on a fixed timer,
without regard to the peer's connection state, while one complaint
source (ComplainerByLowConnectRate) selects peers specifically for
a low connect rate.  Closing while the peer is offline escalates
to a unilateral force-close after 3 minutes, against exactly the
peers least likely to negotiate a mutual close in time.

Check the peer's channels for a live connection (listpeerchannels
peer_connected) before issuing close, and defer while the peer is
offline.  Poll close candidates every 10 minutes rather than once
per solicitation cycle, so a flaky peer's brief online windows are
actually caught.  If the peer stays offline for close_patience
(3 days), close anyway and let the short unilateral timeout
escalate; the first-deferred time is persisted in a new
PeerComplaintsDesk_closepending table so restarts do not reset
the patience window.  The fees_low gate applies only to that
unilateral path: a mutual close even at high feerates is cheaper
than a unilateral at low feerates, so connected peers are closed
immediately regardless of feerate.

Add tests/boss/test_peercomplaintsdesk_main.cpp covering the close
paths: a connected peer closes immediately; an offline peer defers
and the deferral survives a restart; within patience it holds;
expired patience holds at high fees and closes at low fees;
dropping below the complaint threshold sweeps the deferral;
channel destruction clears it; disabled auto-close closes nothing.
The test drives the module over the bus with a mock CLN on a
socketpair.

Reported by an external security researcher via private disclosure.

Fixes #324
2026-08-13 13:18:04 -07:00
..
channelcandidateinvestigator Boss/Mod/ChannelCandidateInvestigator/: Limit maximum score of nodes. 2020-09-13 18:45:11 +08:00
test_availablerpccommandsannouncer.cpp Add clboss-feerates RPC 2025-07-07 11:21:09 -07:00
test_channel_create_destroy_monitor_missing_old_state.cpp ChannelCreateDestroyMonitor: tolerate missing old_state (CLN v26.06) 2026-08-06 16:41:57 -07:00
test_channelcreationdecider.cpp Boss/Mod/AmountSettingsHandler.cpp: New module to centralize some size settings. 2022-04-21 12:40:02 +08:00
test_channelcreator_planner.cpp 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
test_channelcreator_rearrangerbysize.cpp 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
test_channelcreator_reprioritizer.cpp Boss/Mod/ChannelCreator/Reprioritizer.cpp: Module to reprioritize channel creation proposals. 2020-12-30 23:14:10 +00:00
test_earningshistory.cpp add "all" (by_node) mode to clboss-earnings-history API 2026-01-22 11:09:08 -08:00
test_earningsrebalancer.cpp feat: add clang C++20 build job to CI 2026-03-04 11:24:31 -08:00
test_earningstracker.cpp Add associated primary volume (forwarded and rebalanced) to EarningsTracker 2024-09-25 13:23:04 -05:00
test_feemodderbypricetheory.cpp feemon: add price theory center price 2026-02-27 14:28:55 -08:00
test_feemon_history.cpp feemon: add clboss-feemon-peers to determine peer set for time window 2026-02-27 14:28:59 -08:00
test_forwardfeemonitor.cpp Add associated primary volume (forwarded and rebalanced) to EarningsTracker 2024-09-25 13:23:04 -05:00
test_getmanifest.cpp Expose min_nodes_to_process as a configurable option 2025-09-11 13:49:22 -07:00
test_initialrebalancer.cpp feat: add clang C++20 build job to CI 2026-03-04 11:24:31 -08:00
test_initiator_listconfigs_proxy.cpp add a unit test for listconfigs format handling to prevent regression 2026-02-19 14:47:32 -08:00
test_invoicepayer_decodepay.cpp fix: make the argument to decode "string" instead of "bolt11" 2026-02-17 15:49:04 -08:00
test_jitrebalancer.cpp PeerComplaintsDesk: defer auto-close while the peer is offline 2026-08-13 13:18:04 -07:00
test_needsconnectsolicitor.cpp *: Silence clang warnings. 2020-11-02 19:02:35 +08:00
test_onchainfeemonitor_samples_init.cpp Improve Initialization of OnchainFeeMonitor with Conservative Synthetic History 2024-07-16 16:02:32 -07:00
test_peercomplaintsdesk_main.cpp PeerComplaintsDesk: defer auto-close while the peer is offline 2026-08-13 13:18:04 -07:00
test_peercomplaintsdesk_recorder.cpp Boss/Mod/PeerComplaintsDesk/Recorder.cpp: Retain complaints on closed peers. 2021-04-08 18:08:45 +08:00
test_peerjudge_agetracker.cpp Boss/Mod/PeerJudge/AgeTracker.cpp: Sub-module to track age of channels. 2021-08-13 18:54:00 +08:00
test_peerjudge_algo.cpp Boss/Mod/PeerJudge/: Start creating replacement for current PeerComplaintsDesk. 2021-08-12 13:58:02 +08:00
test_peerjudge_datagatherer.cpp Convert ListpeerResult to use ConstructedListpeers 2024-06-02 16:19:56 -07:00
test_peerstatistician.cpp Boss/Msg/ReqRespTraits.hpp: Use a traits class for requests and response. 2023-07-11 20:57:51 +08:00
test_recentearnings.cpp Add associated primary volume (forwarded and rebalanced) to EarningsTracker 2024-09-25 13:23:04 -05:00
test_reqresp.cpp gcc: Fix Compatibility Issue with GCC 13 2023-08-18 12:34:08 -07:00
test_rpc.cpp tests/boss/test_rpc.cpp: Correct the previous modification. 2021-04-12 13:00:41 +08:00
test_stringid.cpp tests/boss/test_stringid.cpp: Add test for new support of string IDs in the JSON interface. 2022-11-23 20:10:55 +08:00
test_swapmanager.cpp Boss/Msg/ProvideSwapQuotation.hpp: Add string name of swap service. 2021-11-27 12:53:05 +00:00
test_unmanagedmanager.cpp *: Use Ln::CommandId for command IDs for received commands and hook events. 2022-11-23 00:36:43 +08:00
test_version.cpp Boss/open_rpc_socket.cpp: Function to open the RPC socket. 2020-09-07 21:50:38 +08:00
test_waiter_timed.cpp tests/boss/test_waiter_timed.cpp: Stress-test Waiter::timed. 2020-09-16 15:53:14 +08:00