-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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: deprecate duplicate string fields in requests #3661
proto: deprecate duplicate string fields in requests #3661
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you looked for all the duplicated fields in this PR? I am wondering, what to do with the fields for which there is only a string
field, which should really have been bytes
? There are for example numerous pubkey
fields.
lnrpc/rpc.proto
Outdated
Hex-encoded string representing the funding transaction. Deprecated now | ||
that the REST gateway supports base64 encoding of bytes fields. | ||
*/ | ||
string funding_txid_str = 2 [json_name = "funding_txid_str", deprecated = true]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the whole oneof
redundant. But maybe that removal should be done in a second step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the deprecation from this field again. This is the case @Roasbeef mentioned where it might be useful for the users to be able to just pass in the string representation of a TXID that they get from a previous output and don't need to byte-reverse it before feeding it into the RPC/REST call. So the oneof
can also remain.
d8032a1
to
203974e
Compare
I removed the deprecation from the TXID field. There are only 5 deprecations in this PR now, all of them are duplicates and very likely introduced to work around the bug that is now fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the deprecation from this field again. This is the case @Roasbeef mentioned where it might be useful for the users to be able to just pass in the string representation of a TXID that they get from a previous output and don't need to byte-reverse it before feeding it into the RPC/REST call. So the oneof can also remain.
Seems more like an inconsistency with our API then? As long as we accept and return them in the same format, there's no need to keep the string field.
lnrpc/rpc.proto
Outdated
@@ -94,13 +94,15 @@ service WalletUnlocker { | |||
message GenSeedRequest { | |||
/** | |||
aezeed_passphrase is an optional user provided passphrase that will be used | |||
to encrypt the generated aezeed cipher seed. | |||
to encrypt the generated aezeed cipher seed. When using REST, this field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: there's a double space after the period here and in some other cases below that would be reflected in the API documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The double space was used in several places so I thought that was a style we wanted to use for some reason. But I removed all of them now.
With this PR we deprecate fields that have been specifically added to to work around a bug in the gRPC/REST gateway that didn't allow bytes fields to be encoded in REST requests. That bug has now been fixed so the fields are no longer required. To make it more clear how bytes fields have to be used in REST, comments have been added to all those fields.
203974e
to
7e9c4f0
Compare
There are quite a few inconsistencies in the API, especially around the TXIDs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this grew over time, there are many things that could be made cleaner.
Maybe we should do a massive API overhaul when we know how to proceed with the custom jsonpb library?
Definitely, sounds good to me.
Follow-up for #3650.
With this PR we deprecate fields that have been specifically added to
to work around a bug in the gRPC/REST gateway that didn't allow bytes
fields to be encoded in REST requests.
That bug has now been fixed so the fields are no longer required.
To make it more clear how bytes fields have to be used in REST,
comments have been added to all those fields.