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

multi: update the switch+router to be aware of the new TLV EOB format #3362

Merged
merged 12 commits into from
Aug 23, 2019

Commits on Aug 23, 2019

  1. Configuration menu
    Copy the full SHA
    ac6f565 View commit details
    Browse the repository at this point in the history
  2. tlv: add new Type() and Encode() methods to Record

    In this commit, we add two new method so the `Record` struct: Type() and
    Encode(). These are useful when a caller is handling a record and may
    not know its underlying type and may need to encode a record in
    isolation.
    Roasbeef committed Aug 23, 2019
    Configuration menu
    Copy the full SHA
    aea529d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e60b367 View commit details
    Browse the repository at this point in the history
  4. routing/route+tlv: add new TLV-EOB awareness to Hop+Route

    In this commit, we extend the Hop struct to carry an arbitrary set of
    TLV values, and add a new field that allows us to distinguish between
    the modern and legacy TLV payload.
    
    We add a new `PackPayload` method that will be used to encode the
    combined required routing TLV fields along any set of TLV fields that
    were specified as part of path finding.
    
    Finally, the `ToSphinxPath` has been extended to be able to recognize if
    a hop needs the modern, or legacy payload.
    Roasbeef committed Aug 23, 2019
    Configuration menu
    Copy the full SHA
    5b4c8ac View commit details
    Browse the repository at this point in the history
  5. routing: extend path finding to be TLV-EOB aware, allow dest TLV records

    In this commit, we extend the path finding to be able to recognize when
    a node needs the new TLV format, or the legacy format based on the
    feature bits they expose. We also extend the `LightningPayment` struct
    to allow the caller to specify an arbitrary set of TLV records which can
    be used for a number of use-cases including various variants of
    spontaneous payments.
    Roasbeef committed Aug 23, 2019
    Configuration menu
    Copy the full SHA
    4697cfd View commit details
    Browse the repository at this point in the history
  6. lnrpc+lnrpc/routerrpc: add a new TLV record field to the Hop proto

    In this commit, we add a new field to the Hop proto to allow callers to
    be able to specify TLV records for the SendToRoute call, and also to be
    able to display TLV records that were used during regular path finding.
    
    We also update SendPayment to support dest TLV records.
    Roasbeef committed Aug 23, 2019
    Configuration menu
    Copy the full SHA
    763cb6c View commit details
    Browse the repository at this point in the history
  7. channeldb: update route.Hop serialization to include new EOB related …

    …fields
    
    We also include a migration for the existing routes stored on disk.
    Roasbeef committed Aug 23, 2019
    Configuration menu
    Copy the full SHA
    c78e3aa View commit details
    Browse the repository at this point in the history
  8. multi: add TLV awareness to htlcswitch, pass extra EOB to the invoice…

    … registry
    
    In this commit, we update the `HopIterator` to gain awareness of the new
    TLV hop payload. The default `HopIterator` will now hide the details of
    the TLV from the caller, and return the same `ForwardingInfo` struct in
    a uniform manner. We also add a new method: `ExtraOnionBlob` to allow
    the caller to obtain the raw EOB (the serialized TLV stream) to pass
    around.
    
    Within the link, we'll now pass the EOB information into the invoice
    registry. This allows the registry to parse out any additional
    information from the EOB that it needs to settle the payment, such as a
    preimage shard in the AMP case.
    Roasbeef committed Aug 23, 2019
    Configuration menu
    Copy the full SHA
    23cc838 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    9145c0f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1345ca2 View commit details
    Browse the repository at this point in the history
  11. config: add new legacy protocol build tag protected sub-config for le…

    …gacy onion
    
    In this commit, we add a new build tag protected sub-config for legacy
    protocol features. The goal of this addition is to be able to default to
    new feature within lnd, but expose hooks at the config level to allow
    integration tests to force the old behavior to ensure that we're able to
    support both the old+new versions.
    Roasbeef committed Aug 23, 2019
    Configuration menu
    Copy the full SHA
    653d557 View commit details
    Browse the repository at this point in the history
  12. lntest/itest: force dave to use the legacy onion payload in multi-hop…

    … pay test
    
    In this commit, we force Dave to use the legacy onion payload for the
    multi-hop test to ensure that we're able to properly mix the old and new
    formats, and have all nodes properly decode+forward the HTLC.
    Roasbeef committed Aug 23, 2019
    Configuration menu
    Copy the full SHA
    b1aea41 View commit details
    Browse the repository at this point in the history