ibc-rs icon indicating copy to clipboard operation
ibc-rs copied to clipboard

bug(core): client creation only checks if the client is frozen

Open rnbguy opened this issue 1 year ago • 4 comments

Bug Summary

only non-frozen status is checked at client creation. we should just check if the client is active.

Details

https://github.com/cosmos/ibc-rs/blob/3b260e209ec6111c1dc2520d14f65fd605fdc834/ibc-core/ics02-client/src/handler/create_client.rs#L35

~should be refactored to if !status.is_active() { ... }.~

The status() is the status of the stored client state and its corresponding stored consensus state. So this doesn't include the provided ConsensusState. So its status needs to be checked locally.

IBC-go also checks for active status, instead of just non-frozen status.

Version

v0.50.0

rnbguy avatar Feb 13 '24 18:02 rnbguy

hi @Farhad-Shabani i have a PR fix this issues, please verify it https://github.com/cosmos/ibc-rs/pull/1098

hoank101 avatar Feb 22 '24 15:02 hoank101

cc @rnbguy

hoank101 avatar Feb 22 '24 15:02 hoank101

Hi @rnbguy, I'd like to continue working on this issue. Could you please provide some guidance on how I should approach resolving it? I'd really appreciate any insights or suggestions you have. Thanks!

The status() is the status of the stored client state and its corresponding stored consensus state. So this doesn't include the provided ConsensusState. So its status needs to be checked locally.

Does this means we need to also store the ConsensusState to the validation context?

tuantran1702 avatar May 08 '24 02:05 tuantran1702

Hey @tropicaldog, thanks for your interest.

Does this means we need to also store the ConsensusState to the validation context?

We don't modify the store in the validation step. The Context is passed as an immutable reference in the validation calls. This is a convention in ibc-rs.

The way I see it, we may have to modify the status method to take the latest ConsensusState. Since this is an API-breaking change, we need to decide on this internally.

rnbguy avatar May 10 '24 11:05 rnbguy