Refactor `Confirm` interface around per-block changes

Aberta
#3,867 6 comentários 2 reações 1 responsável Ver no GitHub

@tnull já está trabalhando nisso.

Desde 27/6/2025.

Avaliação

Esta issue ainda não foi avaliada.

Descrição

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.

Linguagem predominante
Rust
Estrelas
1.4k
Forks
482
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de lightningdevkit/rust-lightning

Todas as issues de lightningdevkit/rust-lightning

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.