Skip to content

Conversation

@t-bast
Copy link
Member

@t-bast t-bast commented Nov 29, 2024

This PR contains a collection of small independent commits that help minimize the code changes required to support blinded trampoline payments (implemented in #2819). It will be useful to minimize this diff since #2819 will have to stay open until we have cross-compatibility and are able to merge trampoline to the BOLTs, so we want to minimize the work required when rebasing.

And remove the `currency` fields as we have no short-term plans to
support currency conversion in `eclair`.
We don't always need to include a `payment_constraints` field for
ourselves: it's fine to accept payment that don't contain one as
long as we created the `encrypted_recipient_data`, which we can
verify using the `path_id`. We were too restrictive for no good
reason.
If the `total_amount` field isn't provided, we can safely default to
using the `amount`, which saves space in the onion. Note that we keep
always encoding it in the outgoing payments we send, we're simply more
permissive when receiving payments.
We extract a helper method for decrypting encrypted recipient data
which will be used when decrypting trampoline blinded paths.
In order to support blinded trampoline payments, we won't have access to
a direct `amount_to_forward` field, but will use a `payment_relay` TLV
instead, which only allows calculating the outgoing amount from the
incoming amount (same thing for the expiry).

We refactor this to simplify the diff when introducing blinded trampoline
payments.
@t-bast t-bast requested a review from thomash-acinq November 29, 2024 13:33
And revert changes to spec test vector.
@t-bast t-bast merged commit 304290d into master Nov 29, 2024
1 check passed
@t-bast t-bast deleted the trampoline-nits branch November 29, 2024 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants