Open girazoki opened 3 months ago
CC @paritytech/networking
Possible root cause for multiple block requests, needs debug patch to test with a local net:
self.peers
Downloading
Available
On one side, we store the peers in a HashMap (strategy/chain_sync logic):
On the other side, we store in a LRU map the previous requests:
Managed to reproduce this behavior with the following branch:
2024-07-05 19:15:40 Finished sleeping for block request from 12D3KooWPfpK9xaCkg4eukAT9nJunVjc1drNisHFcE6qpdQWTHiu!
2024-07-05 19:15:40 Received block request from 12D3KooWPfpK9xaCkg4eukAT9nJunVjc1drNisHFcE6qpdQWTHiu simulating sleep!
2024-07-05 19:15:40 Peer 12D3KooWPfpK9xaCkg4eukAT9nJunVjc1drNisHFcE6qpdQWTHiu disconnected. Removed from internal mappings
2024-07-05 19:15:40 New peer 12D3KooWPfpK9xaCkg4eukAT9nJunVjc1drNisHFcE6qpdQWTHiu with best hash 0x1c69…fbf9 (0)
2024-07-05 19:15:40 Inserting peer 12D3KooWPfpK9xaCkg4eukAT9nJunVjc1drNisHFcE6qpdQWTHiu with state PeerSync { peer_id: PeerId("12D3KooWPfpK9xaCkg4eukAT9nJunVjc1drNisHFcE6qpdQWTHiu"), common_number: 0, best_hash: 0x1c69d379ff8920602d3ccb392e6f8fdd319b47971775f7696b17a69ca06cfbf9, best_number: 0, state: Available } (InChainPruned)
2024-07-05 19:16:00 Finished sleeping for block request from 12D3KooWPfpK9xaCkg4eukAT9nJunVjc1drNisHFcE6qpdQWTHiu!
2024-07-05 19:16:00 Received block request from 12D3KooWPfpK9xaCkg4eukAT9nJunVjc1drNisHFcE6qpdQWTHiu simulating sleep!
2024-07-05 19:16:00 Report 12D3KooWPfpK9xaCkg4eukAT9nJunVjc1drNisHFcE6qpdQWTHiu: -2147483648 to -2147483648. Reason: Same block request multiple times. Banned, disconnecting.
2024-07-05 19:16:00 Peer 12D3KooWPfpK9xaCkg4eukAT9nJunVjc1drNisHFcE6qpdQWTHiu disconnected. Removed from internal mappings
Will come up with a PR to fix this next week
Thank you @lexnv ! appreciated!
We have seen the
"Banned: same state requested multiple times"
using warp sync without apparent signs of the node doing anything wrong. The architecture is at follows:Reason: Same state request multiple times. Banned, disconnecting
Full node logs:
We are wondering if the issue could be caused because the full-node cannot serve 3 nodes simultaneously asking for the latest state, which causes these 3 nodes to not receive the indicated bytes and therefore re-ask again for the same byttes, which causes the banning. Could this be any possible explanation?
From what we have seen from the substrate code, the banning happens after receiving the same request 3 times