Commit Graph

18865 Commits

Author SHA1 Message Date
yyforyongyu
a8d1985fd6 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-20 15:50:45 -07:00
yyforyongyu
107b74d81d accessman+lnd: rename checkIncomingConnBanScore for clarity 2025-06-20 15:50:45 -07:00
yyforyongyu
c23c90ee9b docs: add release notes for improved accessman 2025-06-20 15:50:44 -07:00
yyforyongyu
c4116e1438 itest+lntest: add more itest for accessman 2025-06-20 15:50:25 -07:00
yyforyongyu
0b0513d88c accessman: make sure to decrement PendingOpenCount 2025-06-20 15:50:25 -07:00
yyforyongyu
d9e3412ed5 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-20 15:50:25 -07:00
yyforyongyu
d170ef3efe lnd: add string representation for peerAccessStatus 2025-06-20 15:50:25 -07:00
yyforyongyu
bd99924383 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-20 15:50:25 -07:00
yyforyongyu
bc6008f854 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-20 15:50:25 -07:00
yyforyongyu
89a819db46 accessman: reduce lock span by excluding ctx 2025-06-20 15:50:25 -07:00
yyforyongyu
a0439155d4 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-20 15:50:25 -07:00
yyforyongyu
b527f19de7 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-20 15:50:25 -07:00
yyforyongyu
5dfc5f4b42 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-20 15:50:25 -07:00
yyforyongyu
7981b3b4de lncfg: fix typo 2025-06-20 15:50:25 -07:00
Olaoluwa Osuntokun
ba94755dfd Merge branch '0-19-2-branch-rc1-9929' into 0-19-2-branch-rc1 2025-06-20 15:49:04 -07:00
yyforyongyu
68cc4bc208 docs: update release notes 2025-06-20 15:49:04 -07:00
yyforyongyu
69df66f1f9 htlcswitch: skip decoding hop if the htlc is already acked
We now move the check earlier in the loop so we don't even need to
decode the hop for already processed ADDs.
2025-06-20 15:49:04 -07:00
yyforyongyu
13308644d0 htlcswitch: remove batchReplayBkt
This commit removes the `batchReplayBkt` as its only effect is to allow
reforwarding htlcs during startup.

Normally for every incoming htlc added, their shared secret is used as
the key to be saved into the `sharedHashBucket`, which will be used for
check for replays. In addition, the fwdPkg's ID, which is SCID+height is
also saved to the bucket `batchReplayBkt`. Since replays of HTLCs cannot
happen at the same commitment height, when a replay happens,
`batchReplayBkt` simply doesn't have this info, and we again rely on
`sharedHashBucket` to detect it. This means most of the time the
`batchReplayBkt` is a list of SCID+height with empty values.

The `batchReplayBkt` was previously used as a mechanism to check for
reforwardings during startup - when reforwarding htlcs, it quries this
bucket and finds an empty map, knowing this is a forwarding and skips
the check in `sharedHashBucket`. Given now we use a bool flag to
explicitly skip the replay check, this bucket is no longer useful.
2025-06-20 15:49:04 -07:00
yyforyongyu
c8ff379a9c htlcswitch: exit early if the fwdPkg is already completed 2025-06-20 15:49:04 -07:00
yyforyongyu
cb009119c4 htlcswitch: skip checking replays for reforwarded packets
We now rely on the forwarding package's state to decide whether a given
packet is a reforwarding or not. If we know it's a reforwarding packet,
there's no need to check for replays in the `sharedHashes` bucket, which
behaves the same as if we are querying the `batchReplayBkt`.
2025-06-20 15:49:04 -07:00
Olaoluwa Osuntokun
2b3c04ccaa Merge branch '0-19-2-branch-rc1-9726' into 0-19-2-branch-rc1 2025-06-20 15:48:41 -07:00
Olaoluwa Osuntokun
14ce4f17ab protofsm: add test for new full block conf behavior 2025-06-20 15:48:41 -07:00
Olaoluwa Osuntokun
3e29342353 protofsm: add option to allow conf resp to return full back
In this commit, we add an option to allow a conf req caller to receive
the full block. This is useful if the caller wants to be able to create
an SPV proof.
2025-06-20 15:48:41 -07:00
Olaoluwa Osuntokun
fd03675f79 Merge branch '0-19-2-branch-rc1-9725' into 0-19-2-branch-rc1 2025-06-20 15:48:29 -07:00
Olaoluwa Osuntokun
6cee18ff4a protofsm: add generic type assertion to state machine tests
This commit introduces a new generic type assertion function
`assertState` to the state machine tests. This function asserts that the
state machine is currently in the expected state type and returns the
state cast to that type. This allows us to directly access the fields of
the state without having to perform a type assertion manually.
2025-06-20 15:48:29 -07:00
Olaoluwa Osuntokun
f11d1d7460 protofsm: add unit tests for SpendMapper 2025-06-20 15:48:29 -07:00
Olaoluwa Osuntokun
1304182897 protofsm: add new ConfMapper similar to SpendMapper for conf events
In this commit, we add a new ConfMapper which is useful for state
machines that want to project some of the conf attributes into a new
event to be sent post conf.
2025-06-20 15:48:29 -07:00
Olaoluwa Osuntokun
6e6901ec61 Merge branch '0-19-2-branch-rc1-9962' into 0-19-2-branch-rc1 2025-06-20 15:46:10 -07:00
yyforyongyu
6bf9a38940 chainio: use package logger instead of instance logger
There's no guarantee that the `b.beat` is initialized when the
dispatcher shuts down, especially with the case in the remote signer
where no chainbackend is created.
2025-06-20 15:46:10 -07:00
Olaoluwa Osuntokun
ff6ea786ec Merge branch '0-19-2-branch-rc1-9921' into 0-19-2-branch-rc1 2025-06-20 15:45:56 -07:00
yyforyongyu
1d2217e9a9 docs: update release notes 2025-06-20 15:45:56 -07:00
yyforyongyu
732cd717bf 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-20 15:45:56 -07:00
yyforyongyu
a806323035 chainntnfs: patch debug logs and fix StartHeight
Make sure we patch the `StartHeight` for btcd notifier.
2025-06-20 15:45:56 -07:00
Olaoluwa Osuntokun
270981eef0 Merge branch '0-19-2-branch-rc1-9653' into 0-19-2-branch-rc1 2025-06-20 15:45:39 -07:00
djkazic
2ffcefc947 channeldb: perform init of top level buckets first 2025-06-20 15:45:39 -07:00
Olaoluwa Osuntokun
ff95646d42 Merge branch '0-19-2-branch-rc1-9889' into 0-19-2-branch-rc1 2025-06-20 15:45:21 -07:00
yyforyongyu
0608cc0428 channeldb+lnwallet: fix typo 2025-06-20 15:45:13 -07:00
yyforyongyu
f326fbb840 docs: add release note entry 2025-06-20 15:45:12 -07:00
yyforyongyu
6947e0a87a channeldb: add customized encoding for HtlcIndex 2025-06-20 15:44:16 -07:00
yyforyongyu
938d78a28b lnwallet+channeldb: use BigSizeT to save space 2025-06-20 15:44:16 -07:00
Olaoluwa Osuntokun
6e8d5522ea Merge branch '0-19-2-branch-rc1-9813' into 0-19-2-branch-rc1 2025-06-20 15:43:53 -07:00
Abdullahi Yunus
473240533b docs: add release note 2025-06-20 15:42:20 -07:00
Abdullahi Yunus
768911c46f lnd+lnrpc: update fwdinghistory message
In this commit we update the returned message for fwdinghistory
to include the htlcindex for all forwarded htlcs.
2025-06-20 15:37:24 -07:00
Abdullahi Yunus
43f8bf288f htlcswitch+channeldb: add htlcidx to fwding log
In this commit we add htlcindex field to the forwardingevent
struct, which is persisted alongside the other event fields.
2025-06-20 15:37:02 -07:00
Olaoluwa Osuntokun
b27f401ccc Merge branch '0-19-2-branch-rc1-9911' into 0-19-2-branch-rc1 2025-06-20 15:31:00 -07:00
ziggie
21ed1360cd 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-20 15:31:00 -07:00
Olaoluwa Osuntokun
59a86b3b54 Merge pull request #9927 from Roasbeef/0-19-1-branch
build: bump version to v0.19.1
v0.19.1-beta
2025-06-10 18:45:01 -07:00
Olaoluwa Osuntokun
51bc76cc9f build: bump version to v0.19.1 2025-06-10 17:22:53 -07:00
Oliver Gugger
a0b2764167 Merge pull request #9896 from lightningnetwork/0-19-1-rc1-branch
release: create branch for v0.19.1-beta.rc1
v0.19.1-beta.rc1
2025-06-04 14:05:39 +02:00
Oliver Gugger
fedc4c939f build: bump version to v0.19.1-beta.rc1 2025-06-04 13:00:47 +02:00