common: update to latest route-blinding spec.

```
make check-source-bolt CHECK_BOLT_PREFIX="--prefix=BOLT-route-blinding" BOLTVERSION=guilt/offers
```

Other than textual changes, this does:

1. Ensures we put total_amount_msat in onion final hop (reported by @t-bast).
2. Require that they put total_amount_msat in onion final hop.
3. Return `invalid_onion_blinding` exactly as defined by the spec (i.e. less
   aggressive when we're the final hop) (also reported by @t-bast, but I already
   knew).

See: #5823
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: `offers` breaking blinded payments change (total_amount_sat required, Eclair compat)
This commit is contained in:
Rusty Russell
2023-01-12 14:23:38 +10:30
parent d5c19b23d8
commit e9eb5f493b
9 changed files with 46 additions and 21 deletions

View File

@@ -103,6 +103,7 @@ u8 *onion_final_hop(const tal_t *ctx,
u8 *onion_blinded_hop(const tal_t *ctx,
const struct amount_msat *amt_to_forward,
const struct amount_msat *total_amount_msat,
const u32 *outgoing_cltv_value,
const u8 *enctlv,
const struct pubkey *blinding)
@@ -114,6 +115,11 @@ u8 *onion_blinded_hop(const tal_t *ctx,
= cast_const(u64 *,
&amt_to_forward->millisatoshis); /* Raw: TLV convert */
}
if (total_amount_msat) {
tlv->total_amount_msat
= cast_const(u64 *,
&total_amount_msat->millisatoshis); /* Raw: TLV convert */
}
tlv->outgoing_cltv_value = cast_const(u32 *, outgoing_cltv_value);
tlv->encrypted_recipient_data = cast_const(u8 *, enctlv);
tlv->blinding_point = cast_const(struct pubkey *, blinding);