Commit Graph
1172 Commits
Author SHA1 Message Date
Elle 8126b424fd Merge pull request #10610 from ellemouton/graph-cleanup-todo-contexts
graph/db+refactor: surface all `context.TODO()`s
2026-02-26 16:18:31 +02:00
Elle Mouton 397330cbdb graphdb: pass context to ChannelID 2026-02-25 16:11:29 +02:00
Elle Mouton 1d4c6aadb4 graph/db: thread context through FetchChannelEdgesByOutpoint 2026-02-25 16:11:29 +02:00
Elle Mouton 6bbb9a32fc graph/db: thread context through FetchChannelEdgesByID 2026-02-25 16:11:25 +02:00
Elle Mouton acdef84d30 graph/db: thread context through DeleteChannelEdges 2026-02-25 15:33:59 +02:00
Elle Mouton 37cc6b29d9 graph/db: thread context through NumZombies 2026-02-25 15:33:34 +02:00
ziggie d8d5d3f990 multi: thread context through SendPayment 2026-02-25 08:02:25 +01:00
ziggie 8038dc0054 multi: thread context through payment lifecyle functions 2026-02-25 08:02:25 +01:00
ziggie 563a2ac9d3 multi: thread context through DeletePayments 2026-02-25 08:02:19 +01:00
ziggie bc15d4bb50 multi: thread context through DeletePayment 2026-02-25 08:02:19 +01:00
bitromortac 10e8a69cec lnd: handle channel update events in SubscribeChannelEvents 2026-02-20 10:47:04 +01:00
Elle Mouton 0cfb9c9d2c graph/db: add gossip version parameter to ForEachChannel
Update ForEachChannel to accept a gossip version parameter, allowing
callers to specify which gossip version's channels should be iterated.
This change prepares the graph database for supporting multiple gossip
versions while maintaining backward compatibility.

The KVStore implementation validates that only GossipVersion1 is
requested, returning ErrVersionNotSupportedForKVDB for other versions.
The SQLStore implementation validates known versions and passes the
version through to the underlying paginated query.

Update VersionedGraph to include a ForEachChannel method that
automatically uses its configured gossip version, and update the
DescribeGraph RPC handler to use the v1Graph instead of the global
graphDB.
2026-02-13 07:21:24 +02:00
Elle Mouton b3cf9a806f multi: add DeleteChannelEdges to VersionedGraph
Add version-aware DeleteChannelEdges method to VersionedGraph and
update call sites in graph builder, rpcserver, and server to use
versioned graphs. This ensures channel deletion operations are
properly scoped to the correct gossip version.
2026-02-13 07:21:23 +02:00
Elle Mouton 7a260ee103 multi: update models.ChannelAuthProof with v2 field
Also update it to more closely match the persisted version which has the
v1 and v2 only fields as optional.

Refactor ChannelAuthProof to support both v1 and v2 channel
announcements:

- Add Version field to distinguish v1 from v2 proofs
- Wrap v1-specific fields (NodeSig1/2, BitcoinSig1/2) in fn.Option
  since v2 doesn't use them
- Add optional Signature field for v2's single schnorr signature
- Add constructor functions NewV1ChannelAuthProof and
  NewV2ChannelAuthProof to enforce correct initialization
- Add getter methods (NodeSig1(), BitcoinSig1(), etc.) that safely
  unwrap options, returning empty slices when not present

The IsEmpty() check is updated to handle both versions correctly.
Both stores validate v1-only for now.
2026-02-13 07:21:22 +02:00
Elle Mouton 7bb38651d9 graph/db: convert other node CRUD methods
Convert a few more CRUD methods to handle v2 nodes. Then update some
more tests to be run against both v1 and v2 nodes.
2026-02-13 07:21:21 +02:00
Elle Mouton 4db5198079 graph/db: introduce VersionedGraph
For now, all instances will use V1 only so as not to change behaviour
yet.
2026-02-13 07:21:21 +02:00
Elle Mouton 97143a74ab graph/db: split HasNode into two methods
HasNode currently is very v1 specific since it returns a time.Time
timestamp which is specific to V1 node announcements. However, it is
mostly only used for the "exists" return value. So here we split it up
into HasNode which just checks existence and HasV1Node which retains the
same behavaiour as before.
2026-02-13 07:21:20 +02:00
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
Olaoluwa Osuntokun 931b54e848 peer+rpcserver: use new conf scaling for notifications 2026-01-15 16:22:26 -08:00
Yash Bhutwala 0764f27b6f rpcserver: use protocol max for fundMax, not maxChanSize
The maxChanSize config option is documented to only apply to incoming
channel requests. However, when using fundMax with OpenChannel, the code
was incorrectly using maxChanSize as the upper bound for the outgoing
channel size.

This commit fixes the issue by using the protocol-level maximum
(MaxBtcFundingAmount or MaxBtcFundingAmountWumbo depending on wumbo
support) as the upper bound for fundMax operations.

Fixes #10468.
2026-01-13 10:54:55 -05:00
András Bánki-Horváth 72ab4d234a Merge pull request #10289 from GeorgeTsagk/move-aux-closer
Aux Closer: Move coop-close aux finalization to chain watcher
2026-01-13 15:31:34 +01:00
Slyghtning 280929ba1e rpcserver: return inputs in EstimateFeeResponse 2026-01-07 10:25:29 +01:00
elnosh 6f49bea52b server: remove accountability signal experiment period
In the previous iteration with endorsement
signaling, the recommendation was for the sender to
set it to 1 and that could have had privacy concerns
when first deploying given that the default was to
downgrade the signal to 0. In the latest proposal
the recommended default for both sending and
forwarding nodes is to set `accountable` to 0.
As a result, the dates have been removed given
that there are no privacy risks associated
with relaying the signal with zero values.
2026-01-06 09:12:34 -05:00
elnosh 34329c684e multi: rename experimental endorsement signal to accountable
Renames the endorsement signal to accountable to
match the latest proposal https://github.com/lightning/blips/pull/67
2026-01-06 09:12:31 -05:00
George Tsagkarelis e12008517e lnwallet+peer: extract close types to separate pkg
The aux close types will soon be used by a different package that would
otherwise cause an import cycle if used directly from
lnwallet/chancloser. We now create a new sub-package lnwallet/types that
will be improrted from all users of these types.
2025-12-04 12:16:54 +01:00
ziggie 48da56b285 routerrpc: add HasNode backend function for LSP heuristic
This commit adds the HasNode function to the RouterBackend struct,
which checks if a node exists in the graph (i.e., has public channels).
This function is needed by the LSP detection heuristic to determine
if a node is publicly reachable.

The function is wired up in rpcserver.go to query the graph database.
2025-11-29 01:04:28 +01:00
Elle Mouton 80e70096cb multi: add models.Node V1 constructor
Add a version field to models.Node and a V1 constructor for it.
2025-11-12 22:54:05 +08:00
Gijs van Dam c37b18cf82 chore: thread context through to SendCustomMessage
The only way to unblock SendCustomMessage is if the peer activates,
disconnects or the server shuts down. This means that if the context is
cancelled, we will still wait until one of those other events happen.

With this commit we thread the context through to SendCustomMessage, so
that if the context is cancelled, we can return early. This improves the
cancellation semantics.
2025-11-12 22:54:04 +08:00
Gijs van Dam 07dc74e198 multi: endpoints for onion messages
This commit creates the necessary endpoints for onion messages.
Specifically, it adds the following:

- `SendOnionMessage` endpoint to send onion messages.
- `SubscribeOnionMessages` endpoint to subscribe to incoming onion
  messages.

It uses the `msgmux` package to handle the onion messages.
2025-11-12 22:54:04 +08:00
yyforyongyu 2d59976e16 rpcserver+itest: skip err from FlapCount
We need to make sure the `ListPeers` to be robust against errors from
the `FlapCount` so this RPC won't fail due to no flap count info. Also
updated the itest to check this field.
2025-09-18 22:29:40 +08:00
yyforyongyu 22fddd626b lntest+rpcserver: ignore chanfitness.ErrPeerNotFound in rpc
Similar to how we handle `chanfitness.ErrChannelNotFound`, we now also
ignore the `ErrPeerNotFound`. This is needed as previously we will
always see the peer in the channel event store given it'd added when
connected. This is no longer the case as we only add the peer to the map
when the channel is added.
2025-09-18 22:24:45 +08:00
Elle Mouton a5cf958c2c autopilot: fix nil map assignment
Use the `clear` call to reset a map on `reset` instead of assigning nil
to the entry.
2025-09-18 07:37:53 +02:00
Yong 5082566ed7 Merge pull request #9677 from NishantBansal2003/conf-count
Expose confirmation count for pending 'channel open' transactions
2025-09-11 22:36:05 +08:00
Nishant Bansal 5fd42ac61d lnrpc+rpcserver: add ConfirmationsUntilActive and ConfirmationHeight
Introduce ConfirmationsUntilActive and ConfirmationHeight in
PendingChannelsResponse_PendingChannel. ConfirmationsUntilActive indicates
the remaining confirmations needed for the channel to become active. If the
funding transaction is unconfirmed, ConfirmationsUntilActive defaults to the
total required confirmations (NumConfsRequired). ConfirmationHeight records
the block height at which the funding transaction was first confirmed; if
unconfirmed, it will be 0.

Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
2025-09-11 18:27:14 +05:30
Yong d1d3a82010 Merge pull request #9884 from ellemouton/relaxFeatureBitCheck
multi: use relaxed feature bit `Set` method for peer features
2025-09-10 17:22:16 +08:00
Yong 6c9e0f348c Merge pull request #10196 from ziggie1984/refactor-payment-part-6
refactor payments part 6
2025-09-08 15:40:36 +08:00
Olaoluwa Osuntokun f77cd51671 autopilot+funding+rpc+invoices: complete migration to lazy debug logging
In this commit, we complete the migration to lnutils.SpewLogClosure for
the remaining application-layer components. This includes the autopilot
channel management system, the funding manager, the RPC server, and the
invoice storage subsystem.
2025-09-05 18:20:52 -07:00
ziggie 335a9b3f40 lnd: reduce max limit when querying for payments 2025-09-05 09:54:00 +02:00
Elle Mouton 330f697937 graph: rename HasLightningNode
to HasNode
2025-09-03 10:14:35 +02:00
Elle Mouton cd3bd05810 multi: rename FetchLightningNode
to FetchNode
2025-09-03 10:14:35 +02:00
Elle Mouton c663a557c4 multi: rename models.LightningNode to models.Node 2025-09-03 10:14:35 +02:00
Boris Nagaev 612ad7da27 multi: fix non-constant input of fmt.Errorf
Fixed multiple cases in which a non-constact string variable was used as a
format string for fmt.Errorf.
2025-08-30 14:13:44 -03:00
ziggie 9f824fe1ee multi: introduce interface for payment database 2025-08-20 09:07:48 +02:00
ziggie d77b2f9c26 mulit: move payment query code to separate file
We also rename the struct since it is now in its own package
there is no need to prefix it.
2025-08-14 19:53:18 +02:00
ziggie 03af9858d2 multi: move payment related code into own package
This commit moves most of the code into its own package. It is
the smallest code move possible without moving import cycles and
keeping the changes to the code base as small as possible during
refactor.
2025-08-14 19:53:15 +02:00
ziggie db2c50a599 channeldb: add context to query method
We add a context for the query method because the query method
is part of the paymentDB interface and for the SQL case
we will need the context for this method because the native
SQL drivers demand one. So we add it for the kv implementation
here as well so we can then make use of the new interface type.
2025-08-11 16:44:13 +02:00
Elle Mouton 8aa8c7cc42 multi: remove the NodeRTx interface type 2025-08-06 09:56:21 +02:00
Elle Mouton 5727bfa688 graph/db: let ForEachNodeCached maybe fetch node addresses
Here we adjust the ForEachNodeCached graph DB method to pass in a node's
addresses into the provided call-back if requested. This will allow us
to improve the performance of node/channel iteration in the autopilot
subserver.
2025-08-06 09:50:54 +02:00
ziggie 0aef5fa44c multi: unify all payment related kv data
All interactions related to the payment db are now part of the
kvPaymentDB struct.
2025-08-02 13:24:27 +02:00
MPins 3a7df1d7c8 rpcserver+invoices: add support for deleting canceled invoice
Adds server-side RPC functionality to delete canceled invoice,
support deleting specific canceled invoice from the database.
2025-07-25 21:21:51 -03:00