Spare-Network / spare-blockchain

Apache License 2.0
68 stars 32 forks source link

Farmer constantly bans remote harvester #57

Closed LeonidShamis closed 3 years ago

LeonidShamis commented 3 years ago

Remote harvester (e.g. 192.168.20.30) successfully connects to the farmer (192.168.20.3) and starts responding to the challenges by looking for the "eligible for farming" plots, but after a short while the farmer closes the connection:

2021-06-21T13:19:06.784 harvester harvester_server : INFO Connection closed: 192.168.20.3, node id: d7409c0adc2e403f7639918ab19c8123504cdcd16092a8beefcf293e0be5d49e 2021-06-21T13:19:06.785 harvester spare.harvester.harvester: INFO peer disconnected {'host': '192.168.20.3', 'port': 9447}

In the farmer log you see the following about the disconnected harvester:

2021-06-21T13:20:49.213 farmer farmer_server : ERROR Exception: , {'host': '192.168.20.30', 'port': 9448}. Traceback (most recent call last): 2021-06-21T13:20:49.215 farmer farmer_server : ERROR Exception: <class 'AssertionError'>, closing connection {'host': '192.168.20.30', 'port': 9448}. Traceback (most recent call last): 2021-06-21T13:20:49.216 farmer farmer_server : INFO Connection closed: 192.168.20.30, node id: 886217b34697009b6fd18ab2d9e4cfdd82ca72b824389f02317b27a66a8774b4 2021-06-21T13:20:49.217 farmer farmer_server : WARNING Banning 192.168.20.30 for 10 seconds 2021-06-21T13:20:49.217 farmer spare.farmer.farmer : INFO peer disconnected {'host': '192.168.20.30', 'port': 9448}

The above happens many times - harvester reconnects, works for a short while and then is disconnected from the farmer.

:(

LeonidShamis commented 3 years ago

I see that the disconnections always occur after the harvester finds a proof and sends it to the farmer - always after Found 1 proofs. - see below.

What could cause the farmer to disconnect the harvester upon found proof?

021-06-21T13:51:09.853 harvester spare.harvester.harvester: INFO 3 plots were eligible for farming aecc81e2e4... Found 0 proofs. Time: 0.34272 s. Total xxx plots

2021-06-21T13:51:21.195 harvester spare.harvester.harvester: INFO 4 plots were eligible for farming aecc81e2e4... Found 1 proofs. Time: 0.87133 s. Total xxx plots

2021-06-21T13:51:21.201 harvester harvester_server : INFO Connection closed: 192.168.20.3, node id: d7409c0adc2e403f7639918ab19c8123504cdcd16092a8beefcf293e0be5d49e

2021-06-21T13:51:21.202 harvester spare.harvester.harvester: INFO peer disconnected {'host': '192.168.20.3', 'port': 9447}

2021-06-21T13:51:21.445 harvester harvester : INFO Reconnecting to peer {'host': '192.168.20.3', 'port': 9447}

2021-06-21T13:51:24.469 harvester harvester : INFO Reconnecting to peer {'host': '192.168.20.3', 'port': 9447}

2021-06-21T13:51:27.502 harvester harvester : INFO Reconnecting to peer {'host': '192.168.20.3', 'port': 9447}

2021-06-21T13:51:30.572 harvester harvester : INFO Reconnecting to peer {'host': '192.168.20.3', 'port': 9447}

2021-06-21T13:51:33.642 harvester harvester : INFO Reconnecting to peer {'host': '192.168.20.3', 'port': 9447}

2021-06-21T13:51:33.663 harvester harvester_server : INFO Connected with farmer {'host': '192.168.20.3', 'port': 9447}

2021-06-21T13:51:33.785 harvester spare.plotting.plot_tools: INFO Searching directories [.....]

2021-06-21T13:51:34.526 harvester spare.plotting.plot_tools: INFO Loaded a total of xxx plots ...

2021-06-21T13:51:43.832 harvester spare.harvester.harvester: INFO 8 plots were eligible for farming aecc81e2e4... Found 0 proofs. Time: 0.42082 s. Total xxx plots

2021-06-21T13:51:58.060 harvester spare.harvester.harvester: INFO 4 plots were eligible for farming aecc81e2e4... Found 1 proofs. Time: 0.85561 s. Total xxx plots

2021-06-21T13:51:58.074 harvester harvester_server : INFO Connection closed: 192.168.20.3, node id: d7409c0adc2e403f7639918ab19c8123504cdcd16092a8beefcf293e0be5d49e

2021-06-21T13:51:58.075 harvester spare.harvester.harvester: INFO peer disconnected {'host': '192.168.20.3', 'port': 9447}

2021-06-21T13:52:00.691 harvester harvester : INFO Reconnecting to peer {'host': '192.168.20.3', 'port': 9447}

2021-06-21T13:52:03.713 harvester harvester : INFO Reconnecting to peer {'host': '192.168.20.3', 'port': 9447}

2021-06-21T13:52:06.743 harvester harvester : INFO Reconnecting to peer {'host': '192.168.20.3', 'port': 9447}

2021-06-21T13:52:09.822 harvester harvester : INFO Reconnecting to peer {'host': '192.168.20.3', 'port': 9447}

2021-06-21T13:52:09.906 harvester harvester_server : INFO Connected with farmer {'host': '192.168.20.3', 'port': 9447}

2021-06-21T13:52:10.281 harvester spare.plotting.plot_tools: INFO Searching directories [.....]

2021-06-21T13:52:11.075 harvester spare.plotting.plot_tools: INFO Loaded a total of xxx plots ...

root-spare commented 3 years ago

@LeonidShamis ,thank you for opening this issue , we will investigate and respond with solution ASAP

msg7086 commented 3 years ago

Banning happens after some validation failed. I wonder if your proof of space was invalid to farmer. Maybe your proof doesn't match your private keys in your farmer?

LeonidShamis commented 3 years ago

I have identified the root cause and resolved the problem. It was due to the wrong GENESIS_CHALLENGE in harvester's config. When Spare blockchain release and update (re-launched), I only updated the farmer to save time. I didn't update the harvester configuration. After updating the harvester config with the correct GENESIS_CHALLENGE, the issue is now resolved. Thank you.