clboss/tests
Ken Sedgwick c130d9b454
EarningsTracker: attribute rebalances from the move response, not a requester-keyed map
Completed rebalances were correlated back to their (source,
destination) through an in-memory map keyed only by the
RequestMoveFunds requester pointer. When one rebalancer issues several
moves at once they share a single requester (EarningsRebalancer uses
its module pointer; JitRebalancer uses nullptr), so each request
overwrote the previous map entry. As the moves completed, the first
response consumed and erased the shared entry -- booking against
whatever pair happened to be written last -- and every later response,
including the actually-successful one, hit the not-in-our-table path
and was silently dropped.

Effect: rebalance spend and volume were under-counted and sometimes
mis-attributed to the wrong peer. That also starved the
EarningsRebalancer refusing-to-throw-good-money-after-bad guard of
accurate expenditure data. JIT-dominated periods looked fine only
because those moves complete one at a time and rarely overlap; an
EarningsRebalancer-dominated period booked almost nothing.

Fix: ResponseMoveFunds now carries source and destination
directly. FundsMover/Runner populates them and EarningsTracker books
the move straight from the response. The requester-keyed pendings map,
the RequestMoveFunds subscription, and request_move_funds are
removed. This mirrors the existing XRebalanceAttribution path, which
already passes source/destination in its message.

Tests: ResponseMoveFunds constructions updated across the rebalancer
and earnings tests; test_earningstracker now issues two moves under
the same requester and asserts both are booked and correctly
attributed -- a regression guard for the collision. Full suite 85/85.
2026-06-23 14:12:04 -07:00
..
bitcoin Bitcoin/addr_to_scriptPubKey.cpp: Make a little more robust, add BIP173 test vectors. 2020-09-24 14:36:02 +08:00
boltz Boltz/Detail/match_lockscript.cpp: Function to check if the BOLTZ instance gave correct redeemscript. 2020-09-21 15:32:25 +08:00
boss EarningsTracker: attribute rebalances from the move response, not a requester-keyed map 2026-06-23 14:12:04 -07:00
dnsseed Add test cases for DNS seed parser crash on SOA records (#309) 2026-03-23 11:06:27 -07:00
ev tests: Cover more paths to try_schedule_cleanup 2026-01-21 11:40:43 -08:00
graph Graph/Dijkstra.hpp: Shortest-path-tree algorithm. 2020-10-02 12:10:52 +08:00
jsmn add Jsmn::Object::operator== 2024-09-25 13:23:04 -05:00
json Json/Out.hpp: JSON output. 2020-09-07 16:03:21 +08:00
ln *: Use Ln::CommandId for command IDs for received commands and hook events. 2022-11-23 00:36:43 +08:00
net Net/IPAddrOrOnion.cpp: Data type that could be either an IP address or onion hidden service. 2020-12-30 23:14:10 +00:00
ripemd160 tests/ripemd160/test_ripemd160.cpp: Check our understanding of endianness is correct. 2020-09-21 15:44:33 +08:00
s Ev/Io.hpp: Avoid copying objects, just move things around. 2020-09-14 09:12:46 +08:00
sha256 Sha256/HasherStream.cpp: std::ostream implementation of hasher. 2020-09-20 13:53:02 +08:00
sqlite3 Sqlite3*: Complete SQLITE3 support. 2020-09-12 15:29:03 +08:00
stats Stats/ReservoirSampler.hpp: Reservoir sampler implementation. 2020-10-01 16:51:59 +08:00
util feat: add clang C++20 build job to CI 2026-03-04 11:24:31 -08:00
test_uuid.cpp Uuid.cpp: Universally-unique identifiers. 2020-09-27 19:16:57 +08:00