Skip to content

Rename from_raw to from_blinded_path_and_payinfo in BlindedPaymentPath #3807

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

Conversation

a-mpch
Copy link
Contributor

@a-mpch a-mpch commented May 28, 2025

Similar to #3677, makes a way of building BlindedPaymentPath public.

On previous experiments on doing this issue on lndk-org/lndk repo, I could build BlindedPath from LND Api response. After upgrading to 0.1.3, methods were made private.

This PR aims to make a way of building BlindedPaymentPath to be used in InvoiceRequest responses from already serialized blinded paths.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented May 28, 2025

I've assigned @joostjager as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

/// * `blinding_point`: The public key used for blinding the path.
/// * `blinded_hops`: The encrypted routing information for each hop in the path.
/// * `payinfo`: The [`BlindedPayInfo`] for the blinded path.
pub fn from_blinded_path(
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO -- can we keep the previous name or call this from_parts?

Copy link
Contributor Author

@a-mpch a-mpch May 28, 2025

Choose a reason for hiding this comment

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

hmm I think from_parts is too broad. Maybe from_blinded_path_and_payinfo but could be too lengthly. I don't mind going back to from_raw but I wanted to keep it similar to BlindedMessagePath::from_blinded_path

edit: so, I changed to from_blinded_path_and_payinfo. Wasn't that bad

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah okay, I didn't notice BlindedMessagePath already exposes a similar method, thanks! I'm good with the original name or this new one then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great! I think I like the new one better.

@a-mpch a-mpch force-pushed the 2025-05-rename-from-raw-to-from-blinded-path-payment branch from 986ac20 to 4845404 Compare May 28, 2025 21:45
@a-mpch a-mpch changed the title Rename from_raw to from_blinded_path in BlindedPaymentPath Rename from_raw to from_blinded_path_and_payinfo in BlindedPaymentPath May 28, 2025
@a-mpch a-mpch force-pushed the 2025-05-rename-from-raw-to-from-blinded-path-payment branch from 4845404 to 51444c9 Compare May 28, 2025 21:50
joostjager
joostjager previously approved these changes May 30, 2025
Copy link
Contributor

@joostjager joostjager left a comment

Choose a reason for hiding this comment

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

Just sharing two thoughts. Not sure if relevant at all. This PR is just making a fn public.

/// * `blinding_point`: The public key used for blinding the path.
/// * `blinded_hops`: The encrypted routing information for each hop in the path.
/// * `payinfo`: The [`BlindedPayInfo`] for the blinded path.
pub fn from_blinded_path_and_payinfo(
Copy link
Contributor

Choose a reason for hiding this comment

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

This one could call into from_parts.

Or BlindedPath and from_parts could be made public instead and this method can be dropped?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, the first one makes totally sense.

Similar to 8ce438c, we rename
`from_raw` function used in test/fuzzy scenarios to build
`BlindedPaymentPath` to a public function
`from_blinded_path_and_payinfo`.

This function is useful when reconstructing a blinded path based
on already serialized components.
@a-mpch a-mpch dismissed stale reviews from joostjager and valentinewallace via 9284298 May 30, 2025 11:08
@a-mpch a-mpch force-pushed the 2025-05-rename-from-raw-to-from-blinded-path-payment branch from 51444c9 to 9284298 Compare May 30, 2025 11:08
@a-mpch
Copy link
Contributor Author

a-mpch commented May 30, 2025

@valentinewallace @joostjager thanks for the review! I staled your approvals with latest force push on updating on Joost comment.

@valentinewallace valentinewallace merged commit 8aae34e into lightningdevkit:main May 30, 2025
28 checks passed
@a-mpch a-mpch deleted the 2025-05-rename-from-raw-to-from-blinded-path-payment branch May 30, 2025 17:23
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.

4 participants