lnd icon indicating copy to clipboard operation
lnd copied to clipboard

routing+rpc: enable senders to set a custom first-hop TLV blob for `update_add_htlc`

Open Roasbeef opened this issue 1 year ago • 2 comments

Protocol improvement proposals such as the endorsement bit require the ability for an implementation to set a new TLV value (so far none are used) within the update_add_htlc message. We should add such an ability to facilitate such improvement proposals.

Today the LightningPayment struct houses all payment details requested by the sender, we can set a custom TLV blob for the last hop, but not yet the first hop: https://github.com/lightningnetwork/lnd/blob/b1175514f9854b965d4716ac015ea15387c63081/routing/router.go#L2228-L2329

We should add another custom blob here, then ensure that we include it once we go to make the UpdateAddHTLC message to send to the first hop: https://github.com/lightningnetwork/lnd/blob/b1175514f9854b965d4716ac015ea15387c63081/routing/payment_lifecycle.go#L667-L696

Steps To Completion

  • [ ] Add new field to LightningPayment

  • [ ] Thread through context to the paymentLifecycle struct.

  • [ ] Add a slim RPC cut out so we can write an itest in addition to unit tests. The itest can set a custom value for the first hop, then use the HTLCInterceptor to ensure that the value was properly set.

Roasbeef avatar Apr 03 '24 02:04 Roasbeef

@GeorgeTsagk will work on this @saubyk will assign soon

dstadulis avatar Apr 10 '24 21:04 dstadulis

👀 sign me up for some review when this is ready

carlaKC avatar Apr 15 '24 15:04 carlaKC

fixed by https://github.com/lightningnetwork/lnd/pull/8660

dstadulis avatar May 16 '24 16:05 dstadulis

Closed by https://github.com/lightningnetwork/lnd/pull/8660

GeorgeTsagk avatar May 22 '24 15:05 GeorgeTsagk