Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trampoline Payload Construction Method #3386

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

arik-so
Copy link
Contributor

@arik-so arik-so commented Oct 28, 2024

Introduce a method for constructing Trampoline payloads.

This will allow the non-Trampoline method to be modified to generate a Trampoline onion and finish its own regular payload construction.

/// amended to match the features present in the invoice this node generated.
pub node_features: NodeFeatures,
/// The channel_announcement features of the channel that should be used from the previous hop
/// to reach this node.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm really confused, there's no explicit way that I see in OutboundOnionPayload::BlindedForward to specify the channel used. The previous trampoline hop can pick any channel they want, AFAIU...

@@ -454,6 +454,9 @@ impl_writeable_tlv_based!(BlindedTail, {
pub struct Path {
/// The list of unblinded hops in this [`Path`]. Must be at least length one.
pub hops: Vec<RouteHop>,
/// The list of unblinded Trampoline hops. If present, must be at least one.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Vacuous statement is vacuous.

@@ -454,6 +454,9 @@ impl_writeable_tlv_based!(BlindedTail, {
pub struct Path {
/// The list of unblinded hops in this [`Path`]. Must be at least length one.
pub hops: Vec<RouteHop>,
/// The list of unblinded Trampoline hops. If present, must be at least one.
/// The public key of the first Trampoline hop must match the public key of the last regular hop.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see why this needs to be true. Can we just have each trampoline hop be next hops starting after the last unblinded node.

@@ -454,6 +454,9 @@ impl_writeable_tlv_based!(BlindedTail, {
pub struct Path {
/// The list of unblinded hops in this [`Path`]. Must be at least length one.
pub hops: Vec<RouteHop>,
/// The list of unblinded Trampoline hops. If present, must be at least one.
/// The public key of the first Trampoline hop must match the public key of the last regular hop.
pub trampoline_hops: Vec<TrampolineHop>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems weird to add this to the public API in a PR that doesn't use it. Can you go ahead and wire up build_trampoline_onion_payloads to build the valid onion in the same PR?

@arik-so arik-so force-pushed the arik/trampoline/payload-construction branch from 68d2c20 to 7cad33e Compare November 14, 2024 15:38
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