Closed vincenzopalazzo closed 6 months ago
There is a second stacktrace by @Sjors here: https://github.com/ElementsProject/lightning/issues/7126#issuecomment-1976411464
Given the other one was closed, I suggest renaming this to omit "offer", because the crash happens with bolt11 too.
I have not worked yet on BOLT12 support on renepay. Until I do I will place some lines to make it refuse BOLT12 requests.
On the other hand, the assertion seems to be raised when some channel along the route has max_htlc = min_htlc
.
I will PR a quick fix and some test case if my reasoning is correct.
That's it, this is the fix, there is nothing more to add.
diff --git a/plugins/renepay/mcf.c b/plugins/renepay/mcf.c
index c3f54b6b9..21467ef1a 100644
--- a/plugins/renepay/mcf.c
+++ b/plugins/renepay/mcf.c
@@ -1230,6 +1230,8 @@ struct list_data
static inline uint64_t pseudorand_interval(uint64_t a, uint64_t b)
{
+ if (a == b)
+ return b;
assert(b > a);
return a + pseudorand(b - a);
}
I was actually working on adding a reg-test but I don't think the overhead of having an extra test that triggers only this bug is worth the extra cycles.
I have the following bol 12 invoice
lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrc2yfxkjmn9wgsrzgrvd9nksarwd9hxwgrsv9uk7at5ypnx7u3qda3k2ctwzcss98x6ecf95avm2gz9gder7dy6fxm568rt23g7paa2kzrkxrvh6nrp
and the following channels
I get the following crash