Skip to content

Add deduplication or stable IDs for user-facing events #967

Description

@joostjager

Problem

Without stable event ids in LDK, ldk-node has no reliable upstream identity to persist with app-facing events. A replayed LDK event can therefore look like a fresh event to ldk-node, which can lead to duplicate app-facing events after restart.

Payment events usually carry enough payment-level identifiers for careful applications to dedupe the highest-risk side effects, but that is an event-specific workaround rather than a general event identity contract. For non-payment events, applications may create duplicate notifications, accounting entries, operational actions, or fulfillment work if they treat ldk-node events as exactly-once.

Upstream and Remaining ldk-node Work

The upstream rust-lightning side is tracked in https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/issues/4794. That issue covers the missing public logical identity for replayed lightning::events::Events.

If LDK exposes a stable event identity or idempotency token, ldk-node should persist it, or an app-event identity derived from it, with the queued app-facing event. On replay, ldk-node should then recognize that the corresponding app event was already queued or handled instead of appending a duplicate.

ldk-node should also decide whether to expose this identity to applications. If app-facing events remain at-least-once, exposing a stable event id or idempotency key would make that contract explicit and give applications a reliable dedupe key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions