lnd icon indicating copy to clipboard operation
lnd copied to clipboard

[feature]: add more parameters to Channel Acceptor

Open AndySchroder opened this issue 10 months ago • 5 comments

Would like to see some more parameters added to Channel Acceptor

  • to_self_delay
  • base_fee
  • fee_rate
  • time_lock_delta

I realize that the base_fee, fee_rate, and time_lock_delta can be changed at any time by the other party, but if we already know their values will be undesirable to us from the start, we'd rather not take the risk opening a channel with them.

Also, the to_self_delay could be renegotiated later if https://github.com/lightning/bolts/pull/1117 gets complete, but again we'd rather not open a channel with someone if we know we are going to want to renegotiate immediately. See https://github.com/lightningnetwork/lnd/issues/8635 for some more discussion on why controlling the to_self_delay is desirable.

AndySchroder avatar Apr 10 '24 06:04 AndySchroder

So to_self_delay wouldn't be a problem to add because the counter party does send it via the channel negotiation, the other parameters are not negotiated but are part of the Channel_Update Gossip msg, which is only sent when the channel is already confirmed. So I don't think it is feasible, maybe query his other channels before opening a channel to get an idea of their fee strategy and timelock security evaluation ?

ziggie1984 avatar Apr 12 '24 00:04 ziggie1984

maybe query his other channels before opening a channel to get an idea of their fee strategy and timelock security evaluation

You're suggesting this as a logic which user can apply, correct? Not something that we might build into channel acceptor

saubyk avatar Apr 16 '24 17:04 saubyk

exactly fees and timelock are not exchanged during the opening process, so we cannot build this into the channel acceptor.

ziggie1984 avatar Apr 16 '24 18:04 ziggie1984

exactly fees and timelock are not exchanged during the opening process, so we cannot build this into the channel acceptor.

Okay, so actually one's script calling Channel Acceptor actually can already do the best we can because we can look at the node_pubkey and then use other RPC calls to query that nodes other channels and then decide what to do before accepting.

However, why does Channel Acceptor provide min_htlc and max_value_in_flight? Are those policies or channel parameters?

AndySchroder avatar Apr 19 '24 07:04 AndySchroder

However, why does Channel Acceptor provide min_htlc and max_value_in_flight? Are those policies or channel parameters?

The latter, they are channel constraints your peer has to follow when creating the commitment transaction. So his max_htlc amount in his channel policy can never be greater than the max_value_in_flight you negotiated during the channel opening.

ziggie1984 avatar Apr 22 '24 09:04 ziggie1984