Skip to content

Async Persistence TODOs #3052

@TheBlueMatt

Description

@TheBlueMatt

While we "shipped" async persistence quite a few releases ago, we've always maintained that it is an alpha feature and has some known (and probably unknown) bugs. This is a tracking issue for both, specifically things I think we should audit as well as things I'm confident are broken, or at least at some point or another took a note of because I was confident it was broken at that time.

Things that are probably broken

Things we should audit carefully

  • Check that we re-claim payments from other MPP channels if we restart and only managed to claim on one channel, specifically:
    • test various scenarios around force-closes on the first channel we claimed on potentially removing any blocks on the second channel or otherwise ensure we re-claim.
    • Test mpp cases around blocking the paymentclaimable event getting handled before we remove the preimage from disk? (my personal 2023-11-mon-claim-bug branch branch - Block monitor updates to ensure preimages are in each MPP part #3120)
  • PaymentClaiable purports to provide a guarantee that the payment is claimable, however if we start persisting the monitor, then the user sees the PaymentClaimable, then we restart without completing monitor or manager persistence, the counterparty could broadcast the previous state and we cant get the payment. (Very) marginally expand test_monitor_update_fail_claim #3126. Similarly, if we do persist the monitor but not the manager, we'll force-close and fail the HTLC back, which is the same end-result (this was never true, we'll obviously use the preimage in a monitor to claim on-chain 🤦).
    • we shouldn't provide the PaymentClaimable event until the last RAA persistence completes. also delays PaymentClaimable which is good for privacy (makes it look more like a forward)
  • When doing async persistence for initial channel open, what happens when...
    • the initial persist is pending, never completed, and then we restart?
    • the initial persist is pending, is it possible to get an update before it completes (hitting the InvalidValue return in channelmanager deser)?
  • What happens when we get an in-flight update from channelmanager on startup for a closed channel?
  • Make sure all ChannelMonitor access in ChannelManager::read is RO, and make the monitors map non-mutable
  • Check that PaymentClaimed is regenerated on restart properly if we have a preimage in at least one (potentially of MPP) channel
  • What happens if we send a payment, dont persist the channelmanager at all until the payment has gone all the way through the state machine and been claimed/failed? presumably on claim the event processing blocks the raa but maybe does for paymentfailed too?

Finally, to actually "release" it, we should:

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions