Closed dooglus closed 4 years ago
dooglus stop orphaning my blocks smh
I was hearing that solo-staking was very hard due to Just-Dice's staking wallet orphaning people's blocks, so I set up an experiment.
I made a new wallet and sent 10,000 CLAM to it, split into 100 CLAM pieces.
I wanted to see how well it staked, and how much it would be orphaned by the Just-Dice staking wallet.
Here's the wallet so you can check for yourself how it's getting on.
So far it has been staking for 5.73 days. In that time it has staked 57 times, and of those 57 blocks 6 have been orphaned. That's 10.5% of the staked blocks which were orphaned.
The remaining 51 successful stakes in 5.73 days mean that when solo-staking you need 1123.46 CLAM to stake once per day.
Over the last 5 days Just-Dice has staked 1313.6621 + 1288.7924 + 1323.2905 + 1301.2370 + 1283.4634 = 6510.4454 CLAMs. JD is staking roughly 1575000 CLAMs.
Those numbers suggest that on JD you need 1575000 / 6510.4454 * 5 = 1209.59 CLAM to stake once per day, and so over the last 5 days it has actually been better to solo stake than to stake at JD. That's not even taking JD's 10% staking commission into account.
This is likely the result of short-term variance. I can't believe that it is more efficient to solo-stake than to use the JD wallet. I'll report back in a week or so.
Edit: raw data from the 10k solo-staking wallet:
staked 51 times in 5.73 days; need 1123.46 coins to stake once per day
staked 54 times in 5.84 days; need 1081.01 coins to stake once per day
staked 57 times in 6.00 days; need 1053.30 coins to stake once per day
staked 57 times in 6.52 days; need 1143.49 coins to stake once per day
staked 61 times in 7.48 days; need 1226.05 coins to stake once per day
staked 65 times in 7.96 days; need 1224.15 coins to stake once per day
staked 79 times in 9.43 days; need 1193.23 coins to stake once per day
staked 81 times in 10.10 days; need 1246.65 coins to stake once per day
staked 91 times in 11.35 days; need 1247.38 coins to stake once per day
staked 96 times in 12.33 days; need 1284.26 coins to stake once per day
staked 100 times in 12.94 days; need 1293.59 coins to stake once per day
staked 103 times in 13.50 days; need 1310.49 coins to stake once per day
staked 110 times in 14.46 days; need 1314.56 coins to stake once per day
staked 145 times in 18.33 days; need 1263.87 coins to stake once per day
staked 149 times in 19.31 days; need 1296.09 coins to stake once per day
staked 164 times in 21.29 days; need 1297.97 coins to stake once per day
staked 171 times in 22.42 days; need 1310.90 coins to stake once per day
staked 180 times in 23.36 days; need 1297.83 coins to stake once per day
staked 192 times in 25.00 days; need 1302.24 coins to stake once per day
staked 200 times in 26.34 days; need 1317.12 coins to stake once per day
staked 213 times in 28.31 days; need 1329.07 coins to stake once per day
staked 228 times in 30.29 days; need 1328.37 coins to stake once per day
staked 553 times in 75.68 days; need 1368.55 coins to stake once per day
Thank you @dooglus for always "proving" being trust worthy (even though I was joking before, I still really appreciate your messages)
I posted mostly because I wanted somewhere to log the results of the experiment I'm running. It's out of place in this issue, but whatever. :)
I posted mostly because I wanted somewhere to log the results of the experiment I'm running. It's out of place in this issue, but whatever. :)
I'd suggest adding such information to the wiki here on github, where it will stay available even after this issue is closed.
I've been using this branch for a month on a wallet with no coin in the wallet, and it's not corrupt. The diff compared to master is pretty long, so it's hard to guess where the problem could be.
I'm not entirely sure where the logic error is yet, but the block of code I believe we will find it is @ https://github.com/nochowderforyou/clams/blob/2.0.0-rc1/src/main.cpp#L3075-L3114
I was switching between different wallet.dat files when I saw the corruption. It often seemed to want to reindex (or rescan, I forget) around half the chain when I switched, even though the wallet had recently been used. I don't know if that's related. The time my wallet got corrupted I had done a hard "kill -9" on the clam process because it was going to take hours to do what seemed to be an unnecessary rescan.
It looks to me like the issue could be happening due to this commit: c940461
If you look at the same function in the rat4's master branch here there are some comments which suggest not changing chain data in ram at the loading stage:
// Update block index on disk without changing it in memory.
// The memory index structure will be changed after the db commits.
My hunch is that it's not happening for me because there's no stake transactions in my wallet, but I'm not entirely sure.
Closing issue, unrelated to client v2.1.0
I've been switching between versions of clamd and somehow corrupted my blockchain.
I ended up deleting all the block indexes and trying to start again, using the existing blk000n.dat files as a bootstrap.dat. I made a bootstrap.dat file like this:
then left clamd processing the file overnight.
In the morning clamd was dead. I tried restarting it, bu after skipping all the blocks it had already processed:
I don't know what was going on there. All the following blocks were seen as 'orphan block 0'.
I stopped it, moved the bootstrap.dat file out of the way, restart it, let it connect to a peer, and that got it past the sticking point. Stopped it again, put the bootstrap.dat file back in place, and it was able to continue loading from it, until: