-
Notifications
You must be signed in to change notification settings - Fork 390
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
Static invoice server prefactor #3667
base: main
Are you sure you want to change the base?
Static invoice server prefactor #3667
Conversation
👋 Thanks for assigning @jkczyz as a reviewer! |
165c88d
to
9079c41
Compare
feb9a8f
to
0b7f7d8
Compare
Really clean refactor! There's a typo in the third commit message of "and and," but otherwise looks really good. |
🔔 1st Reminder Hey @arik-so! This PR has been waiting for your review. |
@jkczyz would you mind taking a look a the last commit since you requested the refactor? Thank you! |
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.
Very straightforward. Approving explicitly for the bot.
0b7f7d8
to
bd3ce45
Compare
Looks like there are some silent rebase conflicts causing CI to fail, will rebase now |
We need to add a Vec to the config as part of async receive support, see upcoming commits. The vec will contain blinded paths to reach an always-online node that will serve static invoices on our behalf. None of those things implement Copy so remove support for the trait.
95f934d
to
4a7d7e3
Compare
Pushed a super trivial fix for rustfmt |
Previously when reading a BOLT 12 message from bytes, if it resulted in a DecodeError then that error would be overridden by DecodeError::InvalidValue specifically. Better to return to underlying specific error.
For context, many of our higher level ser macros such as impl_writeable_msg support the syntax: impl_writeable_msg!(StructName, { .. }, { (42, tlv_field, (option, encoding: (Vec<u8>, WithoutLength>), }) i.e. specifying an encoding wrapper around an optional field being serialized. Here we add add similar support for an encoding wrapper around required_vecs that are being serialized, eg (42, tlv_field, (required_vec: (encoding: (..)))). One difficulty here is that some ser macros such as impl_writeable_msg and tlv_stream will call the underlying macro _encode_tlv_stream with each struct field passed in as a reference, whereas others such as impl_writeable_tlv_based will call _encode_tlv_stream with each struct field passed in as a value. This difference led to compilation issues because the WithoutLength ser wrapper expects to wrap a reference to a Vec, not a value. As a result, here we also modify the macros that were previously passing in struct values as values to pass in references instead.
The new utility will be used in upcoming commits as part of supporting static invoice server.
Previously the compiler would not enforce that a peeled onion message had a corresponding context that matched, e.g. an offers message needs an offers blinded path context. Refactor PeeledOnion to have multiple Receive message types such that this is now enforced.
Prior to this commit we would allow DNSSEDQuery onion messages that were sent over blinded paths that were created for other purposes. This could be used to correlate identities and unblind a path, so disallow this. For consistency we also add a log on receipt of a DNSSECProof message with a missing context.
4a7d7e3
to
92f0718
Compare
Prepares for #3618, some commits reference commits in that upcoming PR.