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

lnrpc: re-enable custom records #3744

Merged

Conversation

joostjager
Copy link
Contributor

This PR re-enables custom record sending that was disabled in #3575.

It leaves the database serialization format as is, because there currently is no functional need to change it.

@joostjager joostjager self-assigned this Nov 20, 2019
@joostjager joostjager added payments Related to invoices/payments routing rpc Related to the RPC interface v0.9.0 labels Nov 20, 2019
@joostjager joostjager added this to the 0.9.0 milestone Nov 20, 2019
@joostjager
Copy link
Contributor Author

@cfromknecht, we spoke offline about the risk that we wouldn't be able to deserialize even custom records from our own database as long as odd/even checking was part of the tlv package. That has been removed in #3701, but looking at the hop serialization code again it also seems that we weren't using tlv there in the first place?

@joostjager joostjager force-pushed the enable-custom-records branch 3 times, most recently from f31c80a to 3b5c934 Compare November 22, 2019 11:15
@joostjager joostjager requested review from guggero and removed request for halseth November 22, 2019 11:17
@joostjager
Copy link
Contributor Author

Added the custom range check. Hopefully this PR didn't miss any entry/exit point for custom records. Because of the duplicated send interface, it is quite a few places.

Copy link
Collaborator

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Nice to see those custom TLVs enabled again!
My only question is about the documentation comments in the proto file.

lnrpc/routerrpc/router_backend.go Outdated Show resolved Hide resolved
lnrpc/routerrpc/router_backend.go Outdated Show resolved Hide resolved
lnrpc/rpc.proto Outdated
application specific data during the payment attempt. If the destination
does not support the specified recrods, and error will be returned.
*/
map<uint64, bytes> dest_tlv = 13;
Copy link
Collaborator

Choose a reason for hiding this comment

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

On every other field that has the type bytes involved, we have the following comment:

When using REST, this field must be encoded as base64.

Do we want to add this here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

To be consistent with the hop message, I would say this should be renamed to something like dest_custom_records. Comment should also mention custom record range

@joostjager joostjager force-pushed the enable-custom-records branch 2 times, most recently from 360b3b7 to 0c6dd92 Compare November 26, 2019 09:26
@joostjager joostjager force-pushed the enable-custom-records branch 2 times, most recently from 77d1038 to fce2d0d Compare November 26, 2019 20:39
Copy link
Collaborator

@guggero guggero left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Copy link
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

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

LGTM, just one small comment about aligning the rpc field names

lnrpc/rpc.proto Outdated
application specific data during the payment attempt. If the destination
does not support the specified recrods, and error will be returned.
*/
map<uint64, bytes> dest_tlv = 13;
Copy link
Contributor

Choose a reason for hiding this comment

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

To be consistent with the hop message, I would say this should be renamed to something like dest_custom_records. Comment should also mention custom record range

This commit also modifies a previous migration. Because the change is so
limited, we don't consider this a significant risk.
Remove code duplication in preparation for additional unmarshalling.
This commit also renames the rpc field for consistency. As it wasn't
functional and the id doesn't change, this isn't considered a breaking
change.
@joostjager joostjager merged commit 1371e5a into lightningnetwork:master Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
payments Related to invoices/payments routing rpc Related to the RPC interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants