routing+rpc: enable senders to set a custom first-hop TLV blob for `update_add_htlc`
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
paymentLifecyclestruct. -
[ ] 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
HTLCInterceptorto ensure that the value was properly set.
@GeorgeTsagk will work on this @saubyk will assign soon
👀 sign me up for some review when this is ready
fixed by https://github.com/lightningnetwork/lnd/pull/8660
Closed by https://github.com/lightningnetwork/lnd/pull/8660