Skip to content

lnrpc: re-enable custom records#3744

Merged
joostjager merged 3 commits into
lightningnetwork:masterfrom
joostjager:enable-custom-records
Dec 4, 2019
Merged

lnrpc: re-enable custom records#3744
joostjager merged 3 commits into
lightningnetwork:masterfrom
joostjager:enable-custom-records

Conversation

@joostjager
Copy link
Copy Markdown
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
Copy Markdown
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 a review from halseth as a code owner November 22, 2019 11:15
@joostjager joostjager requested review from guggero and removed request for halseth November 22, 2019 11:17
@joostjager
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread lnrpc/routerrpc/router_backend.go Outdated
Comment thread lnrpc/routerrpc/router_backend.go Outdated
Comment thread lnrpc/rpc.proto Outdated
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 requested a review from guggero 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
Copy Markdown
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 🚀

Comment thread lnrpc/routerrpc/router_backend.go Outdated
Copy link
Copy Markdown
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

Comment thread lnrpc/rpc.proto 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.

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 from 2e40d5a to 17c3576 Compare December 4, 2019 12:25
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 force-pushed the enable-custom-records branch from 17c3576 to 352334d Compare December 4, 2019 12:27
@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