channeldb+routing: refactor payment lifecycle (routing)

https://github.com/lightningnetwork/lnd/pull/6683

Host: positiveblue  -  PR author: yyforyongyu

Notes

  • Some commits in this PR are for fixing the code formatting. Learn more the accepted code style here
  • Keep in mind this is a WIP PR when reviewing it

Questions

  • What are the main goals of this PR?
  • Why would we remove the total_amount field from the paymentLifeCycle struct?
  • Which are the current payment status? Which ones are added/removed in this PR? Do you miss any new type?
  • What is a terminal payment status? What payment status are terminal?
  • What does shard means in this context? What’s its relation with the payment life cycle?
  • What things need to be tested before merging this PR?
  • Would you include any related changes in this PR? Would you split it in smaller one? If so, what changes would you bundle together?