ACINQ / eclair

A scala implementation of the Lightning Network.
Apache License 2.0
1.24k stars 266 forks source link

Feature request: better (manual) fee control #1028

Closed viaj3ro closed 5 years ago

viaj3ro commented 5 years ago

In the last 4 months I paid a total of around ~0.22 BTC for roughly 600 channel opening/closing transactions even though my opening tx are always only paying a maximum of 1-5 sat/b and only maybe 75% of those channels were opened by myself. Pretty much all of those tx happened during times of insignificant network congestion. As soon as congestion goes up, things will get much worse and 0.22 BTC is already pretty bad!

If possible, this would be the best imho:

Hopefully at least some of it can be implemented before the bull market starts picking up steam. Otherwise I fear that operating a routing node will become VERY expensive. I'm already paying hundreds of dollars each month...

viaj3ro commented 5 years ago

Would be nice to have a say or at least try to have some influence on the fee when a peer mutually closes a locally opened channel. Since peers have an interest in getting funds back fast but pay absolutely none of the fees they will always have an incentive to pay the highest fee possible for such channel closures. In the end it hurt's everyone and it would be nice to have a solution. One solution would be if every node advertises the highest and lowest fees in sats per byte they would accept as well as the highest and lowest block target. Peers can then decide if they are willing to accept or refuse channels with a respective node.

Example: lowest accepted block target: 72 highest accepted block target: 2016 lowest accepted fee: 1 s/vb highest accepted fee: 50 s/vb

If a peer has a range setting that overlaps, channel opening will be accepted. Otherwise the node sends an error message back with the accepted range and the funding party can decide if they wanna adjust their settings accordingly or rather not open a channel with the respective node.

Having both, a fee setting and a block target could be problematic but could probably be solved by requiring only one to be within range or prioritize one over the other.

Since fees are very dynamic and those settings are much less dynamic, transactions could get stuck. It should always be quite simple to get them unstuck via CPFP though.

It would probably be even better to have an advanced option to manually adjust the max accepted fee and block target upon channel opening not only via the config. This would provide much more flexibility.

araspitzu commented 5 years ago

1066 already handles mutual close, it will be possible to configure the feerate (see block target) to use when computing the commitment transaction (which is what is used in mutual close). The commitment fees are part of the negotiation of the channel opening, in fact they are inside the open_channel message sent to open a new channel, the receiving peer can refuse to accept the channel if the feerate is not satisfying. Unfortunately due to CPFP's rules we can't use it here but note that there has been proposals to integrate it in the commitment transaction.