Skip to content

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

Merged
halseth merged 2 commits into
lightningnetwork:masterfrom
guggero:update-grpc-gateway
Nov 1, 2019
Merged

proto+lnrpc: update gRPC-REST gateway to v1.8.6#3650
halseth merged 2 commits into
lightningnetwork:masterfrom
guggero:update-grpc-gateway

Conversation

@guggero

@guggero guggero commented Oct 30, 2019

Copy link
Copy Markdown
Collaborator

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.

Comment thread lnrpc/README.md Outdated

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Collaborator Author

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.

@guggero
guggero force-pushed the update-grpc-gateway branch from 307af2a to b6c7ff8 Compare October 31, 2019 08:13
@joostjager

Copy link
Copy Markdown
Contributor

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

guggero commented Oct 31, 2019

Copy link
Copy Markdown
Collaborator Author

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

@guggero guggero removed this from the 0.9.0 milestone Oct 31, 2019

@cfromknecht cfromknecht left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@halseth halseth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested and LGTM 👍

@joostjager joostjager left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

halseth commented Nov 1, 2019

Copy link
Copy Markdown
Contributor

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
@guggero
guggero deleted the update-grpc-gateway branch November 1, 2019 08:06
@joostjager

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

Nvm, needed to update dep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wallet recovery with passphrase is not working

5 participants