`lightning-liquidity`: Consider ways to make event handling API more robust

Ouverte
#4,102 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
25/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
rust
Domaine
api, backend, blockchain

Piste de recherche

Start from LiquidityManager::next_event and next_event_async and how they persist the event queue after #4059. Compare with lightning’s inline event-handler pattern, regeneration of critical events such as LSPS2ServiceEvent::OpenChannel on restart, and pending opens from #4101. Decide an approach that removes the crash-after-next_event race; done is a design plus API/docs that make those events idempotent or unmissable.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

lightning-liquidity

Currently, LiquidityManager::next_event/LiquidityManager::next_event_async return the next event an repersist the event queue (post #4059), which puts the responsibility to safely handle any important events on the user.

While some events are only informational and are not even persisted, some are critical to be able to continue the flow after a restart, for example LSPS2ServiceEvent::OpenChannel.

Currently, there might be a race if the user isn't super careful about how they implement their node logic: if the service happens to shutdown/crash just after calling next_event but before actually opening the channel, the service might lose the OpenChannel event.

We should eventually consider ways how we can make this less error prone, for example

a) Mirror the lightning event handling approach where we force the user to handle the event inline before returning the event handler function.
b) Regenerate any critical events on restart, while ensuring users have ways to make all of them idempotent
c) Have users detect what channel opens are pending based on #4101

Langage dominant
Rust
Étoiles
1.4k
Forks
482
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de lightningdevkit/rust-lightning

Toutes les issues de lightningdevkit/rust-lightning

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.