From 65ef909bd3f8ca35f63f2717afc06893221f5a34 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 19 Jun 2024 10:06:41 +0930 Subject: [PATCH] Doc: update to BOLT which assumes option_var_onion_optin. We have assumed this for a long time, so nothing changes. Confusingly, this BOLT commit also cleaned up one reamining `option_anchors_zero_fee_htlc_tx`. Signed-off-by: Rusty Russell --- Makefile | 2 +- common/channel_type.c | 7 +++---- common/features.c | 9 --------- common/features.h | 2 +- common/htlc_tx.h | 4 ++-- onchaind/onchaind.c | 8 ++++---- 6 files changed, 11 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 1d8fa2cba..62fb7fbfb 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ CCANDIR := ccan # Where we keep the BOLT RFCs BOLTDIR := ../bolts/ -DEFAULT_BOLTVERSION := c48b4e3b275f628bfa267f6bcd2e00fa04d52882 +DEFAULT_BOLTVERSION := e042c615efb5139a0bfdca0c6391c3c13df70418 # Can be overridden on cmdline. BOLTVERSION := $(DEFAULT_BOLTVERSION) diff --git a/common/channel_type.c b/common/channel_type.c index 5f514bc96..49c7e32dd 100644 --- a/common/channel_type.c +++ b/common/channel_type.c @@ -25,8 +25,7 @@ struct channel_type *channel_type_none_obsolete(const tal_t *ctx) * * The currently defined basic types are: * - `option_static_remotekey` (bit 12) - * - `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` (bits 22 - * and 12) + * - `option_anchors` and `option_static_remotekey` (bits 22 and 12) * * Each basic type has the following variations allowed: */ @@ -82,8 +81,8 @@ struct channel_type *default_channel_type(const tal_t *ctx, * - if `channel_type` was present in both `open_channel` and `accept_channel`: * - This is the `channel_type` (they must be equal, required above) * - otherwise: - * - if `option_anchors_zero_fee_htlc_tx` was negotiated: - * - the `channel_type` is `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` (bits 22 and 12) + * - if `option_anchors` was negotiated: + * - the `channel_type` is `option_anchors` and `option_static_remotekey` (bits 22 and 12) * - otherwise: * - the `channel_type` is `option_static_remotekey` (bit 12) */ diff --git a/common/features.c b/common/features.c index ce86d0165..c039fce88 100644 --- a/common/features.c +++ b/common/features.c @@ -159,19 +159,10 @@ static const struct dependency feature_deps[] = { *... * `gossip_queries_ex` | ... | ... | `gossip_queries` | *... - * `payment_secret` | ... | ... | `var_onion_optin` | - *... * `basic_mpp` | ... | ... | `payment_secret` | */ { OPT_GOSSIP_QUERIES_EX, OPT_GOSSIP_QUERIES }, - { OPT_PAYMENT_SECRET, OPT_VAR_ONION }, { OPT_BASIC_MPP, OPT_PAYMENT_SECRET }, - /* BOLT #9: - * Name | Description | Context | Dependencies | - * ... - * `option_route_blinding` | ... | ... | `var_onion_optin` - */ - { OPT_ROUTE_BLINDING, OPT_VAR_ONION }, }; static void trim_features(u8 **features) diff --git a/common/features.h b/common/features.h index 3488f3b03..c304097e3 100644 --- a/common/features.h +++ b/common/features.h @@ -106,7 +106,7 @@ struct feature_set *feature_set_dup(const tal_t *ctx, * | 3 | `initial_routing_sync` |... I ... * | 4/5 | `option_upfront_shutdown_script` |... IN ... * | 6/7 | `gossip_queries` |... IN ... - * | 8/9 | `var_onion_optin` |... IN9 ... + * | 8/9 | `var_onion_optin` |... ASSUMED ... * | 10/11 | `gossip_queries_ex` |... IN ... * | 12/13 | `option_static_remotekey` |... ASSUMED ... * | 14/15 | `payment_secret` |... IN9 ... diff --git a/common/htlc_tx.h b/common/htlc_tx.h index fa7a7edf1..a08a90f8b 100644 --- a/common/htlc_tx.h +++ b/common/htlc_tx.h @@ -20,7 +20,7 @@ static inline struct amount_sat htlc_timeout_fee(u32 feerate_per_kw, /* BOLT #3: * * The fee for an HTLC-timeout transaction: - * - If `option_anchors_zero_fee_htlc_tx` applies: + * - If `option_anchors` applies: * 1. MUST be 0. * - Otherwise, MUST be calculated to match: * 1. Multiply `feerate_per_kw` by 663 and divide by 1000 (rounding down). @@ -46,7 +46,7 @@ static inline struct amount_sat htlc_success_fee(u32 feerate_per_kw, /* BOLT #3: * * The fee for an HTLC-success transaction: - * - If `option_anchors_zero_fee_htlc_tx` applies: + * - If `option_anchors` applies: * 1. MUST be 0. * - Otherwise, MUST be calculated to match: * 1. Multiply `feerate_per_kw` by 703 and divide by 1000 (rounding down). diff --git a/onchaind/onchaind.c b/onchaind/onchaind.c index aae4bdaa3..fe821596f 100644 --- a/onchaind/onchaind.c +++ b/onchaind/onchaind.c @@ -418,14 +418,14 @@ static bool grind_htlc_tx_fee(struct amount_sat *fee, /* BOLT #3: * * The fee for an HTLC-timeout transaction: - * - If `option_anchors_zero_fee_htlc_tx` applies: + * - If `option_anchors` applies: * 1. MUST be 0. * - Otherwise, MUST be calculated to match: * 1. Multiply `feerate_per_kw` by 663 * and divide by 1000 (rounding down). * * The fee for an HTLC-success transaction: - * - If `option_anchors_zero_fee_htlc_tx` applies: + * - If `option_anchors` applies: * 1. MUST be 0. * - Otherwise, MUST be calculated to match: * 1. Multiply `feerate_per_kw` by 703 @@ -471,7 +471,7 @@ static bool set_htlc_timeout_fee(struct bitcoin_tx *tx, /* BOLT #3: * * The fee for an HTLC-timeout transaction: - * - If `option_anchors_zero_fee_htlc_tx` applies: + * - If `option_anchors` applies: * 1. MUST be 0. * - Otherwise, MUST be calculated to match: * 1. Multiply `feerate_per_kw` by 663 and divide by 1000 (rounding down). @@ -546,7 +546,7 @@ static struct amount_sat get_htlc_success_fee(struct tracked_output *out) /* BOLT #3: * * The fee for an HTLC-success transaction: - * - If `option_anchors_zero_fee_htlc_tx` applies: + * - If `option_anchors` applies: * 1. MUST be 0. * - Otherwise, MUST be calculated to match: * 1. Multiply `feerate_per_kw` by 703 and divide by 1000 (rounding down).