Skip to content
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

Lint 7298 #30

Closed
wants to merge 31 commits into from
Closed

Lint 7298 #30

wants to merge 31 commits into from

Commits on Nov 6, 2023

  1. Configuration menu
    Copy the full SHA
    4234a67 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2023

  1. lnwire: create common encoder/decoder for raw feature vectors

    We'll need to pack feature vectors for route blinding, so we pull
    the encoding/decoding out into separate functions (currently
    contained in ChannelType). Though it's more lines of code, we keep
    most of the ChannelType assertions so that we strictly enforce
    use of the alias.
    carlaKC committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    c9b99b4 View commit details
    Browse the repository at this point in the history
  2. lnwire: add TLV encoding/decoding for blinded route data blobs

    This commit adds encoding and decoding for blinded route data blobs.
    TLV fields such as path_id (which are only used for the final hop)
    are omitted to minimize the change size.
    carlaKC committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    1208d47 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2023

  1. multi: add validation of blinded route encrypted data

    Co-authored-by: Calvin Zachman <calvin.zachman@protonmail.com>
    carlaKC and calvinrzachman committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    655f541 View commit details
    Browse the repository at this point in the history
  2. lnwire: add blinding point to update_add_htlc TLVs

    Add blinding points to update_add_htlc. This TLV will be set for
    nodes that are relaying payments in blinded routes that are _not_
    the introduction node.
    carlaKC committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    471f6b9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ca7d483 View commit details
    Browse the repository at this point in the history
  4. multi: add blinding point to payment descriptor and persist

    This commit adds an optional blinding point to payment descriptors and
    persists them in our HTLC's extra data. A get/set pattern is used to
    populate the ExtraData on our disk representation of the HTLC so that
    callers do not need to worry about the underlying storage detail.
    carlaKC committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    cf1cafb View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8ad478c View commit details
    Browse the repository at this point in the history
  6. htlcswitch: add incoming amount and to decode hop iterator request

    When we have payments inside of a blinded route, we need to know
    the incoming amount to be able to back-calculate the amount that
    we need to forward using the forwarding parameters provided in the
    blinded route encrypted data. This commit adds the payment amount
    to our DecodeHopIteratorRequest so that it can be threaded down to
    payment forwarding information creation in later commits.
    carlaKC committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    3efb0f2 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    df54ade View commit details
    Browse the repository at this point in the history
  8. htlcswitch/test: add encrypted data to blinded intermediate hop

    Blinding points will always be accompanied by encrypted data, so
    update the test to more accurately represent reality.
    carlaKC committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    4b34449 View commit details
    Browse the repository at this point in the history
  9. htlcswitch/test: add sphinx action to decoding test

    Update test to include the sphinx action to more closely represent
    reality. This will be required when we add more validation to the
    presence of a nextChanID field. A MoreHops action is chose because
    we're testing the case with a payload that contains forwarding info.
    carlaKC committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    f6bd217 View commit details
    Browse the repository at this point in the history
  10. routing/test: set outgoing timelock on non-legacy test cases

    Provide valid hop payloads for tests cases that use TLV onion format.
    carlaKC committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    2cd3e6e View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    db41739 View commit details
    Browse the repository at this point in the history
  12. htlcswitch/hop: explicitly signal final hop from sphinx packet

    Previously, we were using nextChanID to determine whether a hop
    payload is for the final recipient. This is no longer suitable in a
    route-blinding world where intermediate hops are allowed to have zero
    nextChanID TLVs (as this information is provided to forwarding nodes
    in their encrypted data). This commit updates payload reading to use
    the signal provided by sphinx that we are on the last packet, rather
    than implying it from the contents of a hop.
    carlaKC committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    f9a9daa View commit details
    Browse the repository at this point in the history
  13. multi: explicitly signal final hop in pack hop payload

    Previously, we'd use the value of nextChanID to infer whether a payload
    was for the final hop in a route. This commit updates our packing logic
    to explicitly signal to account for blinded routes, which allow zero
    value nextChanID in intermediate hops. This is a preparatory commit
    that allows us to more thoroughly validate payloads.
    carlaKC committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    3a41177 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    8db2488 View commit details
    Browse the repository at this point in the history
  15. hltcswitch/hop: add next hop to intermediate hop with custom records

    Fix our existing test to have a valid intermediate hop that will pass
    stricter validation. Previously, we did not specify a next channel for
    an intermediate hop (which violates bolt4).
    carlaKC committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    c41d5c7 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    ef1d514 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    3f1af43 View commit details
    Browse the repository at this point in the history
  18. docs: release notes

    carlaKC committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    e470192 View commit details
    Browse the repository at this point in the history
  19. hop: add function for calculating forwarding amount

    Co-authored-by: Calvin Zachman <calvin.zachman@protonmail.com>
    carlaKC and calvinrzachman committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    ac97800 View commit details
    Browse the repository at this point in the history
  20. htlcswitch: add blinding kit to handle encrypted data in blinded routes

    This commit introduces a blinding kits which abstracts over the
    operations required to decrypt, deserialize and reconstruct forwarding
    data from an encrypted blob of data included for nodes in blinded
    routes.
    
    The concept of a BlindingKey is separated into a separate struct so
    that it can be used independently of the kit (which is specifically used
    to process encrypted blobs). This abstraction will be used later to help
    determine how we handle errors.
    carlaKC committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    082d8c5 View commit details
    Browse the repository at this point in the history
  21. htlcswitch: add NextBlinding to ForwardingInfo and set in UpdateAddHtlc

    When we have a HTLC that is part of a blinded route, we need to include
    the next ephemeral blinding point in UpdateAddHtlc for the next hop. The
    way that we handle the addition of this key is the same for introduction
    nodes and relaying nodes within the route.
    carlaKC committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    98504bd View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    836e292 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    2b4d097 View commit details
    Browse the repository at this point in the history
  24. htlcswitch: set forwarding information from encrypted data

    If we received a payload with a blinding point set, our forwarding
    information should be set from the information in our encrypted blob.
    This behavior is the same for introduction and relying nodes in a
    blinded route.
    carlaKC committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    43b7d1c View commit details
    Browse the repository at this point in the history
  25. lntest: add setup for blinded route forwarding itest

    Note: the itest is broken up into multiple commits to make it
    more readable, they can be squashed post-review.
    carlaKC committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    e41e7a4 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    8a8bfe4 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    277cf41 View commit details
    Browse the repository at this point in the history
  28. lntest: dispatch and intercept payment to blinded route

    We don't support receiving blinded in this PR - just intercept and
    settle instead. The HTLC's arrival on the interceptor indicates that
    it was successfully forwarded on a blinded hop.
    carlaKC committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    b0f5ca8 View commit details
    Browse the repository at this point in the history