Commit Graph
20107 Commits
Author SHA1 Message Date
Slyghtning d39577682e rpcserver: populate wallet_synced in GetInfo response
In this commit, we extend the chainSyncInfo struct with a new
isWalletSynced field that tracks the wallet's sync state independently
from the composite isSynced field. The GetInfo RPC handler now populates
the WalletSynced response field from this new struct field.

A debug log line is added to GetInfo to help diagnose sync state issues,
showing both the composite sync status and the wallet-specific sync
status.

Currently isWalletSynced mirrors isSynced since both ultimately derive
from the same underlying wallet sync check. This prepares the plumbing
for future differentiation where wallet sync state could be tracked
separately from router and blockbeat dispatcher states.
2026-02-05 08:58:31 +01:00
Slyghtning 3c22c3e7fa lnrpc: add wallet_synced field to GetInfoResponse
In this commit, we add a new `wallet_synced` boolean field to the
GetInfoResponse message. This field exposes the wallet's internal sync
state with the backing chain source, providing visibility into whether
the wallet has caught up to the current chain tip.

This is distinct from the existing `synced_to_chain` field, which
represents a composite sync state that also considers the router and
blockbeat dispatcher. The new field allows callers to distinguish
between wallet sync delays and other subsystem sync states.
2026-02-05 08:45:53 +01:00
Olaoluwa Osuntokun 44c6cc5a1c Merge pull request #10530 from NishantBansal2003/gossip-race
discovery: fix race on remoteUpdateHorizon in GossipSyncer
2026-02-04 17:48:58 -08:00
Nishant Bansal caa24791be discovery: fix race on remoteUpdateHorizon in GossipSyncer
Guard access to remoteUpdateHorizon to prevent a race when
the gossiper is flushing a pending batch of announcements
while concurrently processing a GossipTimestampRange message
from a peer.

Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
2026-02-05 00:57:55 +05:30
Olaoluwa Osuntokun 5c7d3ad045 Merge pull request #10540 from morehouse/gossiper_shutdown_deadlock
discovery: fix gossiper shutdown deadlock
2026-02-04 10:32:15 -08:00
Yong eaa7bcf67a Merge pull request #10547 from gijswijs/fix-linter-for-worktrees
Fix linter in git worktrees
2026-02-04 20:26:06 +08:00
Olaoluwa Osuntokun 4d775457c5 Merge pull request #10550 from Roasbeef/fix-claude-again
ci: add tool constraints to pr-severity prompt
2026-02-03 21:45:46 -04:00
Yong 89b54abbc6 Merge pull request #10544 from ellemouton/updateBWCompatBaseVersion
scripts: update bw-compat test LND base version
2026-02-04 03:30:11 +08:00
Gijs van Dam 2643988524 make: fix linter in git worktrees
When running `make lint` in a git worktree, the diff processor fails
with "no version control repository found" because the Docker container
only mounts the worktree directory, not the main git directory that the
worktree's .git file references.

This causes golangci-lint's `new-from-rev` filter to not work, resulting
in all ~32k existing lint issues being reported instead of only newly
introduced ones.

Fix by detecting when we're in a worktree (.git is a file, not a
directory) and mounting the main .git directory into the container so
revgrep can access the git history.
2026-02-03 19:45:56 +01:00
Olaoluwa Osuntokun 7b93441814 ci: add tool constraints to pr-severity prompt
Claude keeps trying to use `gh api` to add severity labels, which gets
denied by the allowed tools restriction. Instead of retrying with the
permitted `gh pr edit --add-label` command, it silently gives up and
only posts the comment. The result is that severity comments appear on
PRs but the actual labels are never applied.

Add an explicit tool constraints section at the top of the prompt so
Claude knows upfront that only `gh pr view`, `gh pr edit`, and
`gh pr comment` are available.
2026-02-03 10:22:56 -08:00
Olaoluwa Osuntokun d332cb0761 Merge pull request #10529 from Roasbeef/fix-edge-features-decode-compat
graphdb: fix backwards-compat for channel edge feature deserialization
2026-02-03 13:12:26 -04:00
Olaoluwa Osuntokun 56a7f45b99 graphdb: fix backwards-compat for channel edge feature deserialization
This commit fixes a backwards compatibility issue that prevented nodes
from upgrading from v0.19.x to v0.20.x.

In v0.19.x, channel edge features were serialized as raw feature bytes
without a length prefix. In v0.20.x (commit 2f2845dfc), the serialization
changed to use Features.Encode() which adds a 2-byte big-endian length
prefix before the feature bits. The deserialization code was updated to
use Features.Decode() which expects this length prefix.

When v0.20.x reads a database created by v0.19.x, Decode() tries to read
a length prefix that doesn't exist, causing an EOF error:

    unable to decode features: EOF

The fix adds a deserializeChanEdgeFeatures() helper that detects which
format is being read and decodes accordingly:

- New format (v0.20+): First 2 bytes encode the length of the remaining
  bytes. Detected when uint16(bytes[0:2]) == len(bytes)-2.

- Legacy format (pre-v0.20): Raw feature bits without length prefix.
  Uses DecodeBase256 with the known length.

The format detection is safe because in the legacy format, the first byte
always has at least one bit set (the serialization uses minimum bytes),
so the first two bytes can never encode a value equal to len-2.

Fixes #10528.
2026-02-03 09:12:04 -08:00
Matt Morehouse 5fa025e9e7 docs: add release note 2026-02-03 09:15:34 -06:00
Matt Morehouse 21588acb3d discovery: fix gossiper shutdown deadlock
When processing a remote network announcement, it is possible for two
error messages to be sent back on the errChan.  Since Brontide doesn't
actually read from errChan, and since errChan only buffered one error
message, the sending goroutine would deadlock forever.  This would only
become apparent when the gossiper attempted to shut down and got hung
up.

For now, we can fix this simply by buffering up to two error messages on
errChan.  There is an existing TODO to restructure this logic entirely
to use the actor model, and we can do a more thorough fix as part of
that work.

This bug was discovered while doing full node fuzz testing and was
triggered by sending a specific channel_announcement message and then
shutting down LND.
2026-02-03 09:14:56 -06:00
Elle Mouton df0bd94b91 scripts: update bw-compat test LND base version
Update the backwards compat test to use lnd v0.20.0-beta as the base
version.
2026-02-03 17:06:24 +02:00
Yong 06b175a140 Merge pull request #10463 from hieblmi/fix-trickle
discovery: default trickledelay to 1 if less is set
2026-02-03 18:42:30 +08:00
Slyghtning 22feff6dbb docs: update release notes for gossip trickle delay validation 2026-02-02 20:48:01 +01:00
Slyghtning 4ef2019dd9 config: default TrickleDelay to 1ms if non-positive 2026-02-02 20:47:59 +01:00
Slyghtning dd29d5690f sqldb: close test db in cleanup 2026-02-02 18:51:39 +01:00
ziggieXXX 20a6b1726f Merge pull request #10532 from darioAnongba/fix/ignored-local-mark-coop
peer: fix MarkCoopBroadcasted to correctly use local parameter
2026-02-02 12:36:06 -05:00
Dario Anongba Varela 6e56c9a538 peer: fix MarkCoopBroadcasted to correctly use local parameter 2026-02-02 12:16:29 +01:00
Olaoluwa Osuntokun 7ccab028f0 Merge pull request #10531 from Roasbeef/claude-fix
workflows: fix Claude workflows for fork PRs and external contributors
2026-01-29 16:41:18 -04:00
Olaoluwa Osuntokun a77b9d9b89 workflows/pr-severity: allow non-write users for classification
The PR severity classifier was failing for external contributors because
the claude-code-action checks that the actor has write permissions. Since
this workflow only reads PR metadata via the API and doesn't execute any
code from the PR (and has restricted tool permissions), it's safe to allow
any user to trigger classification.
2026-01-29 15:57:18 -04:00
Olaoluwa Osuntokun bcb589cc9e workflows/claude: fix PR checkout for fork PRs
When a PR originates from a fork, the PR branch doesn't exist in the
origin remote. This adds a step that uses `gh pr checkout` before
running the Claude action, which properly handles fork PRs by adding
the fork as a remote and fetching the branch from there.
2026-01-29 13:30:41 -04:00
Olaoluwa Osuntokun 19b2ad7979 Merge pull request #10527 from Roasbeef/fix-pr-severity-fork-prs
workflows/pr-severity: use pull_request_target for fork PRs
2026-01-28 15:53:19 -04:00
Olaoluwa Osuntokun 4d98b004ac workflows/pr-severity: use pull_request_target for fork PRs
Switch from pull_request to pull_request_target to allow the workflow
to run on PRs from forks. The pull_request trigger runs in the fork's
context which cannot access repository secrets.

This is safe because the workflow only reads PR metadata via the GitHub
API (changed files, labels) and doesn't checkout or execute any code
from the PR itself.
2026-01-28 15:18:19 -04:00
Olaoluwa Osuntokun 22c2cc21e8 Merge pull request #10526 from lightningnetwork/pr-severity-workflow
build: add PR severity classification workflow
2026-01-28 14:58:33 -04:00
Olaoluwa Osuntokun ba52a27860 build: add PR severity classification workflow
Add a GitHub Actions workflow that uses Claude Code to automatically
classify PRs by severity based on the files changed. This helps
reviewers prioritize and understand PR complexity at a glance.

The workflow:
- Triggers on PR open and synchronize events
- Uses Claude Code to analyze changed files against severity mapping
- Applies one of four severity labels (critical/high/medium/low)
- Posts a detailed comment explaining the classification
- Supports manual override via severity-override-* labels

Severity mapping:
- CRITICAL: lnwallet, htlcswitch, contractcourt, peer, keychain, input,
  channeldb, funding, lnwire, server.go, rpcserver.go
- HIGH: routing, invoices, sweep, discovery, graph, watchtower, feature,
  lnrpc, macaroons, chainntnfs, etc.
- MEDIUM: payments, autopilot, lncfg, kvdb, proto files, etc.
- LOW: docs, tests, scripts, CI/CD config
2026-01-28 14:33:15 -04:00
Olaoluwa Osuntokun 349b3dbb43 Merge pull request #10525 from lightningnetwork/add-claude-github-actions-1769542743473
build: add cc integration
2026-01-27 15:40:14 -04:00
Olaoluwa Osuntokun c000478121 "Claude PR Assistant workflow" 2026-01-27 15:39:04 -04:00
Yong 676386ce52 Merge pull request #10520 from darioAnongba/fix/routerrpc-failuredetail-additions
routerrpc: FailureDetail enums for invoice/AMP validation failures
2026-01-23 09:58:22 +08:00
Dario Anongba Varela 05eed5cdb4 routerrpc: FailureDetail enums for invoice/AMP validation failures 2026-01-22 15:30:19 -05:00
ziggieXXX 8646d98469 Merge pull request #10514 from ziggie1984/reduce-log-noice
Reduce graphDB log noise
2026-01-22 04:13:24 +01:00
ziggie c78a75f5d8 graphdb: reduce log noise from WRN to DBG 2026-01-21 20:25:08 +01:00
Olaoluwa Osuntokun aaaf235b2a Merge pull request #10331 from Roasbeef/cnct-reorg-v2
multi: update close logic to handle re-orgs of depth n-1, where n is num confs - add min conf floor
2026-01-16 14:48:30 -08:00
Olaoluwa Osuntokun 3fb59b1b6b multi: increase min cltv delta to 24 2026-01-16 13:06:30 -08:00
Olaoluwa Osuntokun 4bce4ebe03 routing: increase MinCLTVDelta from 18 to 24 blocks
This increases the minimum CLTV delta allowed for invoice creation to
provide more headroom above DefaultFinalCltvRejectDelta (19 blocks).
The previous value of 18 was below the reject threshold, which could
allow users to create invoices with CLTV deltas that would be rejected
when receiving payments.
2026-01-15 16:22:26 -08:00
Olaoluwa Osuntokun 4aef4d00ac docs/release-notes: add release notes entry 2026-01-15 16:22:26 -08:00
Olaoluwa Osuntokun fa8ba6f81c lncfg: increase DefaultIncomingBroadcastDelta to 16
With this change, we'll go to chain even earlier to ensure that we have
enough time to sweep a potentially contested HTLC, now that we're
waiting longer before sweeps to ensure that the commitment transaction
is sufficeitnyl burried before we sweep.
2026-01-15 16:22:26 -08:00
Olaoluwa Osuntokun ab4f89128f contractcourt: unify+simplify new re-org aware logic 2026-01-15 16:22:26 -08:00
Olaoluwa Osuntokun ebefe63f8e contractcourt: add sync dispatch fast-path for single confirmation closes
In this commit, we add a fast-path optimization to the chain watcher's
closeObserver that immediately dispatches close events when only a single
confirmation is required (numConfs == 1). This addresses a timing issue
with integration tests that were designed around the old synchronous
blockbeat behavior, where close events were dispatched immediately upon
spend detection.

The recent async confirmation architecture (introduced in commit f6f716ab7)
properly handles reorgs by waiting for N confirmations before dispatching
close events. However, this created a race condition in integration tests
that mine blocks synchronously and expect immediate close notifications.
With the build tag setting numConfs to 1 for itests, the async confirmation
notification could arrive after the test already started waiting for the
close event, causing timeouts.

We introduce a new handleSpendDispatch method that checks if numConfs == 1
and, if so, immediately calls handleCommitSpend to dispatch the close event
synchronously, then returns true to skip the async state machine. This
preserves the old behavior for integration tests while maintaining the full
async reorg protection for production (where numConfs >= 3).

The implementation adds the fast-path check in both spend detection paths
(blockbeat and spend notification) to ensure consistent behavior regardless
of which detects the spend first. We also update the affected unit tests to
remove their expectation of confirmation registration, since the fast-path
bypasses that step entirely.

This approach optimizes for the integration test scenario without compromising
production safety, as the fast-path only activates when a single confirmation
is sufficient - a configuration that only exists in the controlled test
environment.
2026-01-15 16:22:26 -08:00
Olaoluwa Osuntokun bb781bbe84 itest: add new coop close rbf itest
This ensures that during the RBF process, if one confirms, a re-org
occurs, then another confirms, that we'll properly detect this case.
2026-01-15 16:22:26 -08:00
Olaoluwa Osuntokun 8f5656e6e2 contractcourt: add generic close re-org tests
In this commit, we add a set of generic close re-org tests. The most
important test is the property based test, they will randomly confirm
transactions, generate a re-org, then assert that eventually we dtect
the final version.
2026-01-15 16:22:26 -08:00
Olaoluwa Osuntokun b6b4cefd08 contractcourt: add unit tests for rbf re-org cases
This set of new tests ensures that if have created N RBF variants of the
coop close transaction, that any of then can confirm, and be re-org'd,
with us detecting the final spend once it confirms deeploy enough.
2026-01-15 16:22:26 -08:00
Olaoluwa Osuntokun e0f7b0a033 contractcourt: update existing chain watcher tests due to new logic
All the tests need to send a confirmation _after_ the spend is detected
now.
2026-01-15 16:22:26 -08:00
Olaoluwa Osuntokun ce779a9707 contractcourt: add new chainWatcherTestHarness
We'll use this for all the upcoming tests.
2026-01-15 16:22:26 -08:00
Olaoluwa Osuntokun 0f59756b40 lntest: add new wait for conf helper method to ChainNotifier 2026-01-15 16:22:26 -08:00
Olaoluwa Osuntokun 12668b8af6 contractcourt: update close logic to handle re-orgs of depth n-1, where n is num confs
In this commit, we update the close logic to handle re-ogs up to the
final amount of confirmations. This is done generically, so we're able
to handle events such as: coop close confirm, re-org, breach confirm,
re-org, force close confirm, re-org, etc.

The upcoming set of new tests will exercise all of these cases.

We modify the block beat handling to unify the control flow. As it's
possible we get the beat, then see the spend, or the oher way around.
2026-01-15 16:22:26 -08:00
Olaoluwa Osuntokun 6553b61aa4 peer: send out a notification after the 1st conf, then wait for the rest
We wnt to add better handling, but not break any UIs or wallets. So
we'll continue to send out a notification after a single confirmation,
then send another after things are fully confirmed.
2026-01-15 16:22:26 -08:00
Olaoluwa Osuntokun c0f48d23b4 multi: add new ChannelCloseConfs param, thread thru as needed
In this commit, we add a new param that'll allow us to scale up the
number of confirmations before we act on a new close. We'll use this
later to improve the current on chain handling logic.
2026-01-15 16:22:26 -08:00