Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
antstalepresh committed Jul 25, 2023
1 parent 666c345 commit f65ab21
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/staking/keeper/val_state_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate {
// unbonded after the Endblocker (go from Bonded -> Unbonding during
// ApplyAndReturnValidatorSetUpdates and then Unbonding -> Unbonded during
// UnbondAllMatureValidatorQueue).
fmt.Println("============== staking => BlockValidatorUpdates called=============")
validatorUpdates, err := k.ApplyAndReturnValidatorSetUpdates(ctx)
if err != nil {
panic(err)
Expand Down Expand Up @@ -126,6 +127,7 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab
iterator := k.ValidatorsPowerStoreIterator(ctx)
defer iterator.Close()

fmt.Println("============== staking => ApplyAndReturnValidatorSetUpdates called =============, maxValidators: ", maxValidators)
for count := 0; iterator.Valid() && count < int(maxValidators); iterator.Next() {
// everything that is iterated in this loop is becoming or already a
// part of the bonded validator set
Expand All @@ -136,12 +138,14 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab
panic("should never retrieve a jailed validator from the power store")
}

fmt.Println("============== staking => ApplyAndReturnValidatorSetUpdates called1 =============, valAddr: ", valAddr)
// if we get to a zero-power validator (which we don't bond),
// there are no more possible bonded validators
if validator.PotentialConsensusPower(k.PowerReduction(ctx)) == 0 {
break
}

fmt.Println("============== staking => ApplyAndReturnValidatorSetUpdates called2 =============")
// apply the appropriate state change if necessary
switch {
case validator.IsUnbonded():
Expand Down

0 comments on commit f65ab21

Please sign in to comment.