gitlab.com/jokerrs1/Sia@v1.3.2/modules/renter/proto/consts.go (about) 1 package proto 2 3 import ( 4 "time" 5 6 "github.com/NebulousLabs/Sia/build" 7 "github.com/NebulousLabs/Sia/crypto" 8 "github.com/NebulousLabs/Sia/modules" 9 ) 10 11 const ( 12 // contractExtension is the extension given to contract files. 13 contractExtension = ".contract" 14 ) 15 16 var ( 17 // connTimeout determines the number of seconds the dialer will wait 18 // for a connect to complete 19 connTimeout = build.Select(build.Var{ 20 Dev: 10 * time.Second, 21 Standard: 60 * time.Second, 22 Testing: 5 * time.Second, 23 }).(time.Duration) 24 25 // hostPriceLeeway is the amount of flexibility we give to hosts when 26 // choosing how much to pay for file uploads. If the host does not have the 27 // most recent block yet, the host will be expecting a slightly larger 28 // payment. 29 // 30 // TODO: Due to the network connectivity issues that v1.3.0 introduced, we 31 // had to increase the amount moderately because hosts would not always be 32 // properly connected to the peer network, and so could fall behind on 33 // blocks. Once enough of the network has upgraded, we can move the number 34 // to '0.003' for 'Standard'. 35 hostPriceLeeway = build.Select(build.Var{ 36 Dev: 0.05, 37 Standard: 0.01, 38 Testing: 0.002, 39 }).(float64) 40 41 // sectorHeight is the height of a Merkle tree that covers a single 42 // sector. It is log2(modules.SectorSize / crypto.SegmentSize) 43 sectorHeight = func() uint64 { 44 height := uint64(0) 45 for 1<<height < (modules.SectorSize / crypto.SegmentSize) { 46 height++ 47 } 48 return height 49 }() 50 )