Concordium / concordium-node

The main concordium node implementation.
GNU Affero General Public License v3.0
45 stars 22 forks source link

Protocol update prolongs baker cooldown #225

Closed td202 closed 2 years ago

td202 commented 2 years ago

Bug Description

For the existing protocol updates (P1 to P2, P2 to P3), bakers that are in a cooldown period during the protocol update will have their cooldown period (significantly) extended after the protocol update. This is caused by the following:

In practice, this means that a baker that deregisters or reduces stake within 1 week (the current cooldown period) before a protocol update will have to wait for an additional length of time equal to the time between the protocol update and the previous protocol update (or the start of the chain).

Steps to Reproduce Reduce stake or unregister a baker less than one week before a protocol update.

Expected Result The baker's cooldown expires one week later, and the appropriate funds are unlocked.

Actual Result The baker's cooldown does not expire and the funds remain locked for a prolonged period.

Versions

td202 commented 2 years ago

Since the current pool of bakers is relatively small, I think we can mitigate the issue for the P2 to P3 (Alpha Centauri 3.0) update by advising all bakers not to reduce or unregister within the week before a planned protocol update, rather than making a change to the protocol update (or the protocol).

For the P4 protocol version, we should change the way that cooldown expiry is represented to an absolute time. This would then have a stable meaning after a subsequent protocol update. The migration to P4 would convert the epoch expiry to an absolute expiry time.

abizjak commented 2 years ago

My recollection is that this has been fixed by the #253 PR. Is this correct @td202 ? If so, please close this issue.

td202 commented 2 years ago

253 does fix this, converting cooldown times to absolute times.