I'm trying to understand the following behaviour:
- A user delegates their vote (X DOT) with 1x conviction
- Then they change their delegation to a smaller amount (Y DOT) with the same 1x convinction
- Then they undelegate (at time t)
- Before the lock period expires, they delegate Y DOT again with 1x conviction and then undelegate them once more (at time t1)
The apparent result is that the lock period of the initial amount (X DOT) is "reset" when they undelegated the second time. So, X DOT is locked for t1 + 28 days, not t + 28 days, as one would expect.
This is defined in chain state, by prior
, when querying democracy.votingOf
If I understand the prior.accumulate
function correctly that does this here, it locks the max amount for the max length, effectively perpetuating the initial lock in the above scenario.
Is this correct? Is this a feature or a bug? If it's a feature, what's the reasoning behind it?