SiaFoundation/web

Weird behavior of the Autopilot page

Closed this issue · 1 comments

On the first startup, the Estimates are not populated and show "0.00 TiB". It's not possible to enter any value below 1 TiB, nor any fractional value at all, although there would be a lot of value in such a feature, because not every renter would want to store as much as 1 TiB right away.
Also, on the first startup, the Target Price field is populated with the value of "1,024,000 SC" (4K USD). It is also possible to edit this field, although I guess it should be read-only (if I make any changes they don't affect the number of changes made to the form, and it's not possible to save).
If I set the Estimates to 0 and save the form, on the next autopilot iteration I get a panic:


goroutine 133 [running]:
math/big.(*Rat).SetFrac(0x1bc16d674ec80000?, 0x0?, 0x121beab47?)
	/usr/local/go/src/math/big/rat.go:307 +0x38d
go.sia.tech/renterd/autopilot.collateralScore({{0x0}, {0x0, 0x150, 0x0}, {{0xc000ab7720, 0x9}, 0x32, {0x9fd0803ce8000000, 0x33b2e3c}, 0x3f0, ...}}, ...)
	.../renterd/autopilot/hostscore.go:158 +0x285
go.sia.tech/renterd/autopilot.hostScore({{0x0}, {0x0, 0x150, 0x0}, {{0xc000ab7720, 0x9}, 0x32, {0x9fd0803ce8000000, 0x33b2e3c}, 0x3f0, ...}}, ...)
	.../renterd/autopilot/hostscore.go:30 +0x2e5
go.sia.tech/renterd/autopilot.isUsableHost({{0x0}, {0x0, 0x150, 0x0}, {{0xc000ab7720, 0x9}, 0x32, {0x9fd0803ce8000000, 0x33b2e3c}, 0x3f0, ...}}, ...)
	.../renterd/autopilot/hostfilter.go:208 +0xd4c
go.sia.tech/renterd/autopilot.(*contractor).candidateHosts(0xc000aea280, {0x1d?, 0x0?}, {0x5a5?, 0xc002870948?}, {0xc000824000, 0x2c1, 0xc002870948?}, 0x41f1ab?, 0xc0001e00f0, ...)
	.../renterd/autopilot/contractor.go:998 +0x9bb
go.sia.tech/renterd/autopilot.(*contractor).managedFindMinAllowedHostScores(0xc000aea280, {0x15a8bd0, 0xc002897ec0}, {0x15ae9e8, 0xc000ad3230}, {0xc000824000, 0x2c1, 0x2c7}, 0x2?)
	.../renterd/autopilot/contractor.go:924 +0x13c
go.sia.tech/renterd/autopilot.(*contractor).performContractMaintenance(0xc000aea280, {0x15a8bd0?, 0xc002896f60?}, {0x15ae9e8, 0xc000ad3230})
	.../renterd/autopilot/contractor.go:294 +0xcab```

Thank you for all your testing and detailing of issues both here and on discord. We have made a series of revisions and updates, these should be fixed, please report back if have introduced any new bugs 😄. If you still see the zero panic running the latest software, please open an issue on the renterd side. 🚀