-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Is your feature request related to a problem? Please describe.
When an lnd node updates its channel fee policy, there is a propagation window where other nodes route payments based on the outdated fee policy.
Currently, if a node immediately enforces a higher fee, it leads to avoidable HTLC failures. This is particularly punishing for:
- Nodes using dynamic fee management (liquidity-based pricing).
- Nodes that rely on fee incentives rather than active rebalancing.
- Operators who update policies more frequently than the network convergence time.
Describe the solution you'd like
Introduce an optional, configurable grace period where a node will accept HTLCs that satisfy either the previous fee policy or the current fee policy for a specified duration after an update is announced.
1. Opt-in Configuration
Add a global configuration flag (defaulting to 0) to ensure backward compatibility:
# Example: Accept the old fee for 1 hour after a change
routing.feegraceperiod=1h
2. Channel-Level Overrides
Allow fine-grained control via lncli updatechanpolicy. This allows operators to set longer grace periods for high-traffic channels while maintaining strict enforcement on others.
3. Minimal State Tracking
To keep memory footprint low and simplify the implementation, lnd could keep only the previous policy and the timestamp of the last change, instead of a chain of changes.
Once grace period is ended, the old policy can be purged.
Describe alternatives you've considered
As an alternative to hardcoding this into the routing logic, the HTLC Interceptor API could be extended, to allow bypassing the fee policies. This would enable not only implementing the grace period, but could also be used to, for example, allow payments that didn't consider positive inbound fees.