Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/google.golang.org/grpc…
Browse files Browse the repository at this point in the history
…-1.66.1
  • Loading branch information
crodriguezvega committed Sep 11, 2024
2 parents dd6aff8 + 79ddda5 commit 3d18796
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,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 query safe allow list to avoid panics from unresolvable protobuf dependencies.

## v9.0.0 (unreleased)

### Dependencies
Expand Down
16 changes: 1 addition & 15 deletions modules/apps/27-interchain-accounts/host/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -276,21 +275,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)
Expand Down

0 comments on commit 3d18796

Please sign in to comment.