core-lightning/plugins/askrene
Rusty Russell 01bce4e7b7 askrene: don't crash if asked to route 0 msat.
But don't allow it either.

```
Jan 19 13:18:52 boltz lightningd[2259911]: cln-askrene: plugins/askrene/algorithm.c:274: simple_feasibleflow: Assertion `amount > 0' failed.
Jan 19 13:18:52 boltz lightningd[2259911]: cln-askrene: FATAL SIGNAL 6 (version v24.11.1-1-ge9dbdeb)
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e212b407 send_backtrace
Jan 19 13:18:52 boltz lightningd[2259911]:         common/daemon.c:33
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e212b49e crashdump
Jan 19 13:18:52 boltz lightningd[2259911]:         common/daemon.c:75
Jan 19 13:18:52 boltz lightningd[2259911]: 0x7f964ba9251f ???
Jan 19 13:18:52 boltz lightningd[2259911]:         ???:0
Jan 19 13:18:52 boltz lightningd[2259911]: 0x7f964bae69fc ???
Jan 19 13:18:52 boltz lightningd[2259911]:         ???:0
Jan 19 13:18:52 boltz lightningd[2259911]: 0x7f964ba92475 ???
Jan 19 13:18:52 boltz lightningd[2259911]:         ???:0
Jan 19 13:18:52 boltz lightningd[2259911]: 0x7f964ba787f2 ???
Jan 19 13:18:52 boltz lightningd[2259911]:         ???:0
Jan 19 13:18:52 boltz lightningd[2259911]: 0x7f964ba7871a ???
Jan 19 13:18:52 boltz lightningd[2259911]:         ???:0
Jan 19 13:18:52 boltz lightningd[2259911]: 0x7f964ba89e95 ???
Jan 19 13:18:52 boltz lightningd[2259911]:         ???:0
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e211695e simple_feasibleflow
Jan 19 13:18:52 boltz lightningd[2259911]:         plugins/askrene/algorithm.c:274
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e2111495 minflow
Jan 19 13:18:52 boltz lightningd[2259911]:         plugins/askrene/mcf.c:1014
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e210bc74 get_routes
Jan 19 13:18:52 boltz lightningd[2259911]:         plugins/askrene/askrene.c:414
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e210c610 do_getroutes
Jan 19 13:18:52 boltz lightningd[2259911]:         plugins/askrene/askrene.c:615
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e210cad8 listpeerchannels_done
Jan 19 13:18:52 boltz lightningd[2259911]:         plugins/askrene/askrene.c:741
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e211b35a handle_rpc_reply
Jan 19 13:18:52 boltz lightningd[2259911]:         plugins/libplugin.c:1084
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e211b54c rpc_read_response_one
Jan 19 13:18:52 boltz lightningd[2259911]:         plugins/libplugin.c:1388
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e211b5fd rpc_conn_read_response
Jan 19 13:18:52 boltz lightningd[2259911]:         plugins/libplugin.c:1412
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e214fe8f next_plan
Jan 19 13:18:52 boltz lightningd[2259911]:         ccan/ccan/io/io.c:60
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e215036e do_plan
Jan 19 13:18:52 boltz lightningd[2259911]:         ccan/ccan/io/io.c:422
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e215042b io_ready
Jan 19 13:18:52 boltz lightningd[2259911]:         ccan/ccan/io/io.c:439
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e2151e2e io_loop
Jan 19 13:18:52 boltz lightningd[2259911]:         ccan/ccan/io/poll.c:455
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e211cc29 plugin_main
Jan 19 13:18:52 boltz lightningd[2259911]:         plugins/libplugin.c:2488
Jan 19 13:18:52 boltz lightningd[2259911]: 0x5576e210cb38 main
Jan 19 13:18:52 boltz lightningd[2259911]:         plugins/askrene/askrene.c:1262
Jan 19 13:18:52 boltz lightningd[2259911]: 0x7f964ba79d8f ???
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: JSON-RPC: `getroutes` will refuse, not crash, if asked to find a route fr 0msat.
2025-01-28 10:53:22 +10:30
..
test askrene: add compiler flag ASKRENE_UNITTEST 2024-11-21 16:17:52 +10:30
algorithm.c askrene: bugfix queue overflow 2024-11-21 16:17:52 +10:30
algorithm.h askrene: add mcf_refinement to the public API 2024-11-21 16:17:52 +10:30
askrene.c askrene: don't crash if asked to route 0 msat. 2025-01-28 10:53:22 +10:30
askrene.h askrene: persistent layer support. 2024-11-08 21:48:55 +10:30
dijkstra.c askrene: copy flow and dijkstra from renepay. 2024-08-07 20:35:30 +09:30
dijkstra.h askrene: copy flow and dijkstra from renepay. 2024-08-07 20:35:30 +09:30
explain_failure.c askrene: more logging in explain_failure. 2024-10-15 09:58:04 +10:30
explain_failure.h askrene: give better feedback when we can't find a suitable route. 2024-10-04 11:27:53 +09:30
flow.c askrene: remove flowset_probability() now refine step calculates it. 2024-10-15 09:58:04 +10:30
flow.h askrene: remove flowset_probability() now refine step calculates it. 2024-10-15 09:58:04 +10:30
graph.c askrene: remove allocation checks 2024-11-21 16:17:52 +10:30
graph.h askrene: small fixes suggested by Rusty Russell 2024-11-21 16:17:52 +10:30
layer.c ccan/htable: update to explicit DUPS/NODUPS types. 2025-01-21 09:18:25 +10:30
layer.h askrene: really fix race between layer creation and persistent layer loading. 2024-11-26 16:04:13 +10:30
Makefile askrene: add graph algorithms module 2024-11-21 16:17:52 +10:30
mcf.c Askrene: change median factor to 1. 2024-11-21 16:17:52 +10:30
mcf.h askrene: debug and check we actually reduce fees when mu increase. 2024-10-15 09:58:04 +10:30
priorityqueue.c askrene: add priorityqueue 2024-11-21 16:17:52 +10:30
priorityqueue.h askrene: add priorityqueue 2024-11-21 16:17:52 +10:30
refine.c askrene: remove flowset_probability() now refine step calculates it. 2024-10-15 09:58:04 +10:30
refine.h askrene: use refine step to calculate flowset probability. 2024-10-15 09:58:04 +10:30
reserve.c ccan/htable: update to explicit DUPS/NODUPS types. 2025-01-21 09:18:25 +10:30
reserve.h askrene: give better feedback when we can't find a suitable route. 2024-10-04 11:27:53 +09:30