migrate to tlv for invoice body#3693
Conversation
08affcc to
e910d5b
Compare
e910d5b to
cce84bf
Compare
cce84bf to
1e85e61
Compare
59bec21 to
c685d51
Compare
|
Build generates a diff in |
c685d51 to
102b243
Compare
Looked into this, the
also fixed, a |
102b243 to
1ee9e2c
Compare
0ebc88e to
2ba8cc3
Compare
|
@joostjager @Roasbeef @halseth reverted to prior pr and touched up for another review. ended up using joost's suggestion of passing through the htlc bytes directly, which shaved 200+ lines off the diff |
2ba8cc3 to
7cc3281
Compare
joostjager
left a comment
There was a problem hiding this comment.
Looking better with htlc pass through.
ecdf974 to
1cd1a93
Compare
These will allow us to serialize invoice features bits without double encoding the length.
Instead of allocating a byte slice to read in each htlc's raw TLV stream, use a LimitReader to truncate the stream to the proper length.
This commit restructures an invoice's ContractTerms to better encompass the restrictions placed on settling. For instance, the final ctlv delta and invoice expiry are moved from the main invoice body (where additional metadata is stored). Additionally, it moves the State field outside of the terms since it is rather metadata about the invoice instead of any terms offered to the sender in the payment request.
1cd1a93 to
3b253e0
Compare
Roasbeef
left a comment
There was a problem hiding this comment.
LGTM 📯
Latest diff on my node just shows the reciept field being removed between versions (diff'ing calls to ListInvoices) 👍

Builds on #3685
This PR migrates our invoices to use TLV for their bodies. In the process we add feature vectors and payment addrs to make way for our mpp series. The unused receipt field is ultimately dropped from the db and the rpc calls. Finally, invoices are now populated with an empty set of features, which will not appear on payment requests until a non-zero number of bits are initially set.