Commit Graph

18961 Commits

Author SHA1 Message Date
ZZiigguurraatt
4a4d19600f sqldb: clarify native sql options 2025-06-24 11:35:53 -04:00
Oliver Gugger
c1740c14ba Merge pull request #9887 from ellemouton/graphSQL9-chan-policies-schema
graph/db+sqldb: channel policy SQL schemas, queries and upsert CRUD
2025-06-17 16:30:23 +02:00
Elle Mouton
c327988bb3 graph/db+sqldb: implement UpdateEdgePolicy
In this commit, the various SQL queries are defined that we will need in
order to implement the SQLStore UpdateEdgePolicy method. Channel
policies can be "replaced" and so we use the upsert pattern for them
with the rule that any new channel policy must have a timestamp greater
than the previous one we persisted.

As is done for the KVStore implementation of the method, we use the
batch scheduler for this method.
2025-06-17 13:43:07 +02:00
Yong
a5c4a7c547 Merge pull request #9921 from yyforyongyu/fix-notification
Use spent height as the rescan start height in `RegisterSpendNtfn`
2025-06-16 20:50:53 +08:00
Oliver Gugger
207df8dd7c Merge pull request #9951 from yyforyongyu/fix-cached-policy
graph: fix nil pointer deference in `ForEachChannelCacheable`
2025-06-16 10:28:16 +02:00
Oliver Gugger
cb10536a2f Merge pull request #9943 from ziggie1984/update-lightning-onion
multi: update sphinx lib to latest version
2025-06-16 10:26:25 +02:00
Oliver Gugger
8f8d17de26 Merge pull request #9903 from ziggie1984/sphinx-relays-doc
docs: add sphinx replay description
2025-06-16 10:25:04 +02:00
Oliver Gugger
63e7c2e893 Merge pull request #9933 from Roasbeef/0-19-99
build: bump version to v0.19.99
2025-06-16 08:51:45 +02:00
Oliver Gugger
5d161e8cd0 Merge pull request #9653 from djkazic/reorder-buckets-check
channeldb: perform init of top level buckets first
2025-06-16 08:24:03 +02:00
Yong
94064bed3a Merge pull request #9815 from mohamedawnallah/preventCurrentNodeAnnMutation
server.go: prevent partial mutation of `currentNodeAnn` in `server.genNodeAnnouncement` on `netann.SignNodeAnnouncement` failures
2025-06-16 12:05:44 +08:00
yyforyongyu
46c5715ae5 graph: fix nil pointer deference in ForEachChannelCacheable 2025-06-16 12:02:24 +08:00
Mohamed Awnallah
e7d30e0790 docs: update release notes 2025-06-14 14:31:57 +00:00
Mohamed Awnallah
d26a84e18b server.go: prevent partial mutation of currNodeAnn
In this commit, we prevent partial mutation of current
node announcement during announcement signing. If node
announcement signing failed the current node announcement
becomes inconsistent.
2025-06-14 14:23:34 +00:00
Yong
fe405426ca Merge pull request #9356 from funyug/add-filters-fwdhistory
lnrpc: add incoming/outgoing channel ids filter to forwarding history request
2025-06-14 08:36:51 +08:00
ziggie
1741810065 docs: add sphinx replay description
Previouly the sphinx replay db would cause confusion for what it
is needed at all. We clarify it in a detailed document.
2025-06-13 15:37:03 +02:00
djkazic
759a870072 channeldb: perform init of top level buckets first 2025-06-13 09:02:07 -04:00
ziggie
fe3db6a263 multi: update sphinx lib to latest version 2025-06-13 08:47:31 +02:00
Elle Mouton
498a18d028 graph/db: provide SQLStore with chainhash
In this commit, we introduce a SQLStoreConfig struct which for the time
being only has the ChainHash of the genesis block of the chain this node
is running on. This is used to reconstruct lnwire messages from what we
have persisted in the DB. This means we dont need need to persist the
chain-hash of gossip messages since we know it will always be the same
for a given node. If a node were to be started with a different network,
the lnwire messages it reconstructs for gossip will be invalid.
2025-06-12 07:16:18 +02:00
Elle Mouton
4e2750e179 sqldb: channel policy tables
Define the SQL tables for representing channel policies. Namely:

- channel_policies
- channel_policy_extra_types
2025-06-12 07:16:18 +02:00
Elle Mouton
425b057c0f go.mod: add temporary replace to local sqldb pkg 2025-06-12 07:16:03 +02:00
Elle Mouton
3a264aabca sqldb: fix graph DROP order
Ensure that the graph tables are dropped in reverse dependency order.
2025-06-12 07:15:04 +02:00
yyforyongyu
adf27196d2 docs: update release notes 2025-06-12 08:30:55 +08:00
yyforyongyu
881e044fe3 chainntnfs: use spent height as height hint if found
Previously when deciding whether a UTXO is spent or not, we accept a
height hint as the starting block to look for the spending tx in the
rescan process. When it's already found spent before the rescan starts,
we will update the height hint to be the spent height, only if the
latter is greater. This means if the user-specified hint is greater than
the actual spending height, this UTXO will never be found as spent. We
now fix it by always using the spent height as the hint.
2025-06-12 08:30:55 +08:00
yyforyongyu
6fb81b2250 chainntnfs: patch debug logs and fix StartHeight
Make sure we patch the `StartHeight` for btcd notifier.
2025-06-12 08:30:54 +08:00
Olaoluwa Osuntokun
35102e7c35 Merge pull request #9652 from Roasbeef/rbf-iteration-loop-flake
lnwallet/chancloser: fix flake in TestRbfCloseClosingNegotiationLocal
2025-06-11 14:08:19 -07:00
Olaoluwa Osuntokun
da8d2257fd build: bump version to v0.19.99 2025-06-11 12:03:18 -07:00
Olaoluwa Osuntokun
c33fbfb3e7 Merge pull request #9928 from ellemouton/removeModReplaces
go.mod: remove tlv and sqldb replace directives
2025-06-11 12:01:08 -07:00
Olaoluwa Osuntokun
07f65b5118 Merge pull request #9923 from ellemouton/graphCache
graph/db: only fetch required info for graph cache population
2025-06-11 10:57:45 -07:00
Elle Mouton
9e9524766c go.mod: remove tlv and sqldb replace directives
Bump tlv to v1.3.2 and sqldb to v1.0.10
2025-06-11 06:18:24 +02:00
Shivam Chawla
bfe1edf4ec lnrpc: add filters to forwardhistoryrequest
This commit adds incoming and outgoing channel ids filter to forwarding history request to filter events received/forwarded from/to a particular channel
2025-06-11 09:10:13 +05:30
Olaoluwa Osuntokun
eb863e46af lnwallet/chancloser: fix fllake in TestRbfCloseClosingNegotiationLocal/send_offer_rbf_wrong_local_script
In this commit, we fix a flake in the
`TestRbfCloseClosingNegotiationLocal/send_offer_rbf_wrong_local_script`
test.

This flake can happen if the test shuts down _before_ the state machine
is actually able to process the sent event. In this case, the
expectations are triggered, and we find that the error isn't sent.

To resolve this, we create a new wrapper function that'll use a sync
channel send to assert that the error has been sent before we exit the
test.
2025-06-10 18:44:34 -07:00
Olaoluwa Osuntokun
92a5d35cff Merge pull request #9911 from ziggie1984/exit-early-for-fwd-adds
htlcswitch: exit early if no adds are in the fwd pkg
sqldb/v1.0.10 tlv/v1.3.2
2025-06-10 15:14:09 -07:00
Elle Mouton
6fb90c88ca docs: update release notes 2025-06-10 20:10:36 +02:00
Elle Mouton
c52c6c962b graph/db: introduce ForEachChannelCacheable
Implement ForEachChannelCacheable which is like ForEachChannel but its
call-back takes the cached versions of channel info & policies. This is
then used during graph cache population. This will be useful once the
SQL implementation is added so that we can reduce the number of DB trips
on cache population.
2025-06-10 20:10:36 +02:00
Elle Mouton
3069a67b62 graph/db: let GraghCache.AddChannel take CachedEdgeInfo
Define a new CachedEdgeInfo type and let the graph cache's AddChannel
use this. This will let us later on (for the SQL impl of the graph db)
only load from the DB what we actually need for the graph cache.
2025-06-10 20:10:35 +02:00
Elle Mouton
3ea86bfbf4 graph/db: let GraphCache.AddChannel take cached edge polies
So that the call-sites of this method dont necessarily need to fetch all
the data required to populate the full ChannelEdgePolicy.
2025-06-10 20:10:35 +02:00
Elle Mouton
f95588caca graph/db: add CachedEdgePolicy helpers 2025-06-10 20:10:35 +02:00
Elle Mouton
42c6e951ed graph/db: let GraphCache.UpdatePolicy take a cached policy
Update the GraphCache.UpdatePolicy method to take a
`models.CachedEdgePolicy` instead of a `models.ChannelEdgePolicy`.
Doing this will allow us later on to only fetch the necessary info for
populating the CachedEdgePolicy when we are populating the cache via
UpdatePolicy.
2025-06-10 20:10:35 +02:00
Elle Mouton
0816645328 graph/db: simplify GraphCache.UpdatePolicy signature
Remove the redundant "edge2" param and rather use the "policy" param to
derive the boolean.
2025-06-10 20:10:35 +02:00
Elle Mouton
2e716bf301 graph/db: remove unused GraphCache method
Remove the unused UpdateChannel method.
2025-06-10 20:10:34 +02:00
Olaoluwa Osuntokun
32592dbd20 Merge pull request #9897 from ellemouton/inboundFeeTLV
multi: explicitly define InboundFees in ChannelUpdate and ChannelEdgePolicy
2025-06-10 11:05:48 -07:00
ziggie
6feed32288 htlcswitch: exit early if no adds are in the fwd pkg
This lead to the case that we would always record a HTLC
two times in the decayed log protection which is not necessary
in the first place.
2025-06-09 09:17:25 +02:00
Elle Mouton
6141bcd851 docs: update release notes 2025-06-09 08:44:50 +02:00
Elle Mouton
6d8bc63ad6 discovery+graph: get inbound fee directly from ChannelUpdate
Remove the previously added TODOs which would extract InboundFee info
from the ExtraOpaqueData of a ChannelUpdate at the time of
ChannelEdgePolicy construction. These can now be replaced by using the
newly added InboundFee record on the ChannelUpdate message.
2025-06-09 08:44:47 +02:00
Elle Mouton
420001a98c lnwire: add InboundFee TLV record to ChannelUpdate 2025-06-09 08:32:52 +02:00
Elle Mouton
7add5bfd4a tlv+go.mod: generate inbound fee TLV type
Also add a temporariy replace to the tlv package which can be removed as
soon as the PR that includes this commit is merged and a new tag for the
tlv package has been created.
2025-06-09 08:32:50 +02:00
Elle Mouton
bf72d9ec19 graph+rpcserver: add InboundFee to ChannelEdgeUpdate
And then use that new field instead of parsing from extra opaque data.
2025-06-09 08:32:15 +02:00
Elle Mouton
cb16c7177a graph/db: use InboundFee directly from ChannelEdgePolicy
Now that we know that the InboundFee on the ChannelEdgePolicy is always
set appropriately, we can update the GraphCache UpdatePolicy method to
take the InboundFee directly from the ChannelEdgePolicy object.
2025-06-09 08:31:19 +02:00
Elle Mouton
9890d74622 multi: set the InboundFee on ChannelEdgePolicy
In this commit, we make sure to set the new field wherever appropriate.
This will be any place where the ChannelEdgePolicy is constructed other
than its disk deserialisation.
2025-06-09 08:31:10 +02:00
Elle Mouton
1d162216e6 peer: stop extracting InboundFees
Like the previous commit, here we can start directly using the
InboundFee on the models.ChannelEdgePolicy object since we know we read
it from disk and so the InboundFee field will be populated accordingly.

NOTE: unlike the previous commit, behaviour is slightly different here
since previously we would error out here if TLV parsing failed whereas
now, the DB call will just skip the error and return a nil policy. This
should be ok since this is explicitly only dealing with our own updates
and so our TLV should always be valid.
2025-06-09 08:29:16 +02:00