Skip to content

Configuration option to specify "fronting nodes" for routehints/blinded paths.#8490

Open
rustyrussell wants to merge 12 commits intoElementsProject:masterfrom
rustyrussell:guilt/fronting
Open

Configuration option to specify "fronting nodes" for routehints/blinded paths.#8490
rustyrussell wants to merge 12 commits intoElementsProject:masterfrom
rustyrussell:guilt/fronting

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
@rustyrussell rustyrussell requested a review from cdecker as a code owner October 2, 2025 02:29
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']]

I ran `uv run make update-mocks` and many mocks vanished.  But that
broke MacOS (and maybe other archs) which doesn't support function
sections and no longer linked.

If this proves problematic, we might end up generating mocks properly:
1. Use #include "mocks-sphinx-xor_cipher_stream_gen.c"
2. Generate those separate files as necessary.
3. Don't commit them, build them locally.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
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 <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: libplugin: support for options which accumulate if specified more than once ("multi": true).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
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 <rusty@rustcorp.com.au>
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 <rusty@rustcorp.com.au>
We use all the fronting nodes when creating offers.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
… set.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
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 <rusty@rustcorp.com.au>
… for invoice_request.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
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