cosmos / interchain-security

Interchain Security is an open sourced IBC application which allows cosmos blockchains to lease their proof-of-stake security to one another.
https://cosmos.github.io/interchain-security/
Other
156 stars 126 forks source link

Use consumer UnbondingTime in the tests #153

Closed sainoe closed 2 years ago

sainoe commented 2 years ago

Consumer chain clients should be initialized using the UnbondingTime value rather than using the default IBC-GO testing value.

https://github.com/cosmos/interchain-security/blob/404529c8866c007bb02ba1309a249e369979486f/x/ccv/provider/provider_test.go#L92

NewPath

func NewPath(chainA, chainB *TestChain) *Path {
    endpointA := NewDefaultEndpoint(chainA)
    endpointB := NewDefaultEndpoint(chainB)
...
}

The following ibc-go condition makes the tests fail when these values aren't equal :

expectedUbdPeriod := k.stakingKeeper.UnbondingTime(ctx)
if expectedUbdPeriod != tmClient.UnbondingPeriod {
return sdkerrors.Wrapf(types.ErrInvalidClient, "invalid unbonding period. expected: %s, got: %s",
    expectedUbdPeriod, tmClient.UnbondingPeriod)
}
mpoke commented 2 years ago

@sainoe Shouldn't https://github.com/cosmos/interchain-security/pull/144 solve this issue?

sainoe commented 2 years ago

No it won't. #144 addresses how the UnbondingTime value is computed and then stored in the consumer states. However this value will still be compared to the consumer client default config which is hardcoded to a 3 weeks duration in the IBC-GO tests. line