diff --git a/x/tx/CHANGELOG.md b/x/tx/CHANGELOG.md index 92245db8f77b..7120fe357497 100644 --- a/x/tx/CHANGELOG.md +++ b/x/tx/CHANGELOG.md @@ -33,6 +33,12 @@ Since v0.13.0, x/tx follows Cosmos SDK semver: https://github.com/cosmos/cosmos- ## [Unreleased] +## [v1.0.0-alpha.3](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v1.0.0-alpha.3) - 2024-12-12 + +### Bug Fixes + +* [#22852](https://github.com/cosmos/cosmos-sdk/pull/22852) Fallback to injected resolver for placeholder descriptors. + ## [v1.0.0-alpha.2](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v1.0.0-alpha.2) - 2024-11-01 * [#22311](https://github.com/cosmos/cosmos-sdk/pull/22311) Fix add feePayer as signer. diff --git a/x/tx/decode/unknown.go b/x/tx/decode/unknown.go index fed2c1be8ff8..cd0ed0ba7aa1 100644 --- a/x/tx/decode/unknown.go +++ b/x/tx/decode/unknown.go @@ -82,6 +82,17 @@ func RejectUnknownFields(bz []byte, desc protoreflect.MessageDescriptor, allowUn if fieldMessage == nil { continue } + // if a message descriptor is a placeholder resolve it using the injected resolver. + // this can happen when a descriptor has been registered in the + // "google.golang.org/protobuf" resgistry but not in "github.com/cosmos/gogoproto". + // fixes: https://github.com/cosmos/cosmos-sdk/issues/22574 + if fieldMessage.IsPlaceholder() { + gogoDesc, err := resolver.FindDescriptorByName(fieldMessage.FullName()) + if err != nil { + return hasUnknownNonCriticals, fmt.Errorf("could not resolve placeholder descriptor: %v: %w", fieldMessage, err) + } + fieldMessage = gogoDesc.(protoreflect.MessageDescriptor) + } // consume length prefix of nested message _, o := protowire.ConsumeVarint(fieldBytes)