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

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
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
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 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?

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
@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