diff --git a/x/ibc/core/02-client/keeper/client.go b/x/ibc/core/02-client/keeper/client.go index fd9e0c63e4c8..e822402bfb3e 100644 --- a/x/ibc/core/02-client/keeper/client.go +++ b/x/ibc/core/02-client/keeper/client.go @@ -100,6 +100,9 @@ func (k Keeper) UpdateClient(ctx sdk.Context, clientID string, header exported.H // emit the full header in events var headerStr string if header != nil { + // Marshal the Header as an Any and encode the resulting bytes to hex. + // This prevents the event value from containing invalid UTF-8 characters + // which may cause data to be lost when JSON encoding/decoding. headerStr = hex.EncodeToString(types.MustMarshalHeader(k.cdc, header)) }