[bug]: AMP sub-invoice accepts HTLCs after cancellation
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
- #11177 di @abhayguptas — chiusa senza merge
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 85/100
Direzione di ricerca
Il bug si trova nella funzione updateMpp() del registro delle fatture di LND; inizia da lì per aggiungere un controllo sull'HtlcState della sotto-fattura AMP specifica dopo la validazione dell'indirizzo di pagamento, restituendo ResultInvoiceAlreadyCanceled se il setID associato è già annullato. Aggiorna il test di regressione esistente testFailPartialAMPPayment in invoices/invoiceregistry_test.go per verificare il rifiuto immediato invece del precedente workaround per il timeout, quindi esegui la suite di test pertinente per confermare la correzione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Pre-Submission Checklist
- I have searched the existing issues and believe this is a new bug.
- I am not asking a question about how to use lnd, but reporting a bug (otherwise open a discussion).
LND Version
0.21.99-beta
LND Configuration
Bug Description
An AMP sub-invoice that has already been canceled can still accept a new
HTLC for the same setID while the parent invoice remains open.
This happens because updateMpp() checks the parent invoice state but does
not check the state of the specific AMP sub-invoice.
Expected Behavior
A new HTLC for an AMP setID that is already in HtlcStateCanceled should
be rejected immediately with ResultInvoiceAlreadyCanceled.
Current Behavior
The HTLC is accepted/deferred and can remain pending until the invoice
eventually expires.
Reproduction
- Create an AMP invoice.
- Send a partial AMP payment so the specific
setIDbecomes canceled. - Send another HTLC for the same
setID. - The new HTLC is accepted instead of being rejected immediately.
Background
This behavior was previously noted in invoices/invoiceregistry_test.go
with the following TODO:
TODO(ziggie): Fix this bug.
The existing test currently works around the issue by allowing the HTLC to
remain pending until the MPP timeout.
Proposed Fix
Check the specific AMP sub-invoice state in updateMpp() after validating
the invoice payment address.
If the setID is already HtlcStateCanceled, return
ResultInvoiceAlreadyCanceled.
Testing
Update the existing regression test to verify the new immediate failure
behavior and remove the existing expiry/timeout workaround.
Backend Version
Not applicable - this issue is in the invoice registry/state machine and does not depend on the Bitcoin backend.
Backend Configuration
Not applicable - the issue occurs in the invoice handling logic and does not depend on bitcoind/btcd configuration.
OS/Distribution
macOS (Darwin). Backend-independent issue in the LND invoice registry.
Bug Details & Steps to Reproduce
An AMP sub-invoice can accept a new HTLC after that specific AMP setID
has already been canceled, as long as the parent invoice remains open.
The existing test testFailPartialAMPPayment documents this behavior and
contains a TODO to fix it.
Steps to reproduce:
- Create an AMP invoice.
- Send a partial AMP payment so the specific
setIDbecomes canceled. - Send another HTLC for the same
setIDusing the correct payment address. - Observe that the new HTLC is accepted/deferred instead of being rejected
immediately.
Expected Behavior
A new HTLC for an AMP setID that is already in HtlcStateCanceled should
be rejected immediately with ResultInvoiceAlreadyCanceled.
The canceled AMP sub-invoice should not accept or persist the new HTLC.
The parent invoice should remain open so that other AMP setIDs can still
receive payments.
Debug Information
No response
Environment
No response
- Lingua principale
- Go
- Stelle
- 8.2k
- Fork
- 2.3k
- Merge medio
- 1g 11h
- PR unite (30g)
- 103
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lightningnetwork/lnd
-
funding: failure logs print `<nil>` error and zero channel IDForse già presa @litbot-9000 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
lightningnetwork/lnd#11676 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 85/100
lightningnetwork/lnd#11674 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
lightningnetwork/lnd#11672 ·
I maintainer di solito rispondono entro 1 giorno
-
test flake
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
lightningnetwork/lnd#11663 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[flake]: lnwallet/test/bitcoind.TestLightningWalletBitcoindRPCPolling/spend_unconfirmed_outputsApertatest flake
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
lightningnetwork/lnd#11642 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di lightningnetwork/lnd
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
containers/gvisor-tap-vsock#796 ·
I maintainer di solito rispondono entro 2 giorni
-
external needs:triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
celestiaorg/celestia-node#5448 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Azure SAS signing uses local time instead of UTC, shifting validity window on non-UTC hostsForse già presa @huanghaoyuanhhy l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
zilliztech/milvus-backup#1418 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
projectdiscovery/nuclei#8423 ·
I maintainer di solito rispondono entro 1 giorno