Repository navigation
Merge lnd v0.21.8-beta into Lightning Fork - #26
Conversation
Create and validate host cache directories before Docker bind mounts them. On a fresh Go installation, Docker otherwise creates missing sources as root. The release helper runs as the invoking user and cannot write to those caches.
Mount a linked worktree's shared Git directory into the release helper at its original path. Its .git pointer otherwise resolves to a path absent from the container, preventing tag checks and source archiving.
…er-fixes-v0.21.x Backport builder fixes v0.21.x
In this commit, we prevent restored channel shells from entering the local force-close path. These shells do not have a local commitment transaction, so attempting to sign one can panic and leave the arbitrator in a persisted broadcast state. We treat the restored status like local data loss and let the arbitrator wait for the remote close. We also handle the resulting nil close transaction in the peer failure path instead of dereferencing it for logging. (cherry picked from commit 06b0784)
(cherry picked from commit 2a2720d)
In this commit, we rewrap the overlong comment, test name, and restart call in the channel arbitrator restart test, keep a blank line before the early return, split the long force close errorf in brontide, and move the restored-status check in the force close guard into its own expression so the multi-line condition formats cleanly. (cherry picked from commit 44f2b92)
In this commit, we key confirmation hints by the same txid and output script that a confirmation request uses to match a transaction. Two pending requests can share a txid while watching different scripts, and the txid-only cache key let one request's scan advance the other's hint, so the request could resume from its caller-provided height instead of the block where its transaction confirmed. We add a cache regression for requests with the same txid and different scripts, plus an integration case that runs the breach confirmation with bitcoind without txindex and requires the justice transaction to sweep the revoked outputs while the funding request remains pending. (cherry picked from commit 22a68df)
(cherry picked from commit 3e4c79f)
Continue contractcourt processing when a recorded commitment or legacy HTLC timeout transaction is rejected for paying an insufficient replacement fee. This result can indicate that another transaction spending the same output is already in the mempool. The channel arbitrator advances to its existing commitment-broadcast state, where anchor handling covers whichever commitment confirms. The legacy nursery continues startup and registers for its timeout transaction rather than treating the publication result as fatal. Other publication errors retain their current behavior. Leave legacy success publication unchanged because it has no independent watcher for the original HTLC spend and must not checkpoint a prospective success output after a rejected publication. (cherry picked from commit eb51b5c)
In this commit, we bound the persisted unsigned acked update list before advancing the local commitment tail. The disk serializer rejects lists larger than its uint16 count can express, so an overflow cannot silently discard a remote settle on restart. We also recover complete lists written by older nodes with a wrapped count. The database decoder checks the trailing entries and their count before accepting the value. (cherry picked from commit 96daf22)
(cherry picked from commit d4cdf3d)
(cherry picked from commit c6e3e70)
Rewrap long lines and use an integer range in the update log limit tests. (cherry picked from commit acd7ad8)
In this commit, we reject a peer alias when the channel graph already assigns that SCID to another funding outpoint. An alias must identify the channel that owns it, so we don't sign updates that attribute it to another channel. We validate aliases when channel_ready admits or rotates them and repeat the check before each status or policy update substitutes the alias. Rechecking at the signing boundary also covers graph edges that appear after admission and the zero-conf RemoteAlias path. Aliases in the reserved alias range remain valid because nodes allocate them independently, so equal aliases from different peers are legitimate. Only collisions outside that range can name a real channel SCID and are rejected. (cherry picked from commit 293fd8b)
(cherry picked from commit a7ff6f0)
In this commit, we decouple link failure reporting from the peer's channel manager with a typed concurrent queue. A link can otherwise report its terminal failure while the channel manager is waiting for that same link to accept a close hook, which leaves both goroutines waiting on each other. We also make hook registration observe the link event-loop lifetime and the caller's context. This lets close negotiation stop cleanly when the receiver exits, while preserving the existing hook ordering when registration succeeds. The failure queue starts before active links are loaded, so a link that fails during peer startup also has a live receiver. (cherry picked from commit 0a4f3ce)
In this commit, we add real-node coverage for link failures that overlap legacy cooperative-close handling. The test holds a forwarded HTLC, fails a separate close link and the HTLC link with unknown settles, then mines to the outgoing deadline. We assert that the node broadcasts its commitment, publishes the outgoing HTLC timeout transaction after confirmation, and continues processing later blocks. This covers the on-chain path that the focused peer and link tests can't exercise. (cherry picked from commit 123094d)
(cherry picked from commit 236e089)
(cherry picked from commit 2c3d8c5)
…ort-11478-to-v0.21.x-branch [v0.21.x-branch] Backport lightningnetwork#11478: scidalias: reject peer aliases for other channels
…ort-11479-to-v0.21.x-branch [v0.21.x-branch] Backport lightningnetwork#11479: funding: preserve batch state after publish errors
…ort-11480-to-v0.21.x-branch [v0.21.x-branch] Backport lightningnetwork#11480: lnwallet: reject force close for restored channels
…ort-11481-to-v0.21.x-branch [v0.21.x-branch] Backport lightningnetwork#11481: channeldb: scope confirmation hints by script
The ConfirmHintCache doc comments updated in lightningnetwork#11481 exceed the 80-character line limit, which fails the ll linter on master and on every open PR that is linted against it. (cherry picked from commit 45c3896)
…ort-11482-to-v0.21.x-branch [v0.21.x-branch] Backport lightningnetwork#11482: lnwallet: reject oversized unsigned acked update logs
…ort-11484-to-v0.21.x-branch [v0.21.x-branch] Backport lightningnetwork#11484: contractcourt: handle replacement fee rejections
…ort-11483-to-v0.21.x-branch [v0.21.x-branch] Backport lightningnetwork#11483: peer: decouple link failure delivery
…ort-11497-to-v0.21.x-branch [v0.21.x-branch] Backport lightningnetwork#11497: chainntnfs: wrap ConfirmHintCache comments at 80 columns
The backported test imported the btcutil, chainhash and wire v2 modules, which this branch does not depend on, so the itest package failed to compile. Use the v1 import paths the rest of the branch uses.
…ort-fix-itest-btcd-imports-v0.21.x-branch [v0.21.x-branch] itest: use btcd v1 module paths in conf hint poison test
In this commit, we reject a CSV delay of zero during constraint verification. The CSV delay is the time the owner of a commitment must wait before sweeping their own output, and it is the window the other party has to respond to a breach. A delay of zero removes that window entirely and is never a sensible value, but VerifyConstraints only bounded the delay from above. VerifyConstraints is the one place every delay passes through: CommitConstraints calls it for the delay the remote party requires of us, in both the initiator and responder roles, and the funding manager calls it for the delay we require of the remote party. Checking for zero there covers every channel type and both directions. (cherry picked from commit 266eba7)
(cherry picked from commit 43d9b73)
(cherry picked from commit bda464a)
(cherry picked from commit ae584f7)
(cherry picked from commit 4060177)
…ort-11542-to-v0.21.x-branch [v0.21.x-branch] Backport lightningnetwork#11542: htlcswitch: recover forwarded adds across link shutdowns
…ort-11485-to-v0.21.x-branch [v0.21.x-branch] Backport lightningnetwork#11485: sweep: bound wallet input selection
The backport of lightningnetwork#11542 (lightningnetwork#11544) added htlcswitch/link_forward_replay_test.go with an import of the btcd btcutil/v2 module. This branch doesn't depend on it, so the htlcswitch package fails to build its tests with "no required module provides package github.com/btcsuite/btcd/btcutil/v2". Switch the import to the v1 btcutil path the rest of the branch uses.
…tch-btcutil-import-v0.21.x-branch [v0.21.x-branch] htlcswitch: use btcd v1 btcutil path in forward replay test
…ort-11440-to-v0.21.x-branch [v0.21.x-branch] Backport lightningnetwork#11440: multi: tighten wire, fee and transaction invariants
BOLT 2 requires a node to send channel_reestablish for every remembered channel when a peer reconnects. Pending channels are remembered but have no link, so lnd previously sent nothing until funding confirmed. A peer waiting for the message could disconnect the shared connection. Queue the message while loading pending channels and record the handoff so the link created after confirmation still processes the remote state without sending a duplicate. Add regression coverage for the pending funding-node case. Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com> (cherry picked from commit 14efa3d)
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com> (cherry picked from commit 6e47397)
…ort-11540-to-v0.21.x-branch [v0.21.x-branch] Backport lightningnetwork#11540: peer: reestablish pending channels on reconnect
…7-final build: bump version to v0.21.7
…ending-reestablish-checks peer: fix pending reestablish backport checks
…8-final-stacked build: bump version to v0.21.8
|
Thanks, Kilombino, this is a careful merge. I went through it against the fork's diff before and after: every fork hunk survives byte for byte outside the files you resolved, and the 13 resolutions look right to me. That covers The BLAKE2b integration failure is ours, not the merge's. Upstream's new btcwallet: I merged your btcwallet-blake2b#1 and tagged v0.16.20-blake2b.4 (e5916f15). Without it, on a btcd or neutrino backend, an input rejection lnd v0.21.8 now classifies comes back as Could you:
If you'd rather, I can push those to your branch. About the five htlcswitch failures in the description: they pass with |
|
Thanks, Paul. Pushed 1 and 3:
I'll rebase on |
Brings in lnd v0.21.7-beta and v0.21.8-beta (the backports since v0.21.6). Conflicts resolved keeping the fork's splice and BLAKE2b behaviour; see the pull request.
…jection mapping); contractcourt: drop the duplicate ErrInsufficientFee case
|
Rebased onto
|
f0ac41c to
3291e8f
Compare
|
Merged, thanks, Kilombino. The integration job's one failure after the rebase was onion_message_forwarding timing out at node start; it passes locally on the same tree and passed on a re-run. |
Summary
Merges lnd v0.21.8-beta (released 11 Nov) into
blake2b. This includes v0.21.7-beta, tagged the same day and replaced within hours by v0.21.8. It is done the same way as the v0.21.6 merge:build/version.goAppPatchmoves to 8 and upstream's release notes come along. The fork's pre-release suffix is left for the release commit.What v0.21.7/v0.21.8 bring (release notes):
channel_reestablishsent on reconnect while a channel's funding is unconfirmed (peer: reestablish pending channels on reconnect lightningnetwork/lnd#11540, fixed in v0.21.8 by peer: fix pending reestablish backport checks lightningnetwork/lnd#11564). Without it the peer disconnects and takes every other channel with it offline.Conflicts
There were 13 conflicts in 8 files. Each was resolved to keep both sides:
contractcourt/channel_arbitrator.go: upstream's comment on rejected replacements, plus the fork's splice case andchain.ErrTooManyReplacements. In the test table, the fork's two extra cases stay, with upstream's name for theErrDoubleSpendcase.lnwallet/channel.goRevokeCurrentCommitment: the fork'sspliceRestoreErr/requireAllSignedchecks first, then upstream'sMaxUint16check on the unsigned acked updates (getUnsignedAckedUpdatesnow takes the index, as upstream).htlcswitch/link.go: the fork's splice fields and channels, plus upstream'shtlcManagerDone. On reconnect,amendChanSyncstill runs, and the message is then sent unless the peer already queued it for a pending channel (ChanSyncMsgSent, upstream).sweep/fee_bumper.go:getSpentInputskeeps the fork'sgracewait (readSpend,spentLookupGrace) and returns errors as upstream does. A failed spend notification registration, or a closed one, is an inconclusive check:handleMissingInputsfails the record witherrSpendCheckFailed, and the per-block check logs it and proceeds as unspent. Both behaviours are upstream's. The fork's grace test now checks the error too.peer/test_utils.go: both mock methods (ResumeQuiescence,OnCommitOnce).go.sum: tidied.go.modtakes upstream's btcwallet pseudo-version, which thereplaceoverrides.btcwallet
lnd v0.21.8 bumps btcwallet to 245ce39ba343 for new rejection classification in
chain/, which the sweeper fixes above use.btcwallet-blake2b v0.16.20-blake2b.3predates it. This builds and passes without it, but those rejections would come back as unknown errors. paulscode/btcwallet-blake2b#1 merges the four upstream commits cleanly; after a tag, only thereplaceline here needs bumping.Tests
go build ./...andgo veton the touched packages pass.go testpasses in sweep, contractcourt, peer, lnwallet, channeldb and the root package.blake2btoday (aa875b5) without this merge.