storj-archived / core

Deprecated. Implementation of the Storj v2 protocol for Node.js.
https://storj.io
Other
395 stars 95 forks source link

Local bad farmer blacklist doesn't expire #425

Closed littleskunk closed 7 years ago

littleskunk commented 7 years ago

Code review result of https://github.com/Storj/core/issues/416 / https://github.com/Storj/core/pull/403

While the renter is uploading shards he will add farmer to his local blacklist. As far as I can see the blacklist never expire. A short disconnect, crash because of a new issue, CPU or network spike and farmer get blacklisted for a very long time. I see 2 possible problems:

1.) The storj.dk bridge is uploading non stop. Sooner or later the bridge will add everyone to the blacklist and not receive any non blacklisted OFFER. At that point the bridge will start spamming the network to death. 2.) In Order to get more shards myself I can start spamming other nodes. More and more renter will add them to there blacklist.

Easy solution: Blacklist nodeID should expire after X Minutes / Hours

Better soultion: Blacklist nodeID should expire after 10 Minutes but don't delete the Information. Just flag it as expired. Next failed upload -> Backlist the nodeID again but this time for 30 minutes and than 1 hour, 10 hours, 1 day, 1 week, 1 month, what ever. Remove the nodeID or reset the expired offset after one sucessfull upload.

aleitner commented 7 years ago

That's right skunk I already fixed it.

aleitner commented 7 years ago

We will update to be more detailed later, but for now we will simply keep someone on the black list for x amount of time and then remove them