Skip to content

Commit 34a0d01

Browse files
fix: attempt to fix panics for unresolvable imports by using GogoResolver (backport #7277) (#7281)
* fix: attempt to fix panics for unresolvable imports by using GogoResolver (#7277) * fix: attempt to fix panics for unresolvable imports by using GogoResolver * chore: add changelog * chore: amend changelog (cherry picked from commit 79ddda5) # Conflicts: # CHANGELOG.md * chore: address merge conflicts in changelog --------- Co-authored-by: Damian Nolan <[email protected]>
1 parent 94c9773 commit 34a0d01

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
4848

4949
### Bug Fixes
5050

51+
* (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.
52+
5153
## [v8.5.0](https://github.com/cosmos/ibc-go/releases/tag/v8.5.0) - 2024-08-30
5254

5355
### Dependencies

modules/apps/27-interchain-accounts/host/keeper/keeper.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77

88
gogoproto "github.com/cosmos/gogoproto/proto"
99
"google.golang.org/protobuf/proto"
10-
"google.golang.org/protobuf/reflect/protodesc"
1110
"google.golang.org/protobuf/reflect/protoreflect"
1211

1312
msgv1 "cosmossdk.io/api/cosmos/msg/v1"
@@ -283,21 +282,8 @@ func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
283282

284283
// newModuleQuerySafeAllowList returns a list of all query paths labeled with module_query_safe in the proto files.
285284
func newModuleQuerySafeAllowList() []string {
286-
fds, err := gogoproto.MergedGlobalFileDescriptors()
287-
if err != nil {
288-
panic(err)
289-
}
290-
// create the files using 'AllowUnresolvable' to avoid
291-
// unnecessary panic: https://github.com/cosmos/ibc-go/issues/6435
292-
protoFiles, err := protodesc.FileOptions{
293-
AllowUnresolvable: true,
294-
}.NewFiles(fds)
295-
if err != nil {
296-
panic(err)
297-
}
298-
299285
allowList := []string{}
300-
protoFiles.RangeFiles(func(fd protoreflect.FileDescriptor) bool {
286+
gogoproto.GogoResolver.RangeFiles(func(fd protoreflect.FileDescriptor) bool {
301287
for i := 0; i < fd.Services().Len(); i++ {
302288
// Get the service descriptor
303289
sd := fd.Services().Get(i)

0 commit comments

Comments
 (0)