mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2026-03-01 04:28:51 +00:00
Seed node address can be blacklisted #1521
Labels
No labels
I1
I2
I3
I4
S1
S2
S3
S4
U0
U1
U2
U3
U3
U4
blocked
bug
bug
cli
compiler
config
config
consensus
dependencies
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
neotest
network
oracle
performance
question
rpc
security
smartcontract
task
task
task
test
vm
wallet
windows
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neo-go#1521
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AnnaShaleva on GitHub (May 19, 2025).
Originally assigned to: @AnnaShaleva on GitHub.
Current Behavior
Node height stales due to inability to fetch new blocks.
getpeersshows that all known peers are blacklisted:It's known that some of thees peers are seed nodes.
Expected Behavior
At least seed nodes must not be blacklisted.
Possible Solution
Find the bug in this code, fix it:
nspcc-dev/neo-go@66449003b3/pkg/network/discovery.go (L174-L181)@AnnaShaleva commented on GitHub (May 19, 2025):
IR node config:
@AnnaShaleva commented on GitHub (May 19, 2025):
So one side of the problem is that seed list contains:
192.168.43.95:7111,192.168.43.93:7111,192.168.43.92:7111whereas in fact peers marked as "bad" have the same addresses but different ports, e.g.192.168.43.93:20333etc. due to the fact that nodes are running inside Docker container, and here are port mappings:So technically the node doesn't treat
192.168.43.93:20333as seed node192.168.43.93:7111because we use raw strings comparison here:nspcc-dev/neo-go@66449003b3/pkg/network/discovery.go (L174)@roman-khimov commented on GitHub (May 19, 2025):
announcedPortin https://github.com/nspcc-dev/neo-go/blob/master/docs/node-configuration.md#p2p-configuration?@roman-khimov commented on GitHub (May 19, 2025):
But why does it prevent connection to seeds?
@AnnaShaleva commented on GitHub (May 19, 2025):
Probably it's not the real bug reason, I'm looking at the code and it looks like
192.168.43.93:20333should never be included in the list of bad peers, but somehow it's included.@AnnaShaleva commented on GitHub (May 19, 2025):
A side fact, just for the record. The same situation is reproduced on other CNs in this network, although not all CNs are marked as "bad", e.g. here's the response from CN1:
Also note, there's another divergence from expected behaviour: peer
192.168.43.95:20333is marked as both "connected" and "unconnected.@AnnaShaleva commented on GitHub (May 19, 2025):
OK, this is explainable and reproducible on privnet: when CN disconnects from the network, its peers mark its connection address (
192.168.43.93:20333) as "unconnected". Then peer iterates overunconnectedAddrsmap and eventually tries to connect to this address. It fails forconnRetriestimes (since CN is offline) and then marks this peer as "bad".But it doesn't explain the fact why does the node prevents attempts to connect to seed nodes.
@AnnaShaleva commented on GitHub (May 19, 2025):
Goroutines dump of aborted
neofs-irprocess:neofs-ir_ABRT_dump.md