Skip to content

Conversation

@rustyrussell
Copy link
Contributor

Useful to force all traffic via another node.

@rustyrussell rustyrussell added this to the v25.12 milestone Aug 23, 2025
If a plugin exits early, we will not exit with ret == plugins: return
from this function and we will exit because ld->exit_code is set.

Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
Changelog-Added: libplugin: support for options which accumulate if specified more than once ("multi": true).
Signed-off-by: Rusty Russell <[email protected]>
Changelog-Added: Config: `payment-fronting-node` option to specify neighbor node(s) to use for all bolt11 invoices, bolt12 offers, invoices and invoice_requests.
We use all the fronting nodes when creating invoices.

Signed-off-by: Rusty Russell <[email protected]>
This is how modern plugins do it, and it has the benefit of not
requiring extra code for memleak tracking.

Signed-off-by: Rusty Russell <[email protected]>
We use all the fronting nodes when creating offers.

Signed-off-by: Rusty Russell <[email protected]>
The next commit makes us honor these when issuing a payment.

Changelog-Added: JSON-RPC: `offer` now has a `fronting-nodes` option to specify neighbors for payer to use to fetch invoices and make payments.
Signed-off-by: Rusty Russell <[email protected]>
Copy link
Collaborator

@endothermicdev endothermicdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me pending the gossmap initialization and blackbox test typos. I'm not sure how to best prevent footguns with this feature, but I'm sure we'll find some as we go.

# l1 -> l2 -> l3
# \ /
# l4
# Nodes will front for offers if they don't have an advertized address.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Nodes will front for offers if they don't have an advertized address.
# Nodes will not front for offers if they don't have an advertized address.

offer_front_l2 = l4.rpc.offer("any", "frontl2", fronting_nodes=[l2.info['id']])['bolt12']
assert only_one(l1.rpc.decode(offer_front_l2)['offer_paths'])['first_node_id'] == l2.info['id']
offer_front_l2l3 = l4.rpc.offer("any", "frontl2l3", fronting_nodes=[l2.info['id'], l3.info['id']])['bolt12']
assert [p['first_node_id'] for p in l1.rpc.decode(offer_front_l2)['offer_paths']] == [l2.info['id'], l3.info['id']]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert [p['first_node_id'] for p in l1.rpc.decode(offer_front_l2)['offer_paths']] == [l2.info['id'], l3.info['id']]
assert [p['first_node_id'] for p in l1.rpc.decode(offer_front_l2l3)['offer_paths']] == [l2.info['id'], l3.info['id']]

return plugin_get_data(plugin, struct offers_data);
}

static void init_gossmap(struct plugin *plugin,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this still needs to be initialized on startup.
==936832== Conditional jump or move depends on uninitialised value(s)
==936832== at 0x11424D: get_gossmap (offers.c:53)
==936832== by 0x11B316: try_establish (fetchinvoice.c:605)
==936832== by 0x11B414: send_message (fetchinvoice.c:644)
==936832== by 0x11B644: invreq_done (fetchinvoice.c:784)
==936832== by 0x121C94: handle_rpc_reply (libplugin.c:1136)
==936832== by 0x121E97: rpc_read_response_one (libplugin.c:1441)
==936832== by 0x121F48: rpc_conn_read_response (libplugin.c:1465)
==936832== by 0x1CEDCF: next_plan (io.c:60)
==936832== by 0x1CF2A0: do_plan (io.c:422)
==936832== by 0x1CF35D: io_ready (io.c:439)
==936832== by 0x1D0CEC: io_loop (poll.c:455)
==936832== by 0x1235A5: plugin_main (libplugin.c:2578)

return command_param_failed();


/* If they don't specify explicitly, use config (if any) */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it also make sense at this point to check that fronting_nodes in the rpc request are public?

@rustyrussell rustyrussell modified the milestones: v25.12, v26.03 Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants