Closed littleskunk closed 5 years ago
Related code for this is around https://github.com/Storj/core/blob/master/lib/network/shard-server.js#L251
Wrong direction. For shard uploads the farmer is checking the shard hash and will send an failed report.
Shard downloads are here: https://github.com/Storj/core/blob/master/lib/network/shard-server.js#L362
Ah right... there may be a similar issue with uploads?
So to send an end
event is happening on the read stream in that case?
Shard uploads are checked in all directions. The farmer will not store more bytes than written in the contract. The farmer will not store any wrong shard hashes. That includes too small shards.
You are correct. For shard download we should already send the correct report here: https://github.com/Storj/core/blob/master/lib/network/shard-server.js#L429
I send the renter a message. Lets see what his plan was.
It doesn't look like an exchange report is sent with early termination https://github.com/Storj/core/blob/master/lib/network/shard-server.js#L425
_handleTransferFinish
in routeRetrieval
may need to track success status?
Oh nice one. That is a memory leak btw.
I found one on my logfile
{"level":"warn","message":"channel terminated early (possibly by client)","timestamp":"2017-10-02T22:44:03.555Z"}
In this case the exchange report is missing and I am not sure the transfered bytes will be deleted. That is a different issue for another day.
Now we are close to 100% sure that the problem is on the renter side. I will wait for the renter response but most likely close this issue.
I am fine with additional checks. As farmer I would prefer to avoid any false positives. It would be nice if the download would be counted as failed even if the renter behavior was strange. Long term this is better for a robust reputation system. What can we do if renter and farmer are sending different exchange reports? Better avoid that situation early.
The client may terminate the transfer if it's too slow, by the LOW_SPEED_LIMIT setting. So that could be a source of early termination, other than other network issues, or if the transfer is canceled.
I have only 7 downloads last month. 4 canceld by the renter at the 10 seconds mark. The other 3 successfully in less than 10 seconds. My first bet was the LOW_SPEED_LIMIT. However that would be a different issue. Lets focus on the this one.
There is no way I can deliver 5GB in 10 seconds. 3 times in a row. -> The renter closed the channel early.
My farmer was sending a SHARD_DOWNLOADED
for all 3.
I have an easy fix for this. The same way the shard upload is counting the transfered bytes I added a counter for the downloaded bytes. On closing the channel I compare the transfered bytes with the contract size.
{"level":"info","message":"Shard download started hash 588a3bd69f48401e66c5f6c4a1c2c9b7650e4e82 size 25000001","timestamp":"2018-04-02T02:02:34.195Z"}
{"level":"info","message":"Shard download failed hash 588a3bd69f48401e66c5f6c4a1c2c9b7650e4e82 size 14155776","timestamp":"2018-04-02T02:02:44.122Z"}
Should I open a pull request or is the farmer outdated anyway and we will not publish any improvements on the old network?
👋 Hey! Thanks for this contribution. Apologies for the delay in responding!
We've decided to rearchitect Storj, so that we can scale better. You can read more about this decision here. This means that we are entirely focused on v3 at the moment, in the storj/storj repository. Our white paper for v3 is coming very, very soon - follow along on the blog and in our Rocketchat.
As this repository is part of the v2 network, we're no longer maintaining this repository. I am going to close this for now. If you have any questions, I encourage you to jump on Rocketchat and ask them there. Thanks!
Package Versions
Replace the values below using the output from
npm list storj
. Usenpm list -g storj
if installed globally.Replace the values below using the output from
node --version
.Expected Behavior
Please describe the program's expected behavior. Include an example of your usage code in the back ticks below if applicable.
Actual Behavior
Please describe the program's actual behavior. Please include any stack traces or log output in the back ticks below.
Steps to Reproduce
Please include the steps the reproduce the issue, numbered below. Include as much detail as possible.