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

routing: Support Pathfinding to Blinded Routes #7267

Merged

Commits on Sep 27, 2023

  1. routing: add representation of blinded payments

    This commit adds a representation of blinded payments, which include a
    blinded path and aggregate routing parameters to be used in payment to
    the path.
    carlaKC committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    796f9a7 View commit details
    Browse the repository at this point in the history
  2. multi: add blinded path TLVs to onion payload / hops

    This commit adds the encrypted_data, blinding_point and total_amt_msat
    tlvs to the known set of even tlvs for the onion payload. These TLVs
    are added in two places (the onion payload and hop struct) because
    lnd uses the same set of TLV types for both structs (and they
    inherently represent the same thing).
    
    Note: in some places, unit tests intentionally mimic the style
    of older tests, so as to be more consistently readable.
    carlaKC committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    ac67879 View commit details
    Browse the repository at this point in the history
  3. routing: only pack amount and cltv if populated

    With the addition of blinded routes, we now need to account for the
    possibility that intermediate nodes payloads will not have an amount
    and expiry set because that information is provided by the recipient
    encrypted data blob. This commit updates our payload packing to only
    optionally include those fields.
    carlaKC committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    b4570e0 View commit details
    Browse the repository at this point in the history
  4. routing: account for blinded routes in fee calculation

    When we introduce blinded routes, some of our hops are expected
    to have zero amounts to forward in their hop payload. This commit
    updates our hop fee logic to attribute the full blinded route's
    fees to the introduction node. We can't actually know where/how
    these fees are distributed, so we collect them all at the
    introduction node.
    carlaKC committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    927c941 View commit details
    Browse the repository at this point in the history
  5. multi/refactor: add RouteRequest to hold FindRoute parameters

    This commit introduces a single struct to hold all of the parameters
    that are passed to FindRoute. This cleans up an already overloaded
    function signature and prepares us for handling requests with blinded
    routes where we need to perform some additional processing on our
    para (such as extracting the target node from the blinded path).
    carlaKC committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    e072895 View commit details
    Browse the repository at this point in the history
  6. multi: add blinded route to route requests expressed as hints

    Add the option to include a blinded route in a route request (exclusive
    to including hop hints, because it's incongruous to include both), and
    express the route as a chain of hop hints.
    
    Using a chain of hints over a single hint to represent the whole path
    allows us to re-use our route construction to fill in a lot of the
    path on our behalf.
    carlaKC committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    7fa20c3 View commit details
    Browse the repository at this point in the history
  7. routing: include route blinding fields in blinded portion of path

    This commit updates route construction to backfill the fields
    required for payment to blinded paths and set amount to forward
    and expiry fields to zero for intermediate hops (as is instructed
    in the route blinding specification).
    
    We could attempt to do this in the first pass, but that loop
    relies on fields like amount to forward and expiry to calculate
    each hop backwards, so we keep it simple (stupid) and post
    processes the blinded portion, since it's computationally cheap
    and more readable.
    carlaKC committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    38fa4ff View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2766922 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a7109d8 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    0ddb1c2 View commit details
    Browse the repository at this point in the history
  11. routing: remove 0-value warning log in pathfinding

    Blinded routes can now have "hints" that have zero value edges, so we
    remove this log to avoid spamming logs.
    carlaKC committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    600efc0 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    2a02be0 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    eb72400 View commit details
    Browse the repository at this point in the history
  14. lncli: add blinded route cli flags to query routes

    Note: This commit can be dropped before merge, it's mostly added
    to make the PR easier to manually test against other
    implementations that have bolt 12 invoices implemented already!
    carlaKC committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    9cc293b View commit details
    Browse the repository at this point in the history
  15. docs: add release notes

    carlaKC committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    e334fc0 View commit details
    Browse the repository at this point in the history