persistenceOne/persistenceCore

AUDIT: InitGenesis with mainnet state break `x/distribution` invariant

Opened this issue · 0 comments

Description

I got this err when try to init new app with state that export from mainnet:

calculated final stake for delegator persistence1qxrztmfe2pevv8nam2znfe5p3eep3r4qv2n6nc greater than current stake final stake: 1.000000000000000000 current stake: 0.999900035965954883

This address is a validator, link: https://www.mintscan.io/persistence/validators/persistencevaloper1qxrztmfe2pevv8nam2znfe5p3eep3r4q9wn86p.

Problem Scenarios

This error coming from the CanWithdrawInvariant of the x/distribution module. It is a new invariant added in cosmos-sdk v47, maybe this error is a hidden bug from previous versions that has not been discovered until now. But this is a very dangerous error, which can lead to the chain being halted.

Recommendation

Since we don’t know specifically what’s causing this problem, we don’t have the best solution yet. But fortunately, this validator has been jailed and inactive for many years. We have a temporary solution to delete this validator from the validator set and also all related delegation entries.

Status

Its still pending, created issue link for people can track