rust-lightning icon indicating copy to clipboard operation
rust-lightning copied to clipboard

Change max_value_in_flight based on channel being public

Open TheBlueMatt opened this issue 1 year ago • 9 comments

If a channel isn't public, our "reduce max_value_in_flight to provide routed payments more privacy" thing doesn't make sense...cause the channel isn't routing payments. Thus, our default config should depend on if the channel is public here, IMO.

TheBlueMatt avatar Jan 24 '24 22:01 TheBlueMatt

Hello @TheBlueMatt, I'm looking into this but as I'm just getting started with the code base I lack a bit of information.

My best guess is you are talking about the anti_probing_penalty_msat: https://github.com/lightningdevkit/rust-lightning/blob/bf3bc420c7ff80f033f3a7871168e3b63ae34c1c/lightning/src/routing/scoring.rs#L604

If so, as far as I can see, that already get's only applied on public channels as channel_penalty_msat returns 0 for non-public hops: https://github.com/lightningdevkit/rust-lightning/blob/bf3bc420c7ff80f033f3a7871168e3b63ae34c1c/lightning/src/routing/scoring.rs#L1330

Given that you're aware of how this works much better than I am, I suppose you are talking about something different?

Cheers, Simon

SimonAdameit avatar Mar 01 '24 10:03 SimonAdameit

Hello @TheBlueMatt, I'm looking into this but as I'm just getting started with the code base I lack a bit of information.

My best guess is you are talking about the anti_probing_penalty_msat:

https://github.com/lightningdevkit/rust-lightning/blob/bf3bc420c7ff80f033f3a7871168e3b63ae34c1c/lightning/src/routing/scoring.rs#L604

Close, I think this issue is around the actual htlc_maximum_msat we set, not the anti_probing_penalty_msat we score peers with who set the former lower.

For context: generally, peers provide more privacy if they limit htlc_maximum_msat as this reduces the capability of probing peers to gain information about the actual liquidity, at least if it is above htlc_maximum_msat. E.g., if a peer sets htlc_maximum_msat to 10% of the channel capacity, a probing peer could only test the actual liquidity when it drops below these 10%. So for forwarding ('public') nodes, limiting htlc_maximum_msat is a privacy feature, but for non-forwarding nodes it just unnecessarily restricts our maximum HTLC size.

So, we should only apply the limit if we have any announced ('public') channels, i.e., can be considered a forwarding node.

tnull avatar Mar 01 '24 11:03 tnull

hey @SimonAdameit
are you still interested in doing this?

jbesraa avatar Mar 08 '24 10:03 jbesraa

@jbesraa Unfortunately I haven't had the time recently and if I find some time to dedicate to the project, I could just pick another issue if this is already done. So if you or someone else wants to work on it, please go ahead!

SimonAdameit avatar Mar 11 '24 18:03 SimonAdameit

Hii, @jbesraa I am interested in this issue, I can try this issue if you are not taking it :)

Sharmalm avatar Mar 12 '24 09:03 Sharmalm

sure @Sharmalm, feel free to take this

jbesraa avatar Mar 12 '24 11:03 jbesraa

Thanks @jbesraa

Sharmalm avatar Mar 15 '24 13:03 Sharmalm

Don't think we should hold 112 on this.

TheBlueMatt avatar Mar 18 '24 16:03 TheBlueMatt

Hello everyone, My approach to solve this issue is update the changes in configuration in lightning/src/util/config/ChannelConfig so that inbound_htlc_maximum_msat will only be included in if channel is public.

Sharmalm avatar Apr 02 '24 03:04 Sharmalm