Commit Graph

18974 Commits

Author SHA1 Message Date
yyforyongyu
03de0f9e4b funding+lnd: make sure accessman won't interrupt funding flow
If there's an error occured when updating the peer's status after the
channel status is changed, we now make sure we log the error instead of
letting it interrupt the channel open/close flow.
2025-06-19 16:05:59 +08:00
yyforyongyu
0dc10ba692 accessman+lnd: rename checkIncomingConnBanScore for clarity 2025-06-19 16:05:59 +08:00
yyforyongyu
869e541b7c docs: add release notes for improved accessman 2025-06-19 16:05:59 +08:00
yyforyongyu
9caa5f220d itest+lntest: add more itest for accessman 2025-06-19 16:05:59 +08:00
yyforyongyu
e003cb5d4a accessman: make sure to decrement PendingOpenCount 2025-06-19 16:05:56 +08:00
yyforyongyu
856ec463ff accessman: skip incrementing num of slots for existing peer
When a peer is already existing, we should skip incrementing the
`numRestricted` count.

Also patched unit test for method `addPeerAccess`.
2025-06-18 17:19:10 +08:00
yyforyongyu
0f9332b1d6 lnd: add string representation for peerAccessStatus 2025-06-18 17:19:10 +08:00
yyforyongyu
0c5bb49561 lnd: only restrict slots for inbound connections
For outbound connections, since they are initialized by the users, we
can relax on the restriction. A future global limit may be added - as
for now, we will let them to be managed by the users.
2025-06-18 17:19:10 +08:00
yyforyongyu
00db8c6359 lnd: move peer perms assignment into peerConnected
When the callback is called in `scheduledPeerConnection`, it is
referencing the old `access` variable which was created when the peer
was first connected. However, if this peer opens a channel with us and
goes offline, or another inbound connection is made from this peer, we
may still use the old `access` value. To fix it, we need to make sure we
always get the fresh perm by calling `assignPeerPerms` inside
`peerConnected`.
2025-06-18 17:19:10 +08:00
yyforyongyu
d8d468f459 accessman: reduce lock span by excluding ctx 2025-06-18 17:19:10 +08:00
yyforyongyu
124aabcdb7 accessman+lnd: check if a peer is found in peerScores
We need to also check this map to make sure the peer exists or not.
2025-06-18 17:19:09 +08:00
yyforyongyu
836b527a4e accessman: skip restriction for existing peers
When a peer already has a connection with us, there's no need to check
for available slots as we will either close the old conn or refuse the
new conn.
2025-06-18 17:19:09 +08:00
yyforyongyu
599650fa2d lncfg+lnd: add new dev config unsafeconnect
This flag is added so we can use it in the itest to mimic racing inbound
and outbound connections.
2025-06-18 17:19:09 +08:00
yyforyongyu
cc7ed5a9d2 lncfg: fix typo 2025-06-18 17:19:09 +08: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