Commit Graph

8 Commits

Author SHA1 Message Date
Rusty Russell
621bfe370e connectd: forward onion messages by scid as well as node_id.
This is now permitted in the offers PR, so we should support it.  But
we can't just look up in the gossmap, since the "short_channel_id"
could be an alias.  So we get lightningd to tell us all scid->peer
mappings, and look up in that.

Changelog-Added: Protocol: onion messages can now be forwarded by short_channel_id.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-07-10 13:34:00 +02:00
Rusty Russell
ba82592196 common/onion_message_parse: return string, not bool.
Allows for caller to log, but more importantly, when we add a command to
inject onion messages, allows for us to capture the error.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-07-10 13:34:00 +02:00
Rusty Russell
4647f3c2a3 common: don't pass (unused) has_realm parameter to process_onionpacket.
This was when we handled pre-TLV onions where the first byte was 0.  We haven't
done that for a while: you can tell, because process_onionpacket doesn't use
the parameter at all!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-07-09 15:09:29 +02:00
Rusty Russell
ac3c178587 global: fix up quotes which are now in the master branch.
1. onion-message
2. blinded-payments
3. route-blinding
4. channel-type
5. warnings.

Now they'll be checked correctly, and if the spec changes, we'll know
to reexamine this code.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-09 16:14:23 -05:00
Rusty Russell
e0e879c003 common: remove type_to_string files altogther.
This means including <common/utils.h> where it was indirectly included.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-20 13:51:48 +10:30
Rusty Russell
37d22f9141 global: change all type_to_string to fmt_X.
This has the benefit of being shorter, as well as more reliable (you
will get a link error if we can't print it, not a runtime one!).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-20 13:51:48 +10:30
Rusty Russell
9aefe3d40a common: update to latest onion-message spec.
```
make check-source-bolt CHECK_BOLT_PREFIX="--prefix=BOLT-onion-message" BOLTVERSION=guilt/offers
```

Mainly textual, though I neatened the extra fields check for TLVs with
blinding, and implemented the "no other fields" requirement for
non-final onion message hops.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-01-30 13:24:29 +10:30
Rusty Russell
159fc7d1a2 common/onion_message_parse: generic routine for parsing onion messages.
Instead of open coding in connectd/onion_message, we move it to common
with a nice API.

This lets us process the BOLT test vectors.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-10-26 11:29:06 +10:30