Closed angbrav closed 11 months ago
During our last meeting, we discussed whether keeping deltas instead of absolute stake values may simplify the design. Some context:
>= cur_epoch + PIPELINE_OFFSET
. There are a few reasons to do so, the most obvious one being that since we keep absolute values, we need to subtract the slashed amount from all epochs.cur_epoch+1
in the stake map if we maintain deltas?My answer after some thinking:
>= cur_epoch + PIPELINE_OFFSET
to deal with unbonds. A simple example:
e
.X
tokens at e
and that the slash rate is 1
for simplicity.e
.X
tokens at cur_epoch + 1
.X
tokens before the evidence was found, i.e, before the validator was jailed, then we may need to update an epoch >cur_epoch + 1
in the stake's map to compensate, even if the map keeps deltas.cur_epoch + 2 - PIPELINE_OFFSET
, i.e, the tokens are effectively unbonded at cur_epoch + 2
. Then, if we only update epoch cur_epoch + 1
when slashing, the validator will end up with a negative stake at cur_epoch + 2
: stake[e]=X + stake[cur_epoch + 1]=-X + stake[cur_epoch + 2]=-0.5*X = -0.5*X
Agreed to revisit it later
Not planning to do it.
The stake map in the Quint spec maps epochs to stake while total_deltas in Namada maps epochs to deltas.