-
Notifications
You must be signed in to change notification settings - Fork 370
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
Route blinding: support forwarding as the intro node #2540
Route blinding: support forwarding as the intro node #2540
Conversation
838c32c
to
8ab2c7e
Compare
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #2540 +/- ##
==========================================
+ Coverage 88.57% 88.63% +0.05%
==========================================
Files 115 115
Lines 89479 90023 +544
Branches 89479 90023 +544
==========================================
+ Hits 79258 79788 +530
+ Misses 7858 7840 -18
- Partials 2363 2395 +32 ☔ View full report in Codecov by Sentry. |
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.
Quick glance, nothing wild
8ab2c7e
to
9683545
Compare
Also, what should/are we doing about blinded tails on probe calls? Presumably we should just drop the blinded tail or tweak the parameter to not included blinded tails? |
9683545
to
e3b969f
Compare
e3b969f
to
1e232ff
Compare
1e232ff
to
4b73a27
Compare
29b1d33
to
9c171a7
Compare
Expanded test coverage a bit and broke out a few more commits. Think this is ready for review. |
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.
Still working through some of the commits
e04a728
to
4c42d24
Compare
Noted the follow-ups here: #2540 (review) in #1970. Also, squashed. |
A blinding point is provided in update_add_htlc messages if we are relaying or receiving a payment within a blinded path, to decrypt the onion routing packet and the recipient-provided encrypted payload within. Will be used in upcoming commits.
Will be used in the next commit to parse onion errors from blinded paths in tests only.
So we can make sure they're encoded properly.
A blinding point is provided in update_add_htlc messages if we are relaying or receiving a payment within a blinded path, to decrypt the onion routing packet and the recipient-provided encrypted payload within. Will be used in upcoming commits.
We need to store the inbound blinding point in PendingHTLCRouting in order to calculate the outbound blinding point. The new BlindedForward struct will be augmented when we add support for forwarding as a non-intro node.
Useful so we know to fail blinded intro node HTLCs back with an invalid_onion_blinding error per BOLT 4. Another variant will be added to the new Blinded enum when we support receiving/forwarding as a non-intro node.
Useful so we know to fail back blinded HTLCs where we are the intro node with the invalid_onion_blinding error per BOLT 4. We don't set this field for blinded received HTLCs because we don't support receiving to multi-hop blinded paths yet, and there's no point in setting it for HTLCs received to 1-hop blinded paths because per the spec they should fail back using an unblinded error code.
Used in the next commit to set the update_add blinding point on HTLC forward.
Used by the next hop to decode their blinded onion payload.
Previously, we only parsed blinded receive payloads.
Needs rebase. |
Error handling will be completed in upcoming commits.
Intro node failure only.
Forwarding intro nodes should always fail with 0x8000|0x4000|24.
As the intro node.
4c42d24
to
6af786a
Compare
@@ -119,6 +119,8 @@ pub enum PendingHTLCRouting { | |||
/// The SCID from the onion that we should forward to. This could be a real SCID or a fake one | |||
/// generated using `get_fake_scid` from the scid_utils::fake_scid module. | |||
short_channel_id: u64, // This should be NonZero<u64> eventually when we bump MSRV | |||
/// Set if this HTLC is being forwarded within a blinded path. | |||
blinded: Option<BlindedForward>, |
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, this is public now, we should include a bit more details about why this is here and what its used for. Happy to just do that in #2762.
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.
Good point, doing it in #2762 sgtm. FWIW, there are more detailed docs on the BlindedForward
struct itself.
Adds support for being the intro node to a blinded path. As such, we won't advertise route blinding support in our feature bits yet.
The next PR (#2688) adds support for receiving to a multi-hop blinded path, to be followed by complete blinded forwarding support. #2688 also adds testing for the success case of forwarding-as-intro.
Helps address #1970.
Based on #2514, #2413