Proofgold Core 0.2.3 (Soft Fork, Stakers Should Update)

by BlakeKeiller, Wednesday, January 06, 2021, 12:27 (333 days ago)

Someone pointed out some potential issues with the staking algorithm. I think they're important enough to fix quickly and make public. The fixed staking code is part of the latest release (today):

https://proofgold.org/proofgold-core-0.2.3.tgz

1. There is an advantage to splitting assets into many smaller assets for staking. The main reason is that the staked asset will lose its age. If there are many small assets staking, then only that one loses its age while the others continue to gain age. This unfortunately incentivizes people to put many small locked assets into the ledger for staking. Since passing the initial pure burn stage of the blockchain, no one has staked with an asset smaller than 0.1 bars. The new code makes 0.1 bars a mandatory minimum for staking. This mandatory minimum will continue until Block 16000 at which time it will be raised to 1 bar, then after Block 18000 it will be raised to 10 bars and finally after Block 20000 it will be raised to 100 bars. This means no one should lock assets smaller than 0.1 for staking, and assets smaller than 100 bars should not be locked for longer than they will be allowed to stake.

2. There was a bug in the way age was calculated for previously locked assets. The "age" of post-locked (non-reward) assets was calculated as the difference between the current height and the height the asset unlocked. If such an asset is staked with (which happened sometimes, but not too often, less than 1% of the last 1000 blocks), then its new birthday would be greater than the height at with the asset unlocked. As a consequence such assets would not lose age when staked with. Even worse, this could be gamed by "locking" a new asset with a lock height 10000 blocks in the past and making it start with the maximum possible age. (No one was doing that, but I did an experiment to check that it was possible.)

I also made a third change: the maximum age for rewards and post-locked assets is now 5000 instead of 10000. The maximum age for locked non-reward assets (which age twice as fast) is still 10000. The intention is to make sure there is an incentive to lock assets for longterm staking.

Part of the soft fork happens immediately: any attempt to stake with an asset smaller than 0.1 bars will not be accepted. Since no one is doing this, it should not be visible. The modifications to the calculation of coinage for post-locked assets will begin at Block 5500, which should come within the next two weeks.

Stakers should update. If someone doesn't there is a chance they will stake a block considered invalid which will then be orphaned. This only applied to 1% of blocks in the last 1000, so it is not a huge risk.


Complete thread:

 RSS Feed of thread

powered by my little forum