Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Sia doubles storage contracts prematurely #2769

mtlynch opened this issue Feb 16, 2018 · 4 comments

Sia doubles storage contracts prematurely #2769

mtlynch opened this issue Feb 16, 2018 · 4 comments


Copy link

mtlynch commented Feb 16, 2018


How to reproduce it (as minimally and precisely as possible)

  1. Deposit 500 SC into Sia wallet
  2. Set allowance of 500 SC for 12w
  3. Wait for 50 contracts to form
  4. Upload 300 GiB of data to Sia, 5 files at a time

Instructions for repro with the tools I used are as follows:


# Generate data to upload
BYTES_PER_FILE=10737418240 # 10 GiB
TOTAL_SIZE=322122547200 # 300 GiB

git clone
pushd dummy_file_generator
python dummy_file_generator/ \
  --size_per_file $BYTES_PER_FILE \
  --total_size $TOTAL_SIZE \
  --output_prefix "${DATA_DIR}/dummy-file-

# Upload to Sia

git clone
pushd sia_load_tester
pip install -r requirements.txt
python sia_load_tester\ \
  --dataset_root $DATA_DIR \
  --output_dir OUTPUT_DIR

Expected Behavior

Sia does not invest more into contracts until its existing 50 contracts are exhausted.

Actual Behavior

Sia maintains its initial set of 50 contracts, but increases spending in most of them, wasting renter funds.


More data:



  • Sia version: 1.3.1
  • OS: Windows 10 x64
@tbenz9 tbenz9 added the Bug label Feb 16, 2018
Copy link

tbenz9 commented Apr 19, 2018

It might be useful to track the number of contracts as well. It's possible that this issue is related to #2938

Copy link
Contributor Author

mtlynch commented Apr 19, 2018

Contract count is in the spreadsheet data. After the initial 50 contracts, contract increases to 51 at 5h7m, then 52 contracts at 15h56m. Test ended with a contract count of 52.

Copy link

I'm still not convinced this one in particular is a bug. Sia renews contracts as they fill up, and there will be a tendency (especially during your first renew cycle) for the faster and better hosts to fill up sooner. Future cycles (after your first 12 weeks) should see less turbulence.

When you create an allowance of X, only X/3 gets spent in the first round, because we don't know which hosts are going to be the good ones. If we knew, we'd spend the full X right away, but historically when Sia did that (a few versions ago), you'd end up with 0 money in the contracts with the best hosts, and the worst hosts would bottleneck your upload speeds substantially.

Copy link
Contributor Author

mtlynch commented Apr 20, 2018

Closing as it sounds like this behavior is WAI.

@mtlynch mtlynch closed this as completed Apr 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

3 participants