core-lightning/common/test
Rusty Russell e50539d852 pay: ignore fees on our own channels when determining routing.
I noticed that run-route-infloop chose some worse-looking paths after
routing was fixed, eg the second node:

Before:
	Destination node, success, probability, hops, fees, cltv, scid...
	02b3aa1e4ed31be83cca4bd367b2c01e39502cb25e282a9b4520ad376a1ba0a01a,1,0.991856,2,1004,40,2572260x39x0/1,2131897x45x0/0

After:
	Destination node, success, probability, hops, fees, cltv, scid...
	02b3aa1e4ed31be83cca4bd367b2c01e39502cb25e282a9b4520ad376a1ba0a01a,1,0.954540,3,1046,46,2570715x21x0/1,2346882x26x14/1,2131897x45x0/0

This is because although the final costs don't reflect it, routing was taking
into account local channels, and 2572260x39x0/1 has a base fee of 2970.

There's an easy fix: when we the pay plugin creates localmods for our
gossip graph, add all local channels with delay and fees equal to 0.
We do the same thing in our unit test.  This improves things across
the board:

Linear success probability (when found): min-max(mean +/- stddev)
	Before: 0.487040-0.999543(0.952548+/-0.075)
	After:  0.486985-0.999750(0.975978+/-0.053)

Hops:
	Before: 1-5(2.98374+/-0.77)
	After:  1-5(2.09593+/-0.63)

Fees:
	Before: 0-50848(922.457+/-2.7e+03)
	After:  0-50041(861.621+/-2.7e+03)

Delay (blocks):
	Before: 0-196(65.8081+/-60)
	After:  0-190(60.3285+/-60)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: Plugins: `pay` route algorithm doesn't bias against our own "expensive" channels any more.
2024-03-07 14:09:14 +01:00
..
Makefile common: add routing test using real data which crashes. 2024-03-07 14:09:14 +01:00
onion-test-v0.json sphinx: Introduce a runtest command to the onion tool 2019-07-30 02:14:49 +00:00
run-amount.c bitcoin: remove unused functions, or make static. 2021-12-06 10:05:39 +10:30
run-base64.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-bigsize.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-blindedpath_enctlv.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-blindedpath_onion.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-bolt11.c common: add tal_arr_eq helper. 2024-02-16 15:02:38 +01:00
run-bolt12-encode-test.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-bolt12-format-string-test.c common: add test to generate BOLT formatting vectors. 2023-06-15 15:05:42 +09:30
run-bolt12-offer-decode.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-bolt12_decode.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-bolt12_merkle-json.c renepay: make pay_plugin a tal object. 2023-08-12 09:41:24 +09:30
run-bolt12_merkle.c common/test: fix typo in bolt12 test vector generation. 2023-01-06 20:44:50 +01:00
run-bolt12_period.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-channel_type.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-codex32.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-cryptomsg.c common: add tal_arr_eq helper. 2024-02-16 15:02:38 +01:00
run-deprecation.c Makefile: add CLN_NEXT_VERSION, functions encoding deprecation schedule. 2024-01-26 10:30:22 +10:30
run-derive_basepoints.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-features.c common: add tal_arr_eq helper. 2024-02-16 15:02:38 +01:00
run-gossmap-fp16.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-gossmap_canned.c common/gossmap: remove now-unused private flag. 2024-02-04 09:24:44 +10:30
run-gossmap_local.c common/gossmap: remove now-unused private flag. 2024-02-04 09:24:44 +10:30
run-ip_port_parsing.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-json.c cleanup: rename json_add_amount_msat_only to json_add_amount_msat 2023-03-18 15:55:49 +10:30
run-json_filter.c common: allow JSON-RPC parameters to specify deprecation versions. 2024-01-26 10:30:22 +10:30
run-json_remove.c common: allow JSON-RPC parameters to specify deprecation versions. 2024-01-26 10:30:22 +10:30
run-json_scan.c common: add tests that json_scan can omit an entire object member. 2023-12-14 09:16:56 +10:30
run-json_stream-filter.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-key_derive.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-lease_rates.c tools/gen: Always return bool! 2022-07-14 12:24:48 -05:00
run-onion-message-test.c build: don't generate experimental variants of wire files. 2023-05-23 09:34:08 +09:30
run-onion-test-vector.c common: add tal_arr_eq helper. 2024-02-16 15:02:38 +01:00
run-param.c common: don't insist on unique param() arguments. 2024-02-07 09:21:00 +10:30
run-psbt_diff.c Update libwally to 0.8.8, support PSBTv2 2023-03-23 16:10:55 +10:30
run-route-infloop.c pay: ignore fees on our own channels when determining routing. 2024-03-07 14:09:14 +01:00
run-route-specific.c common/gossip_store: clean up header. 2023-01-30 15:15:41 -06:00
run-route.c common/gossip_store: clean up header. 2023-01-30 15:15:41 -06:00
run-route_blinding_onion_test.c common: add tal_arr_eq helper. 2024-02-16 15:02:38 +01:00
run-route_blinding_test.c common: add tal_arr_eq helper. 2024-02-16 15:02:38 +01:00
run-sphinx-xor_cipher_stream.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-sphinx.c common: add tal_arr_eq helper. 2024-02-16 15:02:38 +01:00
run-tal_arr_randomize.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-tlv_span.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30
run-trace.c test: Add a run-trace test and document tracing overhead 2023-12-15 13:23:51 +10:30
run-version.c comm: make sure that our version check is reliable 2023-01-17 14:15:24 +10:30
run-wireaddr.c common: add amount_feerate helper. 2023-11-01 14:11:28 +10:30