Produce a arc with very large fee cost that triggers an assertion in askrene's single path solver.
(node_factory)
| 2231 | |
| 2232 | |
| 2233 | def test_excessive_fee_cost(node_factory): |
| 2234 | """Produce a arc with very large fee cost that triggers an assertion in |
| 2235 | askrene's single path solver.""" |
| 2236 | l1 = node_factory.get_node() |
| 2237 | node1 = "020000000000000000000000000000000000000000000000000000000000000001" |
| 2238 | one_btc = 100000000000 |
| 2239 | l1.rpc.askrene_create_layer("mylayer") |
| 2240 | l1.rpc.askrene_create_channel( |
| 2241 | layer="mylayer", |
| 2242 | source=l1.info["id"], |
| 2243 | destination=node1, |
| 2244 | short_channel_id="0x0x0", |
| 2245 | capacity_msat=one_btc, |
| 2246 | ) |
| 2247 | l1.rpc.askrene_update_channel( |
| 2248 | layer="mylayer", |
| 2249 | short_channel_id_dir="0x0x0/1", |
| 2250 | enabled=True, |
| 2251 | htlc_minimum_msat=0, |
| 2252 | htlc_maximum_msat=one_btc, |
| 2253 | fee_base_msat=0, |
| 2254 | fee_proportional_millionths=100000, # 10% |
| 2255 | cltv_expiry_delta=18, |
| 2256 | ) |
| 2257 | with pytest.raises(RpcError, match=r"Could not find route without excessive cost"): |
| 2258 | l1.rpc.getroutes( |
| 2259 | source=l1.info["id"], |
| 2260 | destination=node1, |
| 2261 | amount_msat=one_btc // 2, |
| 2262 | layers=["mylayer"], |
| 2263 | maxfee_msat=1000, |
| 2264 | final_cltv=5, |
| 2265 | maxparts=1, |
| 2266 | ) |
| 2267 | |
| 2268 | |
| 2269 | def check_getroute_routes( |