Add a payment_metadata map in blinded * path contexts#4584
Add a payment_metadata map in blinded * path contexts#4584TheBlueMatt wants to merge 4 commits intolightningdevkit:mainfrom
payment_metadata map in blinded * path contexts#4584Conversation
We almost certainly don't want to be moving `option` TLVs during serialization, and while we had logic elsewhere to work around this previously its nice not to have to in the future.
|
👋 Thanks for assigning @tnull as a reviewer! |
7c4e653 to
ee6ba89
Compare
|
All the necessary No issues found. All previously flagged issues have been addressed (typos fixed, doc reference verified correct). The implementation is correct: TLV backwards compatibility is maintained with odd type numbers, serialization macros work properly with reference types, metadata flows correctly through all paths, and pattern matches are exhaustive. No issues found. All previously flagged items from prior review passes have been resolved:
Verification completed across all 15 changed files covering: TLV serialization correctness (odd type numbers, ascending order), macro |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4584 +/- ##
==========================================
+ Coverage 87.15% 87.16% +0.01%
==========================================
Files 161 161
Lines 109251 109329 +78
Branches 109251 109329 +78
==========================================
+ Hits 95215 95296 +81
+ Misses 11560 11549 -11
- Partials 2476 2484 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ee6ba89 to
792846c
Compare
Similar to how BOLT 11 payments can use a `payment_metadata` to provide arbitrary bytes in the invoice to be communicated back to them when receiving, its useful to be able to provide some bytes which are communicated back upon receiving a payment. Here we do so in the BOLT 12 blinded path contexts, offering a `BTreeMap<u64, Vec<u8>>` instead to enable more easily including multiple sets of data. Also note that a `Router` building a blinded path is allowed to modify the `payment_metadata` without breaking the payment. Tests by claude
Similar to how BOLT 11 payments can use a `payment_metadata` to provide arbitrary bytes in the invoice to be communicated back to them when receiving, its useful to be able to provide some bytes which are communicated back upon receiving a payment. Here we do so in the BOLT 12 blinded message path contexts, offering a `BTreeMap<u64, Vec<u8>>` instead to enable more easily including multiple sets of data. We don't yet wire it up to the public `ChannelManager` API, but do allow selecting values for those using the manual `OffersMessageFlow`. Tests by claude
792846c to
98cff64
Compare
We do so both in the blinded message and payment paths, supporting async payments when data is injected in the blinded payment paths (eg via the
Router). We don't expose building offers with metadata yet.