Description
Is your feature request related to a problem? Please describe.
I am assisting the developer of some LSP software called PubLSP (details here). I want to add support for each LSP to have a privacy policy, including a data retention/deletion policy, whereby they commit to periodically purging their forwarding logs.
A routing node who keeps this privacy policy would only retain a summary of the fees they earned during each period, for accounting purposes, without retaining other information about payments they routed during that period, such as when a payment was routed, what channels it was routed through, the prior hop, the next hop, or how much money was forwarded.
But LND does not currently appear to have a method for purging forwarding logs, and it's not very easy to expect LSPs to do purge their forwarding logs if their node doesn't currently have a command for doing that.
Describe the solution you'd like
I'd like a command similar to "deletepayments" except it would be "deletefwdinghistory." As a parameter it would accept a time string like "-1w" (delete entries more than 1 week old) or "-1m" (delete entries more than 1 month old).
When called, it should purge all entries from before the specified time string, but first sum the fees earned by each forwarding event, and return the total. The user can then keep a record of the fees they earned during that period for accounting purposes.
Describe alternatives you've considered
I asked Alex Bosworth what he would do if he wanted to purge his forwarding logs and he said right now the easiest way to do it is to create a new LND instance, open new channels to whoever you previously had channels with, and then migrate all funds to the new instance.
But this seems infeasible for an LSP; they tend to have many channels, making this expensive, and many of the users they have channels with will likely be offline, which would make it difficult to open channels with them. LSPs also often commit to keeping channels open for some number of months, so they would probably violate that policy by periodically migrating to a new node. Purging their forwarding history would be a much cleaner way to achieve a the goal.