Cosmos-sdk: gRPC Gateway Anomalies

Created on 17 Aug 2020  Â·  9Comments  Â·  Source: cosmos/cosmos-sdk

Summary of Bug

Noticed while working on https://github.com/cosmos/cosmos-sdk/pull/7070, executing $ proto-gen generates diffs for gateway-related compiled files.

Version

sdk: master (as of 77124da21)
protoc-gen-grpc-gateway: Version 1.14.7, commit 37837bc5882204897dfb5b17ee231fc645c9102d, built at 2020-08-12T08:49:14Z
protoc: libprotoc 3.11.2

Steps to Reproduce

  1. Execute $ proto-gen
  2. Review diff

/cc @anilCSE @aaronc @sahith-narahari


For Admin Use

  • [ ] Not duplicate issue
  • [ ] Appropriate labels applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned
gRPC

Most helpful comment

Screen Shot 2020-08-17 at 7 08 27 PM

The staking.pb.go is something I have noticed being changed. I ran it earlier and also observed changes. All the gw.go is removing a comment or two.

When running make proto-gen I get these errors as well:

W0817 19:09:17.479607   91564 services.go:38] No HttpRule found for method: ReflectionService.ListAllInterfaces
W0817 19:09:17.479726   91564 services.go:38] No HttpRule found for method: ReflectionService.ListImplementations
W0817 19:09:19.848090   91669 services.go:38] No HttpRule found for method: Service.Simulate

my protoc version is libprotoc 3.12.4

All 9 comments

Does the protocgen script need to generate the grocery-gateway and the proto stubs? There is a pr to add swagger gen to it as well. I feel its getting a bit bloated.

Now contributors need to download 2+ more tools in order to work with proto..

No idea? But it would be nice to have all proto-related generation happen in one go (which can be broken down into sub-targets).

Now contributors need to download 2+ more tools in order to work with proto..

Only if they're making proto changes.

Idk, maybe this issue can be closed? Just pointing out the diff (which someone should look at).

Idk, maybe this issue can be closed? Just pointing out the diff (which someone should look at).

Every time i pull master and run the script i get changed files. Not sure if this can be fixed?

Ohh that's not good. What kinds of diffs and to what files? Are they *.gw.go only? Can you post some example diffs?

Screen Shot 2020-08-17 at 7 08 27 PM

The staking.pb.go is something I have noticed being changed. I ran it earlier and also observed changes. All the gw.go is removing a comment or two.

When running make proto-gen I get these errors as well:

W0817 19:09:17.479607   91564 services.go:38] No HttpRule found for method: ReflectionService.ListAllInterfaces
W0817 19:09:17.479726   91564 services.go:38] No HttpRule found for method: ReflectionService.ListImplementations
W0817 19:09:19.848090   91669 services.go:38] No HttpRule found for method: Service.Simulate

my protoc version is libprotoc 3.12.4

Ohh that's not good. What kinds of diffs and to what files? Are they *.gw.go only? Can you post some example diffs?

Looks like mostly with gw.go files and one weird behaviour is with staking.pb.go. I don't see anything breaking but it's changing everytime.

I have libprotoc 3.11.4. May be we should stick to one version?

Yes, we're both on 3.11.x, marko is 3.12.x, I suppose we should upgrade to 3.12.x.

W0817 19:09:17.479607 91564 services.go:38] No HttpRule found for method: ReflectionService.ListAllInterfaces
W0817 19:09:17.479726 91564 services.go:38] No HttpRule found for method: ReflectionService.ListImplementations
W0817 19:09:19.848090 91669 services.go:38] No HttpRule found for method: Service.Simulate

I added gateway annotations for these service in this commit: https://github.com/cosmos/cosmos-sdk/pull/7035/commits/ad7ecf13c06e11ec7d1f7443ea4cc6516ea6e0b9

Was this page helpful?
0 / 5 - 0 ratings