diff --git a/CHANGELOG.md b/CHANGELOG.md index 71629f83a02..a227e2ccf2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -130,6 +130,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (modules/core/02-client)[\#1676](https://github.com/cosmos/ibc-go/pull/1676) ClientState must be zeroed out for `UpgradeProposals` to pass validation. This prevents a proposal containing information governance is not actually voting on. * (modules/core/keeper) [\#2403](https://github.com/cosmos/ibc-go/pull/2403) Added a function in keeper to cater for blank pointers. * (modules/core/keeper) [\#2745](https://github.com/cosmos/ibc-go/pull/2745) Fix request wiring for `UpgradedConsensusState` in core query server. +* (core/02-client) [\#2510](https://github.com/cosmos/ibc-go/pull/2510) Fix client ID validation regex to conform closer to spec. ## [v5.1.0](https://github.com/cosmos/ibc-go/releases/tag/v5.1.0) - 2022-11-09 diff --git a/modules/core/02-client/types/keys.go b/modules/core/02-client/types/keys.go index 919f91f9ebe..edb42f75ae9 100644 --- a/modules/core/02-client/types/keys.go +++ b/modules/core/02-client/types/keys.go @@ -36,6 +36,8 @@ func FormatClientIdentifier(clientType string, sequence uint64) string { // parsing client identifiers. The client identifier must be in the form: `{client-type}-{N} // which per the specification only permits ASCII for the {client-type} segment and // 1 to 20 digits for the {N} segment. +// `([\w-]+\w)?` allows for a letter or hyphen, with the {client-type} starting with a letter +// and ending with a letter, i.e. `letter+(letter|hypen(letter))?`. var IsClientIDFormat = regexp.MustCompile(`^\w+([\w-]+\w)?-[0-9]{1,20}$`).MatchString // IsValidClientID checks if the clientID is valid and can be parsed into the client