Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proto+lnrpc: update gRPC-REST gateway to v1.8.6 #3650

Merged
merged 2 commits into from Nov 1, 2019

Conversation

guggero
Copy link
Collaborator

@guggero guggero commented Oct 30, 2019

Fixes #3168

When using the REST gateway, fields that have the type bytes in rpc.proto cannot be used in query or path parameters (see #552 which lead to workarounds like #592).

The root cause of this is that the version of grpc-gateway we use doesn't support mapping to []byte yet.
Trying to use bytes parameters results in {"error":"unsupported field type uint8","code":3}.
This has been fixed in grpc-ecosystem/grpc-gateway#489.

Unfortunately, we can't use the newest version of grpc-gateway (which would be 1.11.3 at the moment) because that has a bug that messes up our rpc.swagger.json (grpc-ecosystem/grpc-gateway#746).

After some trial and error, I found that version 1.8.6 is the newest version that works for our use case and produces the smallest diff in our generated code.

lnrpc/README.md Outdated
```bash
$ git clone https://github.com/grpc-ecosystem/grpc-gateway $GOPATH/src/github.com/grpc-ecosystem/grpc-gateway
$ cd $GOPATH/src/github.com/grpc-ecosystem/grpc-gateway
$ git reset --hard f2862b476edcef83412c7af8687c9cd8e4097c0f
$ git reset --hard v1.8.6
$ go mod init
Copy link
Collaborator

@wpaulino wpaulino Oct 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required? This version seems to support go modules.

Copy link
Collaborator Author

@guggero guggero Oct 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not required. That was left over from a trial with an older version. Fixed.

@joostjager
Copy link
Collaborator

@joostjager joostjager commented Oct 31, 2019

it would be nice if we can also mark all the string fields as deprecated now and remove them in 0.10

@guggero guggero added this to the 0.9.0 milestone Oct 31, 2019
@guggero guggero self-assigned this Oct 31, 2019
@guggero
Copy link
Collaborator Author

@guggero guggero commented Oct 31, 2019

@wpaulino no, he meant the fields introduced in #592 that worked around the bug that this PR fixes.

@guggero guggero added this to WIP in v0.9.0-beta via automation Oct 31, 2019
@guggero guggero removed this from the 0.9.0 milestone Oct 31, 2019
v0.9.0-beta automation moved this from WIP to Approved Oct 31, 2019
Copy link
Collaborator

@cfromknecht cfromknecht left a comment

nice, this actually reduces the size of our gateway code! LGTM 🔥

halseth
halseth approved these changes Nov 1, 2019
Copy link
Collaborator

@halseth halseth left a comment

Tested and LGTM 👍

Copy link
Collaborator

@joostjager joostjager left a comment

it would be nice if we can also mark all the string fields as deprecated now and remove them in 0.10

Do we want to do this? I think it would be nice to be able to remove the string fields at some point

@halseth
Copy link
Collaborator

@halseth halseth commented Nov 1, 2019

it would be nice if we can also mark all the string fields as deprecated now and remove them in 0.10

Do we want to do this? I think it would be nice to be able to remove the string fields at some point

Yep, can be done in separate PR though.

@halseth halseth merged commit e0744a3 into lightningnetwork:master Nov 1, 2019
1 of 2 checks passed
v0.9.0-beta automation moved this from Approved to Done Nov 1, 2019
@guggero guggero deleted the update-grpc-gateway branch Nov 1, 2019
@joostjager
Copy link
Collaborator

@joostjager joostjager commented Nov 2, 2019

I am getting a new error:

joost@joost-desktop $ make rpc
 Compiling protos.
cd ./lnrpc; ./gen_protos.sh
Generating root gRPC server protos
F1102 13:10:55.891383    8655 main.go:73] Cannot set flag paths=source_relative
--grpc-gateway_out: protoc-gen-grpc-gateway: Plugin failed with status code 255.

@joostjager
Copy link
Collaborator

@joostjager joostjager commented Nov 2, 2019

Nvm, needed to update dep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v0.9.0-beta
  
Done
Development

Successfully merging this pull request may close these issues.

5 participants