Skip to content

HRN: Emit new event type when Offer has been received and validated #3779

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

Open
tnull opened this issue May 15, 2025 · 6 comments
Open

HRN: Emit new event type when Offer has been received and validated #3779

tnull opened this issue May 15, 2025 · 6 comments
Labels
good first issue Good for newcomers

Comments

@tnull
Copy link
Contributor

tnull commented May 15, 2025

Currently, when using the ChannelManager::pay_for_offer_from_human_readable_name API, the user gets no access to the offer data retrieved. It would be great to add a new event type that is emitted when the offer has been retrieved and validated, e.g. here:

if let Some((completed_requests, mut offer)) = offer_opt {

@TheBlueMatt
Copy link
Collaborator

Hmm, is there a reason you need the Offer directly or can you just access the offer fields via the Bolt12Invoice when the payment ultimately completes (which I believe was added upstream but is not in 0.1)?

@tnull
Copy link
Contributor Author

tnull commented May 15, 2025

Hmm, is there a reason you need the Offer directly or can you just access the offer fields via the Bolt12Invoice when the payment ultimately completes (which I believe was added upstream but is not in 0.1)?

Hmm, IIUC, PaymentSent would only give us the Bolt12Invoice, which doesn't even expose OfferId, for instance. But more generally: the payment might very well fail and we'd still like to be able to fill in some of the metadata fields and maybe even retry using the Offer, which would save us multiple RTTs for resolving/retrieving the offer once more.

@chuksys
Copy link

chuksys commented May 16, 2025

I'd like to pick this up.

@tnull
Copy link
Contributor Author

tnull commented May 19, 2025

I'd like to pick this up.

Sure, go for it!

@TheBlueMatt
Copy link
Collaborator

Hmm, IIUC, PaymentSent would only give us the Bolt12Invoice, which doesn't even expose OfferId, for instance.

that's easy to fix, though, and likely it should :).

But more generally: the payment might very well fail and we'd still like to be able to fill in some of the metadata fields

Hmm? Like what? I'm not really sure there's much to fill in from an Offer derived from an HRN - its really just a blinded path to request an Invoice?

maybe even retry using the Offer, which would save us multiple RTTs for resolving/retrieving the offer once more.

That's one RTT, but I guess I'm not clear on the point of that? Like, DNS should move pretty quick, hopefully, and if an Offer request times out its probably already retried a few times and we've waited a while. Adding one RTT on top of the retry seems perfectly fine?

@tnull
Copy link
Contributor Author

tnull commented May 20, 2025

That's one RTT, but I guess I'm not clear on the point of that? Like, DNS should move pretty quick, hopefully, and if an Offer request times out its probably already retried a few times and we've waited a while. Adding one RTT on top of the retry seems perfectly fine?

The point is that we already retrieved the offer and still would have an entirely blank entry in the payment store even though we could provide the user additional metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants