Skip to content

Commit

Permalink
fix: validator.Jailed continue instead of panic
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Apr 22, 2024
1 parent bb9f451 commit 0898425
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .gitpatches/staking_poa-skip-jailed-validators.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/x/staking/keeper/val_state_change.go b/x/staking/keeper/val_state_change.go
index 444633983c..cb5d01f7eb 100644
--- a/x/staking/keeper/val_state_change.go
+++ b/x/staking/keeper/val_state_change.go
@@ -159,7 +159,9 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx context.Context) (updates
validator := k.mustGetValidator(ctx, valAddr)

if validator.Jailed {
- panic("should never retrieve a jailed validator from the power store")
+ // https://github.com/cosmos/cosmos-sdk/pull/20059
+ // panic("should never retrieve a jailed validator from the power store")
+ continue
}

// if we get to a zero-power validator (which we don't bond),
4 changes: 3 additions & 1 deletion x/staking/keeper/val_state_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx context.Context) (updates
validator := k.mustGetValidator(ctx, valAddr)

if validator.Jailed {
panic("should never retrieve a jailed validator from the power store")
// https://github.com/cosmos/cosmos-sdk/pull/20059
// panic("should never retrieve a jailed validator from the power store")
continue
}

// if we get to a zero-power validator (which we don't bond),
Expand Down

0 comments on commit 0898425

Please sign in to comment.