Commit Graph

14 Commits

Author SHA1 Message Date
Elle Mouton
a1006d8372 accessman: fix structured logging formatting 2025-07-01 07:43:26 +02:00
yyforyongyu
250a61af6d lnd: remove peer from peerChanInfo when necessary
We now remove the peer from `peerChanInfo` if this peer doesn't have
channels with us. Also patched a unit test for `removePeerAccess`.
2025-06-19 20:23:46 +08:00
yyforyongyu
32d8e2123d channeldb+lnd: rename peerCounts to peerChanInfo for clarity 2025-06-19 16:48:13 +08:00
yyforyongyu
0dc10ba692 accessman+lnd: rename checkIncomingConnBanScore for clarity 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
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
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
704bb736a5 accessman: only check ban score for restricted peers
If a peer has, or used to have a channel with us there's no need to
check for the ban score.
2025-06-03 22:43:14 +08:00
Olaoluwa Osuntokun
21ca1e650b acessman: improve access manager logging and error handling
This commit adds logs to the new access manager. This'll help us monitor
the new system behavior, and may make debugging easier in the future.
2025-04-17 17:20:11 -07:00
xinhangzhou
b7e3c20383 refactor: use maps.Copy for cleaner map handling
Signed-off-by: xinhangzhou <shuangcui@aliyun.com>
2025-03-25 01:19:55 +08:00
Eugene Siegel
6eb746fbba server.go+accessman.go: introduce caches for access permissions
Here we introduce the access manager which has caches that will
determine the access control status of our peers. Peers that have
had their funding transaction confirm with us are protected. Peers
that only have pending-open channels with us are temporary access
and can have their access revoked. The rest of the peers are granted
restricted access.
2025-03-11 20:42:34 -04:00