More collateral locked than expected
-
I'm currently trying to run a host and it seems that it's working and even got a few contracts, though I'm not sure what are they in terms of duration/size.
I configured a small storage folder. In fact, 2 of them, because there seems to be no way to delete the configured folder using interface and I'm not sure if manually editing config is OK. Anyway, total size is 135 (35+100) GB. I set "collateral" value to 10001 SC (with 95% uptime I do not consider my host to be that-much-reliable for higher values), so I expected a maximum of 0.135*10001=1350.135SC locked, but I got locked significantly more, see transactions
http://explore.sia.tech/hash.html?hash=bd60465b81b1c233da050c54261f63ec939cc1559188d957e53e96a69f32fac4
http://explore.sia.tech/hash.html?hash=1a813b707c182fe9ca8fc4e6d186e9e1173e12649cecae25243b56b0eeefe6d5Here is what settings in host.json look like:
"Settings": {
"acceptingcontracts": true,
"maxduration": 25920,
"maxdownloadbatchsize": 17825792,
"maxrevisebatchsize": 17825792,
"netaddress": "",
"windowsize": 144,
"collateral": "10001000000000000",
"collateralbudget": "20000000000000000000000000000",
"maxcollateral": "5000000000000000000000000000",
"downloadlimitgrowth": 0,
"downloadlimitcap": 0,
"downloadspeedlimit": 0,
"uploadlimitgrowth": 0,
"uploadlimitcap": 0,
"uploadspeedlimit": 0,
"contractprice": "0",
"minimumdownloadbandwidthprice": "20000000000000000",
"storageprice": "923611111111",
"minimumuploadbandwidthprice": "0"
},
OS is Windows 8.1, siad/siac version is 0.6.Am I misunderstanding something or is this a bug?
-
Also, "storageprice" looks suspicious. Here's what I did for configuration:
J:\Sia-v0.6.0-beta-windows-amd64>siac host config minimumcontractprice 0SC
Host settings updated.J:\Sia-v0.6.0-beta-windows-amd64>siac host config minimumdownloadbandwidthprice 20000SC
Host settings updated.J:\Sia-v0.6.0-beta-windows-amd64>siac host config minimumuploadbandwidthprice 0SC
Host settings updated.J:\Sia-v0.6.0-beta-windows-amd64>siac host config minimumstorageprice 3990SC
Host settings updated.J:\Sia-v0.6.0-beta-windows-amd64>siac host config collateralbudget 20000SC
Host settings updated.J:\Sia-v0.6.0-beta-windows-amd64>siac host config maxcollateral 5000SC
Host settings updated.J:\Sia-v0.6.0-beta-windows-amd64>siac host config collateral 10001SC
Host settings updated.
-
You're going to have an easier time if you are looking at the siac output.
The collateral value you set is '10,001' SC per TB, which means if a renter is planning on uploading multiple TBs you will put up more collateral than 10,000 SC. It's worth noting though that unless the renter actually uploads that many TBs, you are not on the hook for that collateral. You will get all of your collateral back (even if you fail!) if the renter never uploads anything. And if they only upload a little, you will only be penalized a little if you fail the storage proof.
the unit for everything coming out of the json is 'hastings'. There are 10^24 hastings in a siacoin. The price for 'storageprice' is in hastings per byte per block, but the price you set was 3990SC per terabyte per month. The units are very different, which is why the numbers are so different.
Hope that helps.
-
You're going to have an easier time if you are looking at the siac output.
Thanks, I didn't find the helpful "siac host" output before this note.
The question is why I have 6649 SC collateral locked? For that I should have received 664.9 GB worth of contracts, but I have shared only 135 GB of storage . I don't think that should be possible.
Storage: 135.000 GB (8.39 MB used) Price: 3.99 KS / TB / Month Max Duration: 25920 Blocks Accepting Contracts: Yes Anticipated Revenue: 8.635 mS Locked Collateral: 6.649 KS Risked Collateral: 93.5 SC Revenue: 0 H Lost Revenue: 0 H Lost Collateral: 0 HAnother suspicious thing is that, to my understanding,
Risked Collateral = Collateral * Used Storage
but actually:
93.5 SC = 10001 SC/TB * 0.00000839 TB
The difference from expectancy is about 10^3. Is "collateral" actually per GB, not TB?
-
You are conflating 'risked collateral' with 'locked collateral'. You lock up the collateral before you get the storage, this needs to happen this way for scalability reasons. Only the 'risked collateral' is at risk. You've got more locked collateral than you have storage available because multiple renters have made contracts which would potentially allow them to use up your whole drive. Obviously you can only follow through with a few of them, but you aren't sure which ones are going to follow through so you overbook somewhat. This is okay - the renters can make more contracts in the future with other hosts.
I believe that there is also a bug with v0.6.0 which has already been fixed on the master branch, where collateral is not being calculated correctly by
siac. v.1.0.0 should have this fix.Thanks for asking these questions, good to see that people are paying attention to the collateral component, it's very important. Future versions will have better collateral management so that the host is less likely to overbook their storage by such a huge factor.
-
So that's indeed 650 GB of contracts for 135 GB of storage. That explains it, thank you.
I understand the difference between "risked collateral" and "locked collateral", i mention both only because the "collateral" setting applies to both and if there is something unexpected with it it may come up in both cases.
Is there currently a limit for overbooking at all? I thought that 5-fold overbooking is already big, but there seem to be another 5 kSC locked since I last checked, so that's more than 1 TB contracts for only 135 GB of storage...
-
After some more reading I got more confused about the collateral calculation. Does the locked collateral depend on contract duration? Per "siac host config -h" output it should not, as the setting is in currency/TB. However, in API.md I found that "'collateral' is the number of hastings per byte per block" so the locked collateral does depend on the contract duration.
The more I try to understand the collateral and revenue calculations, the more I think that there should be some model contract example with coin transfer/lock/unlock amounts calculated and explained. I might write it myself to be corrected in what I misunderstand. But that's when (if?) I get a little more clarity.