Commit Graph

19829 Commits

Author SHA1 Message Date
Nishant Bansal
ede08a8883 funding: persist ConfirmationHeight upon first funding confirmation
This change ensures that a channel's ConfirmationHeight is recorded in the
database once its funding transaction receives its initial confirmation.
By doing so, we establish a reliable reference point to monitor the
channel's progress toward the required confirmation depth.

Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
2025-09-11 18:26:42 +05:30
Nishant Bansal
222f49c593 channeldb: add MarkConfirmationHeight to OpenChannel
Add the MarkConfirmationHeight method to the OpenChannel struct
to record the block height at which the funding transaction was
first confirmed. Also, introduce the ConfirmationHeight field
to persist this information in the database.

Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
2025-09-11 18:26:16 +05:30
Nishant Bansal
7bc6331402 chainntnfs: notify BlockHeight in Updates event
Enhance the ConfirmationEvent's Updates channel by including the
BlockHeight alongside NumConfsLeft.

Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
2025-09-11 18:25:49 +05:30
Nishant Bansal
aa9c3272e3 chainntnfs: signal reorg notification before required confirmations
In this commit, we send the reorg notification even when the
transaction has not yet reached the required confirmations, in
case the caller is interested in knowing about it.

Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
2025-09-11 18:24:54 +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
67880c557e Merge pull request #10149 from Roasbeef/estimate-route-fee-docs
docs: add docs for `EstimateRouteFee`
2025-09-10 13:26:00 +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
ziggie
f540e9c8ec paymentsdb: add helper method to set session key
This is only used for testing because we have now a unique
contraint on the session key and need to swap it in tests for
the sql backend.
pick f17baec94 paymentsdb: fix linter
2025-09-08 08:23:58 +02:00
Olaoluwa Osuntokun
221c3e8240 Merge pull request #10188 from Roasbeef/logclosure-errwhere
multi: attempt to more uniformly use SpewLogClosure across project
2025-09-07 21:09:55 -07:00
Olaoluwa Osuntokun
63a6ae502a docs: add docs for EstimateRouteFee 2025-09-05 18:32:50 -07: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
Olaoluwa Osuntokun
2cc4079a0e routing+htlcswitch+discovery+peer+netann: optimize debug logging with lazy evaluation
In this commit, we update the network and routing layer components to use
lnutils.SpewLogClosure for debug logging.
2025-09-05 18:20:51 -07:00
Olaoluwa Osuntokun
77f2d8a572 contractcourt+sweep+watchtower: use lnutils.SpewLogClosure for debug logging
In this commit, we update the contractcourt, sweep, and watchtower
packages to use lnutils.SpewLogClosure instead of directly calling
spew.Sdump in logging statements.
2025-09-05 18:20:51 -07:00
Olaoluwa Osuntokun
6e21bc5764 lnwallet: replace spew.Sdump with lnutils.SpewLogClosure for lazy evaluation
In this commit, we replace all instances of spew.Sdump in the lnwallet
package and its subpackages with lnutils.SpewLogClosure. This change
ensures that expensive debug dump operations are only performed when the
log level actually requires them.
2025-09-05 18:20:49 -07:00
Yong
c02e94e767 Merge pull request #10187 from Roasbeef/skip-labels-green-check
build: make special label checks auto-pass instead of skip
2025-09-06 04:36:48 +08:00
ziggie
335a9b3f40 lnd: reduce max limit when querying for payments 2025-09-05 09:54:00 +02:00
ziggie
a9c30dacb5 sqldb: add helper for type boolean 2025-09-05 09:53:59 +02:00
ziggie
2d032044f9 sqldb: Make sure we do not replace keywords if they have a prefix
We don't for example want to replace CURRENT_TIMESTAMP when using
it in our tables.
2025-09-05 09:52:41 +02:00
ziggie
e20a34de46 paymentsdb: refactor attempt verification 2025-09-05 09:52:41 +02:00
ziggie
0320dfcc89 paymentsdb: add compile time check for the kv db implementation 2025-09-05 09:52:40 +02:00
ziggie
3d4ee8b874 paymentsdb: rename defaultKVStoreOptions func
We rename the modifier to use the same naming as used in the
graphDB to align the codebase.
2025-09-05 09:52:40 +02:00
Elle
9d74ec4770 Merge pull request #10163 from ellemouton/graphMigFlipSwitch
multi: switch on graph SQL migration
2025-09-05 06:54:30 +02:00
Yong
ab924be037 Merge pull request #10197 from bhandras/wallet-create-warning
commands: add extra warning on wallet creation
2025-09-05 08:08:03 +08:00
Elle Mouton
318f4aa863 docs: add release note entry 2025-09-04 18:52:00 +02:00
Elle Mouton
9ce14371e1 multi: switch on graph SQL migration
In this commit, the graph SQL migration is added to the production
build.
2025-09-04 18:52:00 +02:00
Elle
3751d7a6b6 Merge pull request #10199 from ellemouton/fixBuild
graph/db: fix type name
2025-09-04 18:50:12 +02:00
Elle Mouton
f2fa0a4da6 graph/db: fix type name 2025-09-04 17:10:44 +02:00
Yong
e46c676894 Merge pull request #10162 from ellemouton/graphMigUnwrapDNSAddrs
graph/db: unwrap dns addresses from opaque ones during migration
2025-09-04 22:29:49 +08:00
Andras Banki-Horvath
ac18094a09 commands: add extra warning on wallet creation 2025-09-04 15:21:28 +02:00
Elle
d9647f8b79 Merge pull request #10193 from ellemouton/fixSQLStrHelper
sqldb: fix SQLStr helper
2025-09-04 12:07:25 +02:00
Yong
d08afa3ea6 Merge pull request #10185 from ellemouton/renameLightningNode
multi: Rename LightningNode to Node
2025-09-04 10:01:10 +08:00
Olaoluwa Osuntokun
33406bc6f8 build: make special label checks auto-pass instead of skip
In this commit, we revamp the way our skip-labels worked to instead mark
certain stages as green, instead of skipping them. Skipped changes
didn't count towards the set of required checks, which slowed down PR
velocity.

Previously, when PRs were labeled with 'no-itest' or 'no-changelog',
the corresponding CI jobs would be completely skipped. This caused the
GitHub checks to show as skipped rather than successful, which could
be confusing and prevented certain merge rules from working properly.

This commit changes the behavior so that these jobs still run but
immediately report success when the special labels are detected. Each
affected job now starts with a label check step that sets a skip
flag, and all subsequent steps are conditionally executed based on
this flag. When skipped, the jobs add a notice to the GitHub step
summary explaining that tests were auto-passed due to the label.

The change affects five jobs: basic-integration-test, integration-test,
windows-integration-test, macos-integration-test, and milestone-check.
2025-09-03 16:09:31 -07:00
Elle Mouton
40b279687f sqldb: add SQLStrValid helper
The SQL* helpers are meant to always set the `Valid` field of the
sql.Null* type to true. Otherwise they cannot be used to set a valid,
empty field. However, we dont want to break the behaviour of the
existing SQLStr helper and so this commit adds a new helper with the
desired functionality.
2025-09-03 15:46:11 +02:00
Elle Mouton
6e98b336f6 graph/db+channeldb: rename test helper 2025-09-03 10:14:35 +02:00
Elle Mouton
330f697937 graph: rename HasLightningNode
to HasNode
2025-09-03 10:14:35 +02:00
Elle Mouton
7a1b548e07 graph/db: rename DeleteLightningNode
to DeleteNode
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
060219780b multi: rename AddLightningNode methods
to AddNode
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
Elle Mouton
a74f0b133a graph/db: expand test comment with build tag info 2025-09-03 10:11:49 +02:00
Elle Mouton
af380c9eb1 graph/db: extract DNS addresses during SQL migration
In this commit, we take advantage of the graph SQL migration and use it
to also extract DNS addresses from the opaque address type. We use
opaque addresses to store addresses that we dont understand yet. We
recently added logic for DNS addresses and so we may have persisted node
announcements that have DNS addresses but we would currently have them
stored under the opaque address type. So we use this migration to see if
we can extract such addresses.

A few decisions were made here:
1) If multiple DNS addressees are extracted, this is ok and we continue
   to migrate the node even though this is actually invalid at a
   protocol level. We will currently check (at a higher level) that a node
   announcement only has 1 DNS address in it before we broadcast it though.
2) If an invalid DNS address is encountered (so we hit the DNS type
   descriptor but then the rest of the DNS address payload is invalid
   and cannot be parsed into the expected hostname:port, then we skip
   migrating the node completely.
2025-09-03 09:13:42 +02:00
Elle Mouton
d61a8af4c4 lnwire: re-usable address descriptor parsers
In this commit, the logic in ReadElements that is used to read a single
address descriptor from a io.Reader is separated out into a new function
so that the logic can be re-used elsewhere.
2025-09-03 08:32:37 +02:00
Elle
ea6cc8154f Merge pull request #9455 from mohamedawnallah/supportDNSHostnameInNodeAnnouncement
[1/2] discovery+lnwire: add support for DNS host name in NodeAnnouncement msg
2025-09-03 08:13:55 +02:00
Mohamed Awnallah
ad966157fc docs: add release note 2025-09-03 01:11:35 +00:00
Elle Mouton
6ef80db746 graph/db+chanbackup: dns add encoding/decoding for persistence 2025-09-03 01:11:35 +00:00
Elle Mouton
4bd2bbca27 graph/db: update test opaque addr to be valid
The first byte of an opaque addr must be one that we dont understand
yet. We do this update in preparation for doing an on-the-fly parse of
persisted opaque addrs to see if they contain addrs that we now support.
For this to work, the first byte cant be 0x01 since this maps to a known
address.
2025-09-03 01:11:35 +00:00
Elle Mouton
70b5016bc8 discovery+gossip: make sure we dont advertise node anns with bad DNS
We may have already persisted node announcements that have multiple DNS
addresses since we may have received them before updating our code to
check for this. So here we just make sure not to send these on to our
peers.
2025-09-03 01:11:35 +00:00
Elle Mouton
f0a20c9d04 netadd: split ValidatenodeAnn into sig and field checks
Check that the node ann doesnt contain more than 1 DNS addr.
This will ensure that we now start rejecting new node announcements
with multiple DNS addrs since this check is called in the gossiper
before persisting a node ann to our local graph.

It also validates the DNS fields according to BOLT #7 specs.
2025-09-03 01:11:34 +00:00
Elle Mouton
670b26ba3d lnwire: add encoding/decoding for DNS addr
Co-authored-by: Elle Mouton <elle.mouton@gmail.com>
2025-09-02 17:51:31 +00:00
Mohamed Awnallah
a0057c2026 lnwire: add DNSAddress type 2025-09-02 17:51:31 +00:00