Refactor `Confirm` interface around per-block changes

Aperta
#3,867 6 commenti 2 reazioni 1 assegnatario Vedi su GitHub

@tnull ci sta già lavorando.

Dal 27/6/2025.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Currently, Confirm allows to call best_block_updated/transactions_confirmed/transaction_unconfirmed to be called independently, and even without prescribing concrete ordering requirements for the former two.

This can lead to indeterministic behavior/races. For example, we got a user report of a newly opened channel being force-closed with ClosureReason::FundingTimeOut, if the node would restart past the 2016 blocks timeout described in BOLT 2, because lightning-transaction-sync calls best_block_updated before transactions_confirmed.

While we could fix this particular race as a one-off, the real fix is a refactoring of Confirm to only take a single best_block_updated (or apply_block_changes) method that would take an UpdatedBlock object describing all the changes that happend as part of a particular block. We should then internally make sure that these changes are applied exactly in the order they need to be.

Lingua principale
Rust
Stelle
1.4k
Fork
482
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lightningdevkit/rust-lightning

Tutte le issue di lightningdevkit/rust-lightning

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.