lightning icon indicating copy to clipboard operation
lightning copied to clipboard

add inbound fees fields to channel event

Open bufo24 opened this issue 9 months ago • 8 comments

Adds needed fields to be compatible with the new fields added in this PR:

https://github.com/lightningnetwork/lnd/pull/8723

Will change from draft to ready for review whenever the LND PR gets merged

bufo24 avatar May 06 '24 10:05 bufo24

I was thinking about calling this source_discount rather than inbound_fee to give more clarity towards what it is typically doing, reducing the outbound fee rate based on the source

alexbosworth avatar May 06 '24 13:05 alexbosworth

I know LND also calls it inbound fees, so it's nice to be consistent with the naming, so other devs directly understand that we're talking about the same thing, instead of having to figure out it source_discount and inbound fees are the same.

bufo24 avatar May 06 '24 14:05 bufo24

I don't think it would be the same because I'd flip the sign on it, although I have to play with it to know

Consistency with naming isn't a goal of the arguments generally

alexbosworth avatar May 06 '24 14:05 alexbosworth

I'm playing around with this on the other APIs, just a heads up not 100% settled on naming but I can adjust it

alexbosworth avatar May 06 '24 14:05 alexbosworth

OK what I settled on is:

inbound_fee_base_msat should map to inbound_base_discount_mtokens but negative sign (unless 0, then 0), and a string rather than a number

inbound_fee_rate_milli_msat should map to inbound_rate_discount but negative sign (unless 0, then just 0)

alexbosworth avatar May 07 '24 21:05 alexbosworth

LND already gives the negative values, do you want to make them positive?

bufo24 avatar May 08 '24 11:05 bufo24

And I tested this and I see that the inbound fees are coming in like numbers, not strings:

{
    custom_records: {
      '\x03Ù\x00\x00\x00\x00\x00\x00': <Buffer ff ff ff f6 ff ff ff ec>
    },
    time_lock_delta: 50,
    min_htlc: '1000',
    fee_base_msat: '10',
    fee_rate_milli_msat: '10000000',
    disabled: false,
    max_htlc_msat: '49500000',
    last_update: 0,
    inbound_fee_base_msat: -10,
    inbound_fee_rate_milli_msat: -20
  }

bufo24 avatar May 08 '24 11:05 bufo24

Yeah I saw that too, I pushed some changes for the existing inbound fees that should show the transform

alexbosworth avatar May 08 '24 13:05 alexbosworth