Failure to reject `open_channel` where funder cannot pay commitment fee
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- scala
- Ambito
- blockchain, payments
Direzione di ricerca
La verifica da riutilizzare si trova già in makeCommitTxs in eclair-core/src/main/scala/fr/acinq/eclair/channel/Helpers.scala, e la nuova validazione va in validateParamsSingleFundedFundee nello stesso file. Inizia leggendo come vengono usati commitTxTotalCost e CannotAffordFirstCommitFees lì. L'issue include un caso ScalaTest, “recv OpenChannel (funder cannot afford commitment fee)”, da aggiungere alla suite di test di open-channel. È completato quando questo test passa: Bob risponde con un Error che contiene CannotAffordFirstCommitFees e il canale raggiunge lo stato CLOSED.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
BOLT 2 requires the receiver of open_channel to fail the channel when the funder's amount cannot cover the initial commitment fee:
The receiving node MUST fail the channel if:
- the funder's amount for the initial commitment transaction is not sufficient for full [fee payment](03-transactions.md#fee-payment).
Eclair implements the rule, but too late. The channel isn't rejected until later in the flow, after receiving funding_created.
Impact
A peer can set a push_msat for the channel that leaves insufficient funds to pay the initial commitment fee and the two anchor outputs. Eclair initially accepts such channels and responds with accept_channel, even though it will inevitably reject them one roundtrip later in the funding flow (after receiving funding_created). This is entirely a spec compliance issue.
Reproduction
test("recv OpenChannel (funder cannot afford commitment fee)") { f =>
import f._
val open = alice2bob.expectMsgType[OpenChannel]
// BOLT 2: the receiving node MUST fail the channel if the funder's amount for
// the initial commitment transaction is not sufficient for full fee payment.
// The funder owes the commit tx fee plus both anchors and pushes one sat
// too much, leaving them with insufficient funds to meet those obligations.
val spec = CommitmentSpec(Set.empty, open.feeratePerKw, 0 msat, 0 msat)
val fees = commitTxTotalCost(open.dustLimitSatoshis, spec, ZeroFeeHtlcTxAnchorOutputsCommitmentFormat)
bob ! open.copy(pushMsat = (open.fundingSatoshis - fees + 1.sat).toMilliSatoshi)
val error = bob2alice.expectMsgType[Error]
assert(error == Error(open.temporaryChannelId, CannotAffordFirstCommitFees(open.temporaryChannelId, missing = 1.sat, fees = fees).getMessage))
listener.expectMsgType[ChannelAborted]
awaitCond(bob.stateName == CLOSED)
}
If we continue the flow to funding_created, the makeCommitTxs check rejects the channel:
ERROR f.a.e.c.fsm.Channel - can't pay the fee in first commitment: missing=12214 sat fees=24423 sat
while processing msg=FundingCreated in state=WAIT_FOR_FUNDING_CREATED
Suggested fix
Apply the same check that already exists in makeCommitTxs in validateParamsSingleFundedFundee.
Discovery
Found while fuzzing the v1 funding protocol with smite.
- Lingua principale
- Scala
- Stelle
- 1.3k
- Fork
- 285
- Merge medio
- 20h 22m
- PR unite (30g)
- 28
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la 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 ACINQ/eclair
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ACINQ/eclair
Issue simili
-
GeoSeries scale and skew tests fail with pytest 9.2.0Forse già presa @jiayuasu l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Python unit CI fails on Ubuntu 26.04 runnerForse già presa @parthosa l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 83/100
NVIDIA/cudf-spark-tools#2207 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
canton-network/splice#8087 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno