Motivation
LDK Server currently drops several event variants and fields that are already exposed by its pinned LDK Node dependency. Exposing them would improve splice monitoring, payment diagnostics, channel observability, routing integrations, and on-chain accounting for all API clients.
This was audited against LDK Server 3e9e537 and its pinned LDK Node dependency 056447c.
Each item below is independently additive and may be implemented in separate PRs or a single PR.
Confirmed gaps
1. Splice lifecycle events
LDK Node emits two splice lifecycle events: SpliceNegotiated and SpliceNegotiationFailed.
SpliceNegotiated includes the fields:
channel_id
user_channel_id
counterparty_node_id
new_funding_txo
SpliceNegotiationFailed includes:
channel_id
user_channel_id
counterparty_node_id
LDK Server currently handles both events through the catch-all event arm and immediately calls event_handled() without publishing an EventEnvelope.
Explicit protobuf event variants and mappings should be added for both events.
2. Payment failure reason
LDK Node's Event::PaymentFailed contains an optional PaymentFailureReason, which may be one of the following variants:
RecipientRejected
UserAbandoned
RetriesExhausted
PaymentExpired
RouteNotFound
UnexpectedError
UnknownRequiredFeatures
InvoiceRequestExpired
InvoiceRequestRejected
BlindedPathCreationFailed
LDK Server currently destructures PaymentFailed using .. and publishes only types.Payment.
An optional failure-reason enum should be added to the protobuf PaymentFailed event, with mappings for every current LDK variant.
This change would expose the reason only on the emitted event. GetPaymentDetails cannot recover it because LDK Node does not currently persist the failure reason in PaymentDetails.
3. Missing channel snapshot fields
LDK Node's public ChannelDetails already exposes several fields that are omitted from LDK Server's types.Channel, including:
short_channel_id
outbound_scid_alias
inbound_scid_alias
inbound_htlc_minimum_msat
inbound_htlc_maximum_msat
channel_shutdown_state
reserve_type
counterparty.features
These fields are useful for routing integrations, shutdown monitoring, reserve accounting, and distinguishing channel lifecycle state from temporary usability changes.
Corresponding protobuf fields should be added and populated in the ChannelDetails adapter.
4. On-chain transaction classification
LDK Node's PaymentKind::Onchain contains an optional TransactionType, but LDK Server currently discards it using ...
The classification distinguishes funding transactions, cooperative closes, unilateral closes, anchor bumps, claims, sweeps, and interactive funding/splice transactions. Several variants also contain associated channel IDs and counterparty node IDs.
This classification should be exposed in the protobuf on-chain payment type so it is returned by both GetPaymentDetails and ListPayments.
5. Additional dropped event and status fields
A few additional fields are also currently omitted:
ChannelPending.former_temporary_channel_id
PaymentSuccessful.bolt12_invoice
NodeStatus.latest_pathfinding_scores_sync_timestamp
These could be added as optional protobuf fields.
Compatibility
All proposed changes are additive and should be backward compatible. This includes adding new EventEnvelope.oneof variants using unused field numbers, adding optional fields to existing messages, and introducing new enums or messages without modifying existing field numbers.
Existing clients should remain compatible.
Related work
Reliable, resumable event delivery is already tracked by #245. As an interim improvement, a lagged SubscribeEvents stream could terminate with gRPC DATA_LOSS instead of silently continuing.
The following items are intentionally excluded because LDK Node does not currently expose or persist the required data:
pending_inbound_htlcs
pending_outbound_htlcs
next_splice_out_maximum_sat
current_dust_exposure_msat
- Persisted payment failure reasons for
GetPaymentDetails
- Modification-ordered payment reconciliation
Motivation
LDK Server currently drops several event variants and fields that are already exposed by its pinned LDK Node dependency. Exposing them would improve splice monitoring, payment diagnostics, channel observability, routing integrations, and on-chain accounting for all API clients.
This was audited against LDK Server
3e9e537and its pinned LDK Node dependency056447c.Each item below is independently additive and may be implemented in separate PRs or a single PR.
Confirmed gaps
1. Splice lifecycle events
LDK Node emits two splice lifecycle events:
SpliceNegotiatedandSpliceNegotiationFailed.SpliceNegotiatedincludes the fields:channel_iduser_channel_idcounterparty_node_idnew_funding_txoSpliceNegotiationFailedincludes:channel_iduser_channel_idcounterparty_node_idLDK Server currently handles both events through the catch-all event arm and immediately calls
event_handled()without publishing anEventEnvelope.Explicit protobuf event variants and mappings should be added for both events.
2. Payment failure reason
LDK Node's
Event::PaymentFailedcontains an optionalPaymentFailureReason, which may be one of the following variants:RecipientRejectedUserAbandonedRetriesExhaustedPaymentExpiredRouteNotFoundUnexpectedErrorUnknownRequiredFeaturesInvoiceRequestExpiredInvoiceRequestRejectedBlindedPathCreationFailedLDK Server currently destructures
PaymentFailedusing..and publishes onlytypes.Payment.An optional failure-reason enum should be added to the protobuf
PaymentFailedevent, with mappings for every current LDK variant.This change would expose the reason only on the emitted event.
GetPaymentDetailscannot recover it because LDK Node does not currently persist the failure reason inPaymentDetails.3. Missing channel snapshot fields
LDK Node's public
ChannelDetailsalready exposes several fields that are omitted from LDK Server'stypes.Channel, including:short_channel_idoutbound_scid_aliasinbound_scid_aliasinbound_htlc_minimum_msatinbound_htlc_maximum_msatchannel_shutdown_statereserve_typecounterparty.featuresThese fields are useful for routing integrations, shutdown monitoring, reserve accounting, and distinguishing channel lifecycle state from temporary usability changes.
Corresponding protobuf fields should be added and populated in the
ChannelDetailsadapter.4. On-chain transaction classification
LDK Node's
PaymentKind::Onchaincontains an optionalTransactionType, but LDK Server currently discards it using...The classification distinguishes funding transactions, cooperative closes, unilateral closes, anchor bumps, claims, sweeps, and interactive funding/splice transactions. Several variants also contain associated channel IDs and counterparty node IDs.
This classification should be exposed in the protobuf on-chain payment type so it is returned by both
GetPaymentDetailsandListPayments.5. Additional dropped event and status fields
A few additional fields are also currently omitted:
ChannelPending.former_temporary_channel_idPaymentSuccessful.bolt12_invoiceNodeStatus.latest_pathfinding_scores_sync_timestampThese could be added as optional protobuf fields.
Compatibility
All proposed changes are additive and should be backward compatible. This includes adding new
EventEnvelope.oneofvariants using unused field numbers, adding optional fields to existing messages, and introducing new enums or messages without modifying existing field numbers.Existing clients should remain compatible.
Related work
Reliable, resumable event delivery is already tracked by #245. As an interim improvement, a lagged
SubscribeEventsstream could terminate with gRPCDATA_LOSSinstead of silently continuing.The following items are intentionally excluded because LDK Node does not currently expose or persist the required data:
pending_inbound_htlcspending_outbound_htlcsnext_splice_out_maximum_satcurrent_dust_exposure_msatGetPaymentDetails