lnd/docs/release-notes
Olaoluwa Osuntokun ac71ea7559 discovery+funding+peer+server: migrate gossip result to actor.Future[error]
In this commit, we eliminate the three buffered chan error patterns in
the discovery package and replace them with actor.Promise[error]/
actor.Future[error]. The old pattern is error-prone: if a channel is
completed more than once (e.g. when a deferred message copy is
re-enqueued and processed again), the second write to a capacity-1
channel blocks forever. actor.Promise.Complete() is idempotent via
sync.Once, so the second call is always a safe no-op regardless of
whether anyone holds a reference to the Future.

Additionally, PropagateChanPolicyUpdate previously blocked on <-errChan
after enqueuing a policy update with no quit-channel check, creating a
latent deadlock if the gossiper shut down between enqueue and send. It
now uses AwaitGossipResult with a ContextFromQuit-derived context, so
shutdown is always respected.

This is an atomic migration that updates all callers in the same
commit so each commit builds standalone. The three main pieces are:

discovery

networkMsg.err chan error becomes errPromise actor.Promise[error].
chanPolicyUpdateRequest.errChan chan error becomes errPromise.
syncTransitionReq.errChan chan error becomes errPromise. All ~65 sites
that previously wrote to the error channel now call
completeGossipResult(nMsg.errPromise, err) instead.

ProcessRemoteAnnouncement and ProcessLocalAnnouncement now return
actor.Future[error] instead of chan error. The capacity-2 buffer
comment on ProcessRemoteAnnouncement, which was itself a workaround
for the old pattern, is removed along with the TODO referencing the
actor model redesign. ProcessSyncTransition in syncer.go follows the
same pattern: the errChan select is replaced with AwaitGossipResult
using a ContextFromQuit-derived context.

funding

The SendAnnouncement function type in funding.Config changes from
returning chan error to returning actor.Future[error]. The call sites
in addToGraph and announceChannel are updated to await the future with
AwaitGossipResult, passing a context derived from f.quit via
ContextFromQuit. Shutdown signals (context.Canceled and
discovery.ErrGossiperShuttingDown) are both mapped to
ErrFundingManagerShuttingDown via the new mapGossipError helper, which
also factors out the duplicated graph-rejected / unknown-error
handling. The three mock SendAnnouncement implementations in
manager_test.go are updated accordingly.

peer+server

In peer/brontide.go, the ProcessRemoteAnnouncement call in the gossip
stream handler intentionally discards the result since remote gossip
messages are fire-and-forget from the peer's perspective. The old
comment explaining why the chan error was unsafe to use is replaced
with a note that an unawaited Future[error] carries no overhead.

In server.go (applyChannelUpdate), the previous select on errChan and
the quit channel is replaced with ContextFromQuit + AwaitGossipResult.
2026-04-10 19:16:49 -07:00
..
release-notes-0.13.1.md lntest: avoid global ServeMux 2021-08-27 11:30:01 +02:00
release-notes-0.13.2.md docs/release-notes: add item for easy AMP CLI re-use 2021-08-04 19:17:57 -07:00
release-notes-0.13.3.md docs: update release notes for 0.13.3 2021-09-30 13:44:35 -04:00
release-notes-0.14.0.md multi: Fix typos and grammar in multiple docs 2024-07-22 20:08:12 -07:00
release-notes-0.14.1.md docs/release-notes: add entry for funding API downgrade protection 2021-11-24 14:32:55 -06:00
release-notes-0.14.2.md lnwallet: increase legacy fee limit threshold to 1k sats 2022-02-03 11:54:01 -08:00
release-notes-0.14.3.md docs: add release notes 2022-03-24 14:13:06 +01:00
release-notes-0.15.0.md docs: update remote signing update hint to v0.15.3-beta [skip ci] 2022-10-11 09:42:43 +02:00
release-notes-0.15.1.md docs: update remote signing update hint to v0.15.3-beta [skip ci] 2022-10-11 09:42:43 +02:00
release-notes-0.15.2.md docs/release-notes: shift prior 0.15.2 release to 0.15.3 2022-10-09 18:39:40 -07:00
release-notes-0.15.3.md lnwallet/chancloser: properly compute initial fee of cop close txn 2022-10-10 14:50:45 -07:00
release-notes-0.15.4.md docs: add release notes for 0.15.4-beta 2022-11-01 16:39:19 +01:00
release-notes-0.15.5.md docs/release-notes: add entry for 0.15.5 2022-11-22 13:44:55 +01:00
release-notes-0.16.0.md Merge pull request #7442 from 84adam/postgres-docs-schema-84adam 2023-04-10 16:51:19 -07:00
release-notes-0.16.1.md docs: fix typos [skip ci] 2023-11-20 15:35:56 +08:00
release-notes-0.16.2.md build: update to btcwallet version with async mempool scan 2023-04-27 16:27:26 -05:00
release-notes-0.16.3.md docs/release-notes: add release notes for adamant htlc sweeps 2023-05-29 12:49:07 -07:00
release-notes-0.17.0.md contractcourt: modify the incoming contest resolver to use concurrent queue 2023-09-25 18:48:30 -05:00
release-notes-0.17.1.md release-notes: update for 0.17.1 2023-11-08 16:36:04 -05:00
release-notes-0.17.3.md Merge pull request #8232 from yyforyongyu/optimize-mempool 2023-11-30 14:47:14 -08:00
release-notes-0.17.4.md tls_manager: let REST proxy skip tls cert verification 2024-01-29 17:56:50 +02:00
release-notes-0.18.0.md cfg: move experimental options to main protocol cfg 2024-05-16 17:16:50 -05:00
release-notes-0.18.1.md docs: update release notes and add notes for 0.18.2 2024-06-26 01:44:00 +08:00
release-notes-0.18.2.md docs: update release notes 2024-07-15 15:56:33 +02:00
release-notes-0.18.3.md Merge pull request #9050 from bhandras/native-sql-invoice-fixes 2024-09-04 01:30:52 -06:00
release-notes-0.18.4.md docs: update release-notes 2024-12-19 18:58:13 +01:00
release-notes-0.18.5.md Update release-notes-0.18.5.md and release-notes-0.19.0.md 2025-02-13 10:45:38 -08:00
release-notes-0.19.0.md Update release-notes-0.19.0.md 2025-05-20 16:59:59 +02:00
release-notes-0.19.1.md Merge pull request #9876 from yyforyongyu/fix-accessman 2025-06-04 09:53:13 +02:00
release-notes-0.19.2.md docs: fix 19.2 release-notes 2025-08-06 09:37:09 +02:00
release-notes-0.19.3.md Merge pull request #10141 from ziggie1984/fix-stuck-payment 2025-08-11 19:44:12 +08:00
release-notes-0.20.0.md docs: move release notes from 0.20.0 to 0.21.0 2025-11-13 12:54:25 -03:00
release-notes-0.20.1.md docs: add missing v0.20.1 release notes from release branch 2026-03-17 15:16:47 -07:00
release-notes-0.21.0.md discovery+funding+peer+server: migrate gossip result to actor.Future[error] 2026-04-10 19:16:49 -07:00
release-notes-template.md docs: add release notes template 2025-05-26 19:41:25 +08:00