Skip to content

Commit 738b3f6

Browse files
committed
Patch for Osmosis v6.
We basically say that if we are past the upgrade height, do correct logic (from before). If we are not, just always panic with the same message we used to get.
1 parent e1ac41a commit 738b3f6

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

modules/core/02-client/keeper/keeper.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,19 @@ func (k Keeper) ValidateSelfClient(ctx sdk.Context, clientState exported.ClientS
307307
return sdkerrors.Wrapf(types.ErrInvalidClient, "trust-level invalid: %v", err)
308308
}
309309

310-
expectedUbdPeriod := k.stakingKeeper.UnbondingTime(ctx)
311-
if expectedUbdPeriod != tmClient.UnbondingPeriod {
312-
return sdkerrors.Wrapf(types.ErrInvalidClient, "invalid unbonding period. expected: %s, got: %s",
313-
expectedUbdPeriod, tmClient.UnbondingPeriod)
310+
// Osmosis v6 patch. If height > 300, do correct logic on fixed app.go
311+
// Prior to fork height, we panic with the same error we were getting before.
312+
if ctx.BlockHeight() > 300 {
313+
expectedUbdPeriod := k.stakingKeeper.UnbondingTime(ctx)
314+
if expectedUbdPeriod != tmClient.UnbondingPeriod {
315+
return sdkerrors.Wrapf(types.ErrInvalidClient, "invalid unbonding period. expected: %s, got: %s",
316+
expectedUbdPeriod, tmClient.UnbondingPeriod)
317+
}
318+
} else {
319+
// Do the old panic, of just saying its not found.
320+
// Panic came from here: https://github.com/cosmos/cosmos-sdk/blob/d0f64dff2cc370b876c82244bd46b61872d6ffa5/x/params/types/subspace.go#L170
321+
key := "UnbondingTime"
322+
panic(fmt.Sprintf("parameter %s not registered", key))
314323
}
315324

316325
if tmClient.UnbondingPeriod < tmClient.TrustingPeriod {

0 commit comments

Comments
 (0)