Skip to content

Implement LSP notification outbox: persist intent, then deliver/retry until acknowledged #39

@txalkan

Description

@txalkan

notify_claimable_hodl_invoice and notify_payment_sent are detached spawn(...) calls that only log on error, with no outbox, retry, or restart replay.

The relevant payment state is persisted before those callbacks fire, but a transient HTTP failure or process exit can drop the callback permanently (the callback itself is a single ingress event from RLN to LSP).

The LSP treats each callback as the only state transition, so the workflow can stall. It already has a durable outbox for the follow-up work after the callback lands (persists the outbox job after the callback, then processes it, and retries until it is applied - this protects against LSP crashes or partial handling after a message arrives).

If RLN stays best-effort here, we should add a complementary recovery mechanism in UTEXO-LSP (e.g., it could scan the payment records and reconcile any entries that never got the expected callback). Hence, the missing piece is either RLN durability or an LSP reconciliation sweep that queries RLN as source of truth

UTEXO-LSP's durable outbox currently covers the LSP-side follow-up after a callback, not delivery of the callback itself.

flowchart TD
  A[RLN payment_sent] --> B[LSP /internal/async_order/payment_sent]
  B --> C[mark outbound_claimed]
  C --> D[outbox: claim_inbound_invoice]
  D --> E[cron drains outbox]
  E --> F[claim hodl invoice]
  F --> G[inbound_claimed]
Loading

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions