From 5bde4ac9721f01592a0a51fca9d1ef6dfd70d376 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Tue, 10 Sep 2024 17:01:18 +0200 Subject: [PATCH 1/3] fix: attempt to fix panics for unresolvable imports by using GogoResolver --- .../27-interchain-accounts/host/keeper/keeper.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/modules/apps/27-interchain-accounts/host/keeper/keeper.go b/modules/apps/27-interchain-accounts/host/keeper/keeper.go index 479f1a12cf2..c44485c9077 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/keeper.go +++ b/modules/apps/27-interchain-accounts/host/keeper/keeper.go @@ -8,7 +8,6 @@ import ( gogoproto "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protodesc" "google.golang.org/protobuf/reflect/protoreflect" msgv1 "cosmossdk.io/api/cosmos/msg/v1" @@ -282,21 +281,8 @@ func (k Keeper) SetParams(ctx context.Context, params types.Params) { // newModuleQuerySafeAllowList returns a list of all query paths labeled with module_query_safe in the proto files. func newModuleQuerySafeAllowList() []string { - fds, err := gogoproto.MergedGlobalFileDescriptors() - if err != nil { - panic(err) - } - // create the files using 'AllowUnresolvable' to avoid - // unnecessary panic: https://github.com/cosmos/ibc-go/issues/6435 - protoFiles, err := protodesc.FileOptions{ - AllowUnresolvable: true, - }.NewFiles(fds) - if err != nil { - panic(err) - } - allowList := []string{} - protoFiles.RangeFiles(func(fd protoreflect.FileDescriptor) bool { + gogoproto.GogoResolver.RangeFiles(func(fd protoreflect.FileDescriptor) bool { for i := 0; i < fd.Services().Len(); i++ { // Get the service descriptor sd := fd.Services().Get(i) From 93670c5e0765f008fc84baacbfe22dcaca1c2c06 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Tue, 10 Sep 2024 21:30:20 +0200 Subject: [PATCH 2/3] chore: add changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92b06580dab..b2e42cca1be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* (apps/27-interchain-accounts) [\#7277](https://github.com/cosmos/ibc-go/pull/7277) Use `GogoResolver` when populating module safe query allow list to avoid panics from unresolvable protobuf dependencies. + ## v9.0.0 (unreleased) ### Dependencies From a1b7e762f978c160b3eb53063e040be3161639e4 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Tue, 10 Sep 2024 21:31:40 +0200 Subject: [PATCH 3/3] chore: amend changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2e42cca1be..1d9f6ec05b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,7 +59,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes -* (apps/27-interchain-accounts) [\#7277](https://github.com/cosmos/ibc-go/pull/7277) Use `GogoResolver` when populating module safe query allow list to avoid panics from unresolvable protobuf dependencies. +* (apps/27-interchain-accounts) [\#7277](https://github.com/cosmos/ibc-go/pull/7277) Use `GogoResolver` when populating module query safe allow list to avoid panics from unresolvable protobuf dependencies. ## v9.0.0 (unreleased)