The LSPS2 specification requires the LSP to add a custom extra_fee TLV to the update_add_htlc message. An LSP run on top of CLN will intercept htlcs using the htlc_accepted hook. For some htlcs, LSP fees will be deducted from the outgoing amount, by modifying the onion payload.
I tried adding the extra_fee record to the returned payload in the htlc_accepted hook, but I get an error: Failing HTLC because of an invalid payload. I assume this is because the TLV is not recognized. The only option currently available appears to be to enable all unknown TLVs on the node, but that is not what I want.
Relevant section in LSPS2: https://github.com/BitcoinAndLightningLayerSpecs/lsp/blob/a1d8ca8439e730d6a097585f7e1d091f12f9afb0/LSPS2/README.md?plain=1#L950-L966
So: Add support for custom TLVs for the update_add_htlc message.
The LSPS2 specification requires the LSP to add a custom
extra_feeTLV to theupdate_add_htlcmessage. An LSP run on top of CLN will intercept htlcs using thehtlc_acceptedhook. For some htlcs, LSP fees will be deducted from the outgoing amount, by modifying the onion payload.extra_feerecord. (65537)I tried adding the
extra_feerecord to the returned payload in thehtlc_acceptedhook, but I get an error:Failing HTLC because of an invalid payload. I assume this is because the TLV is not recognized. The only option currently available appears to be to enable all unknown TLVs on the node, but that is not what I want.Relevant section in LSPS2: https://github.com/BitcoinAndLightningLayerSpecs/lsp/blob/a1d8ca8439e730d6a097585f7e1d091f12f9afb0/LSPS2/README.md?plain=1#L950-L966
So: Add support for custom TLVs for the
update_add_htlcmessage.