renepay: fixups after comments

- remove internal gheap checks
- add check for arc_t.chanidx overflow
- remove outdated comments
- check the delta flow bounds before augmenting along a path
- get_flow_paths uses a dynamic tal array instead of a list.
- fix a unit test that depended on the order of returned flows
- fix bug: lightnind doesn't like if I reuse the partid of a failed
  flow, therefore use a higher partid than any of the previous attempts.
- plugin_err instead of LOG_BROKEN if sendpay fails and we cannot get a
  an error code.
- fix wrong comments.
- remove the background timer.
- This is a bugfix. Previous to this the MCF network was built using the
knowledge of the min and max liquidity but it didn't take into account
pending HTLCs.
- Also remove the min_prob_success option but hardcode a 90% value.

Removing some options that are not relevant to the user, they're kept
for developer mode only:
- base_fee_penalty
- min_prob_success
- prob_cost_factor
- remove heap.h, not used

Signed-off-by: Lagrang3 <eduardo.quintana@pm.me>
This commit is contained in:
Lagrang3
2023-07-31 11:21:25 +09:30
committed by Rusty Russell
parent d46990d301
commit 79486c1e3b
9 changed files with 174 additions and 350 deletions

View File

@@ -60,11 +60,6 @@ def test_errors(node_factory, bitcoind):
with pytest.raises(RpcError, match=failmsg):
l1.rpc.call('renepay', {'invstring': inv})
node_factory.join_nodes([l4, l6],
wait_for_announce=True, fundamount=1000000)
node_factory.join_nodes([l5, l6],
wait_for_announce=True, fundamount=1000000)
l4.rpc.connect(l6.info['id'], 'localhost', l6.port)
l5.rpc.connect(l6.info['id'], 'localhost', l6.port)
@@ -225,15 +220,8 @@ def test_limits(node_factory):
assert err.value.error['code'] == PAY_ROUTE_NOT_FOUND
inv2 = l6.rpc.invoice("800000sat", "inv2", 'description')
failmsg = r'Probability is too small'
with pytest.raises(RpcError, match=failmsg) as err:
l1.rpc.call(
'renepay', {'invstring': inv2['bolt11'], 'min_prob_success': '0.5'})
assert err.value.error['code'] == PAY_ROUTE_NOT_FOUND
# if we try again we can finish this payment
l1.rpc.call(
'renepay', {'invstring': inv2['bolt11'], 'min_prob_success': 0})
'renepay', {'invstring': inv2['bolt11']})
invoice = only_one(l6.rpc.listinvoices('inv2')['invoices'])
assert isinstance(invoice['amount_received_msat'], Millisatoshi)
assert invoice['amount_received_msat'] >= Millisatoshi('800000sat')