Skip to content

Commit 79ddda5

Browse files
authored
fix: attempt to fix panics for unresolvable imports by using GogoResolver (cosmos#7277)
* fix: attempt to fix panics for unresolvable imports by using GogoResolver * chore: add changelog * chore: amend changelog
1 parent 8628480 commit 79ddda5

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
@@ -61,6 +61,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
6161

6262
### Bug Fixes
6363

64+
* (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.
65+
6466
## v9.0.0 (unreleased)
6567

6668
### Dependencies

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

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

99
gogoproto "github.com/cosmos/gogoproto/proto"
1010
"google.golang.org/protobuf/proto"
11-
"google.golang.org/protobuf/reflect/protodesc"
1211
"google.golang.org/protobuf/reflect/protoreflect"
1312

1413
msgv1 "cosmossdk.io/api/cosmos/msg/v1"
@@ -276,21 +275,8 @@ func (k Keeper) SetParams(ctx context.Context, params types.Params) {
276275

277276
// newModuleQuerySafeAllowList returns a list of all query paths labeled with module_query_safe in the proto files.
278277
func newModuleQuerySafeAllowList() []string {
279-
fds, err := gogoproto.MergedGlobalFileDescriptors()
280-
if err != nil {
281-
panic(err)
282-
}
283-
// create the files using 'AllowUnresolvable' to avoid
284-
// unnecessary panic: https://github.com/cosmos/ibc-go/issues/6435
285-
protoFiles, err := protodesc.FileOptions{
286-
AllowUnresolvable: true,
287-
}.NewFiles(fds)
288-
if err != nil {
289-
panic(err)
290-
}
291-
292278
allowList := []string{}
293-
protoFiles.RangeFiles(func(fd protoreflect.FileDescriptor) bool {
279+
gogoproto.GogoResolver.RangeFiles(func(fd protoreflect.FileDescriptor) bool {
294280
for i := 0; i < fd.Services().Len(); i++ {
295281
// Get the service descriptor
296282
sd := fd.Services().Get(i)

0 commit comments

Comments
 (0)