slush0 / stratum

Stratum server implementation using Python Twisted
Other
89 stars 131 forks source link

Increase LineOnlyReader.MAX_LENGTH to prevent large gentxs from making mining proxy disconnect #8

Closed forrestv closed 10 years ago

forrestv commented 11 years ago

Fixes problem with connecting to P2Pool:

2013-05-26 17:01:44,371 INFO stats stats.print_stats # 1 peers connected, state changed 1 times
2013-05-26 17:01:44,372 INFO proxy mining_proxy.on_connect # Connected to Stratum pool at 127.0.0.1:9332
2013-05-26 17:01:44,372 INFO proxy mining_proxy.on_connect # Subscribing for mining jobs
2013-05-26 17:01:44,396 INFO proxy client_service.handle_event # Setting new difficulty: 0.999984741211
2013-05-26 17:01:44,396 INFO proxy mining_proxy.on_disconnect # Disconnected from Stratum pool at 127.0.0.1:9332
2013-05-26 17:01:44,396 INFO stats stats.print_stats # 0 peers connected, state changed 1 times
slush0 commented 11 years ago

How long are usually such transactions? 1.6 MB seems too much, considering trivial DoS attack on server's RAM using thousands of concurrent connections...

slush0 commented 10 years ago

I cannot merge this patch to generic implementation, it has too dangerous consequences. Maybe the right solution is to have such option in server settings...?