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

Offers: send payment #90

Merged
merged 7 commits into from
Mar 8, 2024
Merged

Offers: send payment #90

merged 7 commits into from
Mar 8, 2024

Conversation

orbitalturtle
Copy link
Collaborator

@orbitalturtle orbitalturtle commented Jan 23, 2024

Finishes the BOLT 12 offer flow by sending the payment. Depends on #89

@orbitalturtle orbitalturtle requested a review from carlaKC January 23, 2024 20:54
lnd.connect_to_peer(pubkey, addr).await;
lnd.connect_to_peer(pubkey_2, addr_2).await;
let lnd_info = lnd.get_info().await;
let lnd_pubkey = PublicKey::from_str(&lnd_info.identity_pubkey).unwrap();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So... before LDK 20 this integration test worked ok without channels set up. But now, it doesn't. IIUC LDK 20 requires a node to be in the network graph so it can find a way to forward a message, meaning channels need to be set up rather than just connections to peers. Planning to look into this further and ask the LDK team about it.

Copy link
Collaborator Author

@orbitalturtle orbitalturtle Feb 2, 2024

Choose a reason for hiding this comment

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

Fixed this with a small PR to rust-lightning to export a lower level version of "send_onion_message" in ldk-sample so we can set the path directly (like we did before) and get around the channels-required issue. lightningdevkit/rust-lightning#2868

@orbitalturtle orbitalturtle force-pushed the invoice-verification branch 2 times, most recently from 6522401 to 2bcd34b Compare January 25, 2024 23:16
@orbitalturtle orbitalturtle force-pushed the offers-send-payment-new branch from d67956e to 2b72d7c Compare January 25, 2024 23:27
Cargo.toml Show resolved Hide resolved
Copy link
Collaborator

@carlaKC carlaKC left a comment

Choose a reason for hiding this comment

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

I think we need to take a look at the semantics of LND's sendtoroute API, pretty sure we'll be reporting a dispatched payment for an offer as successfully paid as is.

Cargo.toml Outdated Show resolved Hide resolved
src/onion_messenger.rs Show resolved Hide resolved
src/lndk_offers.rs Outdated Show resolved Hide resolved
src/lndk_offers.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@orbitalturtle orbitalturtle force-pushed the offers-send-payment-new branch from 2b72d7c to 8d7d885 Compare January 31, 2024 01:20
@orbitalturtle orbitalturtle force-pushed the invoice-verification branch 3 times, most recently from 48bb807 to c9c7d63 Compare February 1, 2024 03:27
@orbitalturtle orbitalturtle force-pushed the offers-send-payment-new branch 3 times, most recently from b41c013 to b1d8e94 Compare February 2, 2024 06:15
@orbitalturtle orbitalturtle force-pushed the offers-send-payment-new branch from b1d8e94 to 8a8b2a4 Compare February 2, 2024 08:04
tests/common/mod.rs Outdated Show resolved Hide resolved
src/lndk_offers.rs Outdated Show resolved Hide resolved
src/lndk_offers.rs Outdated Show resolved Hide resolved
@orbitalturtle orbitalturtle force-pushed the invoice-verification branch 2 times, most recently from c5a0640 to 5230aac Compare February 6, 2024 06:18
@orbitalturtle orbitalturtle force-pushed the offers-send-payment-new branch from 8a8b2a4 to a479edc Compare February 6, 2024 06:59
@orbitalturtle orbitalturtle force-pushed the offers-send-payment-new branch from a479edc to b574ebf Compare February 6, 2024 07:35
@orbitalturtle orbitalturtle force-pushed the offers-send-payment-new branch from b574ebf to fc061b7 Compare February 7, 2024 05:40
@orbitalturtle orbitalturtle force-pushed the offers-send-payment-new branch from fc061b7 to 9821994 Compare February 8, 2024 01:36
@orbitalturtle orbitalturtle force-pushed the invoice-verification branch 2 times, most recently from 89423f4 to c3a4f7d Compare February 8, 2024 01:51
@orbitalturtle orbitalturtle force-pushed the offers-send-payment-new branch from 9821994 to 2184d97 Compare February 8, 2024 01:58
@orbitalturtle orbitalturtle force-pushed the offers-send-payment-new branch 3 times, most recently from cbcb32a to 661e889 Compare February 8, 2024 03:44
src/lndk_offers.rs Show resolved Hide resolved
ldk1.stop().await;
ldk2.stop().await;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we also look up the payment in LND and assert that it was successfully paid?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

At the end of pay_offer we wait for trackpayment to return success so not sure we need to? But you know the lnd api better than me, would it be worth to use listpayments and double confirm that the payment succeeded?

@orbitalturtle orbitalturtle force-pushed the offers-send-payment-new branch 2 times, most recently from 3c0d2ee to fe63c9e Compare February 24, 2024 06:14
@orbitalturtle orbitalturtle force-pushed the invoice-verification branch from be2714c to df53046 Compare March 6, 2024 21:26
We use a custom version of tonic_lnd that has the blinded route support in the
QueryRoute and SendToRoute commands, which won't officially be released in lnd
until v18.
We update to ldk v20 for the latest blinded route updates, namely being
able to create a blinded route that's more than one hop. On top of that we use
a custom versoin with a small change, which we need in order to send an onion
message along a specified path for LNDK's integration tests:
lightningdevkit/rust-lightning#2868
@orbitalturtle orbitalturtle force-pushed the offers-send-payment-new branch from fe63c9e to 4b491cc Compare March 6, 2024 21:28
@carlaKC carlaKC changed the base branch from invoice-verification to master March 8, 2024 22:38
@carlaKC carlaKC merged commit 245b0d5 into master Mar 8, 2024
4 checks passed
@orbitalturtle orbitalturtle deleted the offers-send-payment-new branch May 30, 2024 18:02
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