lnrpc: ignore legacy onion payload as an option for SendToRoute

In this commit, we start to ignore the option to allow the caller to use
the legacy onion payload. The new payload is much more flexible and
efficient, so there's really no reason to still use it, other than for
backwards compatibility tests. Our existing tests that exercise the
legacy feature uses a build tag, which forces nodes to not advertise the
new payload format, which then forces path finding to include the legacy
payload, so we can be confident that route is still being tested.

The existence of this option (which actually makes the TLV payload
opt-in for `SendToRoute` users) makes it harder to remove it from the
protocol all together. With this PR, we take a step forward to allowing
such a change which is being tracked on the spec level at:
https://github.com/lightning/bolts/pull/962.

In a future release, we'll move to remove the field all together.
Ignoring the field today doesn't seem to have any clear downsides, as
most payments always include the MPP payload (due to payment secrets),
so this shouldn't impact users in a significant way.
This commit is contained in:
Olaoluwa Osuntokun committed 2022-04-11 20:29:57 -04:00
1 parent 954d5cf896
commit 427a518b0a
3 files changed
+1415 -1411

No files matched your search

+1413 -1409
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -2760,7 +2760,7 @@ message Hop {
TLV format. Note that if any custom tlv_records below are specified, then
this field MUST be set to true for them to be encoded properly.
*/
bool tlv_payload = 9;
bool tlv_payload = 9 [deprecated = true];
/*
An optional TLV record that signals the use of an MPP payment. If present,
+1 -1
View File
@@ -476,7 +476,7 @@ func UnmarshallHopWithPubkey(rpcHop *lnrpc.Hop, pubkey route.Vertex) (*route.Hop
PubKeyBytes: pubkey,
ChannelID: rpcHop.ChanId,
CustomRecords: customRecords,
LegacyPayload: !rpcHop.TlvPayload,
LegacyPayload: false,
MPP: mpp,
AMP: amp,
}, nil