rust-lightning icon indicating copy to clipboard operation
rust-lightning copied to clipboard

Compact blinded path creation

Open jkczyz opened this issue 1 year ago • 4 comments

Add support for creating a compact BlindedPath, which consists of:

  • using an SCID instead of a node id in BlindedHop::encrypted_payload
  • using IntroductionNode::DirectedShortChannelId

The first is accomplished by specifying SCIDs when calling BlindedPath::new_for_message using a new message::ForwardNode struct. The second is through calling BlindedPath::use_compact_introduction_node. Both are called by DefaultMessageRouter.

jkczyz avatar Apr 22 '24 19:04 jkczyz

Codecov Report

Attention: Patch coverage is 92.19858% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 90.29%. Comparing base (a95338a) to head (e4661fe). Report is 7 commits behind head on main.

Files Patch % Lines
lightning/src/ln/offers_tests.rs 81.25% 0 Missing and 6 partials :warning:
lightning/src/blinded_path/mod.rs 86.20% 3 Missing and 1 partial :warning:
lightning/src/util/test_utils.rs 50.00% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3011      +/-   ##
==========================================
+ Coverage   89.87%   90.29%   +0.42%     
==========================================
  Files         117      117              
  Lines       96952   100069    +3117     
  Branches    96952   100069    +3117     
==========================================
+ Hits        87134    90357    +3223     
+ Misses       7273     7130     -143     
- Partials     2545     2582      +37     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 22 '24 20:04 codecov-commenter

Rebased

jkczyz avatar May 13 '24 21:05 jkczyz

LGTM pending maybe making the compact encoding optional. Looks like it needs another rebase as well.

Rebased now. Yeah, maybe best to do that in a follow-up as it may be a little more involved. Let me know if you have any thoughts on https://github.com/lightningdevkit/rust-lightning/pull/3011#discussion_r1600386890.

jkczyz avatar May 14 '24 22:05 jkczyz

Feel free to squash and we can land this IMO. We should open an issue and block the next release on the followup.

TheBlueMatt avatar May 17 '24 16:05 TheBlueMatt

Feel free to squash and we can land this IMO. We should open an issue and block the next release on the followup.

Rebased and opened #3080. Looking for feedback on the ChannelManager API (see https://github.com/lightningdevkit/rust-lightning/pull/3011#discussion_r1610736336).

jkczyz avatar May 22 '24 22:05 jkczyz

Added derives to ForwardNode.

jkczyz avatar May 28 '24 21:05 jkczyz