Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Authenticate use of offer blinded paths #3139
Authenticate use of offer blinded paths #3139
Changes from all commits
5278d31
0a5918e
d7aeaa0
219691f
e156415
c0cae08
c58a1bb
7904e3c
f546aad
1ff8c8d
a5145e4
6a54618
35b75fd
bf42847
9d46340
f537abd
c2a120e
559daeb
bdf3330
fd596c3
114954c
868fee7
14634c6
2c2f3fe
e6ee194
4ed37d8
df5d7ea
718bc47
825bda0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
2
. Will push a fixup after the next round of reviews.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OffersContext
hasn't shipped in a release yet, right? It shouldn't matter?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you mean don't worry about using odd numbers until we release? Wasn't sure if we had a convention around that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't, it doesn't matter much so we often just do odds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we planning to also stop using
OffersContext::Unknown {}
when creating a reply path for an invoice we're sending to aRefund
? I thought that change would be in #3192 but don't see it atm. Trying to figure out if this code is going to go away given it only applies to refunds and we seem ok with breaking refunds in this release.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, looks like I need to update that to use
OffersContext::InboundPayment
. Thanks for catching that!This code here will stay the same since the context is from the refund's blinded path -- or
OffersContext::Unknown
if the refund doesn't have any blinded paths. The case that you are thinking of -- the reply path used when creating an invoice for a refund -- would be seen when handling anInvoiceError
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay. To me it reads like using an
Option
would capture the state better than having theUnknown
variant. To meOffersContext
is context we provide back to ourselves in our blinded paths, andUnknown
sounds like we got an unknown context in our blinded path, vs no context at all because there was no blinded path.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think we wanted to avoid having an
Option
throughout the creation code. But we could removeOffersContext::Unknown
once we no longer create any paths with it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if we're avoiding an
Option
, won't::Unknown
continue to be used when receiving a message to an offer/refund without paths? i.e. here https://github.com/lightningdevkit/rust-lightning/blob/main/lightning/src/onion_message/messenger.rs#L1516There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I'm in agreement that once we remove the last use of
OffersContext::Unknown
on the creation side, we can update the handler to use anOption
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay, thanks for that clarification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I don't think there's anything wrong with ignoring the BOLTs here - as long as we handle "unsolicited invoice_request that is for an offer we didnt built" and "invoice_request that we received over the wrong path" the same we're fine. Not sure it matters much if we think this case isn't going to be a common one that we need to worry about making sure we get good errors back, but if we think it'd be helpful we should just do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, this will only be triggered for older offers. When we add support for producing offers without blinded paths (i.e. with a public node id), it will also be hit. So at that point someone could de-anonymize the older offer by sending an invoice request for it to the node id given in the newer offer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm? Not sure I understand the scenario you're describing - are you saying if we issue two offers, one with a blinded path and one that publishes our node, someone can use the one with the blinded path and the one that publishes our node somehow to get different behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, no, I was saying they could determine that they came from the same issuer. Though, that is actually a different problem than what you are asking about and one we probably can't solve.
Sorry, think I was confused about your comment. Were you saying we should continue to send an
InvoiceError
withBolt12SemanticError::InvalidMetadata
for both verification paths?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so? Like, if we think it doesn't matter if we pass back an error then no need, but if we think we may hit those cases and we should pass back an error then we should ignore the BOLTs here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, probably not useful to send an
InvoiceError
. The only time those should ever fail is if we are given an invoice request for an invalid offer or an invalid path id used. Older offers should still work.