forbole / callisto

Callisto (formerly BDJuno) is the official Juno implementation for Big Dipper, the open-source block explorer for Cosmos
https://bigdipper.live
MIT License
90 stars 241 forks source link

Impossible to have staking/validator duplicated `operator address` address #673

Open dzmitryhil opened 10 months ago

dzmitryhil commented 10 months ago
## Bug description

It is possible to have two validators one Jailed and one Active with different consensus addresses but the same operator address. Becasue the DB table validator_info contains the unique modifier for the operator_address .

Steps to reproduce

* Create a validator with `pub key 1`, `operator address 1`, and `self delegate address 1` * Stop the validator and let it be jailed * Undelegate from the validator * Run BDJuno and let it sync the data (and keep it running) * Create a validator with `pub key 2`, `operator address 1`, and `self delegate address 1` * Check BDJuno logic the `violates unique constraint "validator_info_operator_address_key"` error will there * Try to update validators state using the cli `bdjuno parse staking validators --home .bdjuno`, the same error will error out. ## Expected behavior

The BDJuno should save both validators.