Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mass ban of all incoming peers #7734

Open
proninyaroslav opened this issue Sep 20, 2024 · 0 comments
Open

Mass ban of all incoming peers #7734

proninyaroslav opened this issue Sep 20, 2024 · 0 comments

Comments

@proninyaroslav
Copy link

proninyaroslav commented Sep 20, 2024

Please provide the following information

libtorrent version (or branch): libtorrent4j, libtorrent 2.0 master from Oct 8, 2023

platform/architecture: Android arm64

I use libtorrent4j wrapper for Java in my Android app, which uses libtorrent 2.0 master branch for building. Over the last year, users have started complaining that torrent downloads are abruptly interrupted. This doesn't happen to everyone. In the log that was sent to me, I found that all incoming peers were banned for some reason:

Log
2024-09-19 20:40:22.676 [PEER_LOG] [INCOMING] [INCOMING_CONNECTION] ep: 78.37.3.216:49632 type: uTP seed: 0 p: 0x0 local: 0.0.0.0:43364
2024-09-19 20:40:22.677 [PEER_LOG] [INFO] [CONSTRUCT] bt_peer_connection
2024-09-19 20:40:22.677 [PEER_LOG] [INFO] [SET_PEER_CLASS] a: 78.37.3.216
2024-09-19 20:40:22.677 [PEER_LOG] [INFO] [CLASS] global 
2024-09-19 20:40:22.677 [PEER_LOG] [INCOMING] [ASYNC_READ] max: 104 bytes
2024-09-19 20:40:22.729 [PEER_LOG] [INCOMING] [ON_RECEIVE_DATA] bytes: 68 
2024-09-19 20:40:22.730 [PEER_LOG] [INCOMING] [READ] 68 bytes
2024-09-19 20:40:22.730 [PEER_LOG] [INCOMING_MESSAGE] [HANDSHAKE] BitTorrent protocol
2024-09-19 20:40:22.730 [PEER_LOG] [INCOMING_MESSAGE] [EXTENSIONS] 0000000000000000000000000000000000000000000100000000000000000101 ext: DHT FAST extension 
2024-09-19 20:40:22.730 [PEER_LOG] [INFO] [ATTACH] attached to torrent
2024-09-19 20:40:22.730 [PEER_LOG] [INFO] [CONNECTION_CLOSED] op: 1 ERROR: (libtorrent:91) peer banned
2024-09-19 20:40:22.730 [TORRENT_LOG] CLOSING CONNECTION "78.37.3.216:49632" peer list full connections: 19 limit: 40

and only in 3 cases out of 71 it was indicated that the peer was banned because of too many corrupted piece:

Log
2024-09-19 20:38:30.468 [PEER_LOG] [INFO] [FILE_ASYNC_WRITE_COMPLETE] piece: 9 s: fc000 l: 4000 e: Success
2024-09-19 20:38:30.469 [PEER_LOG] [INCOMING] [ON_RECEIVE_DATA] bytes: 1418 
2024-09-19 20:38:30.469 [PEER_LOG] [INCOMING] [READ] 1418 bytes
2024-09-19 20:38:30.469 [PEER_LOG] [INCOMING] [ASYNC_READ] max: 25446 bytes
2024-09-19 20:38:30.469 [PEER_LOG] [INCOMING] [ON_RECEIVE_DATA] bytes: 7090 
2024-09-19 20:38:30.469 [PEER_LOG] [INCOMING] [READ] 7090 bytes
2024-09-19 20:38:30.469 [PEER_LOG] [INCOMING] [ASYNC_READ] max: 18356 bytes
2024-09-19 20:38:30.469 [PEER_LOG] [INCOMING] [ON_RECEIVE_DATA] bytes: 2836 
2024-09-19 20:38:30.469 [PEER_LOG] [INCOMING] [READ] 2836 bytes
2024-09-19 20:38:30.469 [PEER_LOG] [INCOMING] [ASYNC_READ] max: 15520 bytes
2024-09-19 20:38:30.469 [TORRENT_LOG] *** PIECE_FINISHED [ p: 9 | chk: failed | size: 1048576 ]
2024-09-19 20:38:30.469 [TORRENT_LOG] *** BANNING PEER: "5.253.144.209:37839" Too many corrupt pieces
2024-09-19 20:38:30.469 [PEER_LOG] [INFO] [BANNING_PEER] Too many corrupt pieces
2024-09-19 20:38:30.469 [PEER_LOG] [INFO] [CONNECTION_CLOSED] op: 1 ERROR: (libtorrent:93) too many corrupt pieces

To understand the reason I decided to roll back the libtorrent4j version (current 2.1.0-31 from Oct 8, 2023). I found that the problem started with version 2.1.0-27 from Jan 14, 2023. However, version 2.0.6-26 from Jun 6, 2022 doesn't have this problem, there are no mass bans of peers. libtorren4j uses the master branch of libtorren, so all release dates are relevant for the master branch of the same date.

I also attach full versions of the logs, the one where there is a problem and the one where there is no problem:

problem_version_log.txt
prev_version_log.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@proninyaroslav and others