Files
pallectrum/electrum
f321x 8d79c58c5e Stop including all invoice r_tags in legacy trampoline onion
This change modifies create_trampoline_onion to only include as many
available r_tags as there is space left in the trampoline onion payload.

Previously we tried to include all passed invoice r_tags of legacy
trampoline payments into the payload which caused an user facing
exception and payment failure as the onion can only store a max of 400
bytes.
A single, single hop r_tag is around 52 bytes and the payload
without r_tags is already at ~280 bytes. So usually there is enough
space for 2 r_tags.
The implementation shuffles the r_tags on each call
so the payment will try different route hints on the attempts (fee level
increase or user retry).

I have logged the following byte sizes of the trampoline onion with a 2
trampoline onion hop and changing amounts of r_tags:

3 rtags:
payload size [0]: 113 (hop size: 81)
payload size [1]: 440 (hop size: 295) ( 52 bytes/rtag )
payload size [2]: 550 (hop size: 78)

2 rtags:
payload size [0]: 113 (hop size: 81)
payload size [1]: 386 (hop size: 241) ( 52 bytes/rtag )
payload size [2]: 496 (hop size: 78)

1 rtag:
payload size [0]: 113 (hop size: 81)
payload size [1]: 334 (hop size: 189) ( 52 bytes/rtag )
payload size [2]: 444 (hop size: 78)

0 rtags:
payload size [0]: 113 (hop size: 81)
payload size [1]: 282 (hop size: 137)
payload size [2]: 392 (hop size: 78)

As can be seen in the data, using 2 trampoline hops there is not enough
space for even a single r_tag which is why this option is being removed
too.
2025-04-14 19:20:11 +02:00
..
2025-02-04 09:43:40 +01:00
2025-02-10 14:22:50 +01:00
2025-04-02 16:21:59 +00:00
2024-10-22 09:26:36 +02:00
2025-03-10 19:42:37 +01:00
2025-04-02 14:56:53 +00:00
2025-03-05 10:29:26 +01:00
2025-02-19 14:29:02 +01:00
2025-04-10 10:22:29 +02:00
2025-03-13 10:17:10 +01:00
2025-04-02 16:21:59 +00:00
2025-03-17 10:47:19 +01:00
2024-11-29 17:09:29 +08:00
2025-04-11 19:06:48 +02:00
2025-04-11 19:06:48 +02:00
2025-04-10 10:22:29 +02:00
2025-02-28 16:46:29 +00:00
2025-04-02 16:21:59 +00:00
2025-04-10 10:22:29 +02:00
2025-01-23 12:58:28 +01:00