Skip to content

Commit c5d5219

Browse files
committed
minitramp: specify errors in more detail
And steal @t-bast's trampoline error codes. Signed-off-by: Rusty Russell <[email protected]>
1 parent 9f25ae7 commit c5d5219

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

04-onion-routing.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -742,18 +742,24 @@ The recipient:
742742
- Fail all HTLCs with `incorrect_or_unknown_payment_details`.
743743
- If neither `node_id` nor `blinded_paths` are present (we are the final destination):
744744
- If `payment_secret` in `payload` is not equal to `trampinfo`.`incoming_payment_secret`:
745-
- Reject payment
745+
- Fail all HTLCs with `incorrect_or_unknown_payment_details`.
746746
- Check for trampoline misbehaviour (below)
747747
- SHOULD process the payment as if the `payload` contained the `minitramp` `payment_secret` and `payment_metadata`.
748748
- Otherwise: (forwarding):
749749
- If both `next_node` and `blinded_paths` are present:
750-
- Reject payment
750+
- Fail all HTLCs with `incorrect_or_unknown_payment_details`.
751+
- If the number of `blinded_paths` and `blinded_payinfo` do not match:
752+
- Fail all HTLCs with `incorrect_or_unknown_payment_details`.
751753
- Determine a route to `next_node` or `blinded_paths` for `amount_to_send` using `next_cltv_value`.
754+
- If no route can be found:
755+
- Fail all HTLCs with `unknown_next_trampoline`.
752756
- If the incoming amount or cltv is insufficient:
753-
- Reject payment
754-
- If the number of `blinded_paths` and `blinded_payinfo` do not match:
755-
- Reject payment
757+
- Fail all HTLCs with `trampoline_fee_or_expiry_insufficient`.
756758
- MUST include `trampinfo`.`minitramp`, `outgoing_payment_secret` (as `payment_secret`) and `outgoing_payment_info` (as `payment_metadata`) in the inner `payload` of the payment onion.
759+
- If the payment fails:
760+
- Fail all HTLCs with `temporary_trampoline_failure`.
761+
- Otherwise:
762+
- Use the preimage to succeed all HTLCs.
757763
- Otherwise (`minitramp` is NOT present):
758764
- Check for trampoline misbehaviour (below)
759765

@@ -1427,6 +1433,28 @@ reasonable time.
14271433

14281434
An error occurred within the blinded path.
14291435

1436+
1. type: NODE|25 (`temporary_trampoline_failure`)
1437+
1438+
The trampoline node was unable to relay the payment to the next trampoline
1439+
node, but may be able to handle it, or others, later.
1440+
This error usually indicates that routes were found but failed because of
1441+
temporary failures at intermediate hops.
1442+
1443+
1. type: NODE|26 (`trampoline_fee_or_expiry_insufficient`)
1444+
2. data:
1445+
* [`u32`:`fee_base_msat`]
1446+
* [`u32`:`fee_proportional_millionths`]
1447+
* [`u16`:`cltv_expiry_delta`]
1448+
1449+
The fee amount or cltv value was below that required by the trampoline node to
1450+
forward to the next trampoline node, but there are routes available if the
1451+
sender retries with the fees and cltv provided in the error data.
1452+
1453+
1. type: PERM|27 (`unknown_next_trampoline`)
1454+
1455+
The trampoline onion specified an `outgoing_node_id` that cannot be reached
1456+
from the processing node.
1457+
14301458
### Requirements
14311459

14321460
An _erring node_:

0 commit comments

Comments
 (0)