From 7e789be0eaaf830322e63a2771d8f0cbfd07df37 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 31 Mar 2022 19:40:50 +1030 Subject: [PATCH] doc: update BOLTs to latest master. Just typo fixes and the like. Signed-off-by: Rusty Russell --- Makefile | 2 +- channeld/channeld.c | 12 +++++------- channeld/full_channel.c | 3 ++- closingd/closingd.c | 4 +++- common/features.c | 3 +-- hsmd/libhsmd.c | 6 +++--- openingd/dualopend.c | 4 ++-- wallet/wallet.c | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index a835e78d8..dd1eb9722 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ CCANDIR := ccan # Where we keep the BOLT RFCs BOLTDIR := ../lightning-rfc/ -DEFAULT_BOLTVERSION := f6c4d7604150986894bcb46d67c5c88680740b12 +DEFAULT_BOLTVERSION := e60d594abf436e768116684080997a8d4f960263 # Can be overridden on cmdline. BOLTVERSION := $(DEFAULT_BOLTVERSION) diff --git a/channeld/channeld.c b/channeld/channeld.c index 24c41b9d1..72cd437bf 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -1107,7 +1107,7 @@ static struct bitcoin_signature *unraw_sigs(const tal_t *ctx, *... * * if `option_anchors` applies to this commitment * transaction, `SIGHASH_SINGLE|SIGHASH_ANYONECANPAY` is - * used. + * used as described in [BOLT #5] */ if (option_anchor_outputs) sigs[i].sighash_type = SIGHASH_SINGLE|SIGHASH_ANYONECANPAY; @@ -2468,8 +2468,7 @@ static void resend_commitment(struct peer *peer, struct changed_htlc *last) /* BOLT #2: * * A receiving node: - * - if `option_static_remotekey` or `option_anchors` applies to the - * commitment transaction: + * - if `option_static_remotekey` applies to the commitment transaction: * - if `next_revocation_number` is greater than expected above, AND * `your_last_per_commitment_secret` is correct for that * `next_revocation_number` minus 1: @@ -2515,7 +2514,7 @@ static void check_future_dataloss_fields(struct peer *peer, /* BOLT #2: * - MUST NOT broadcast its commitment transaction. - * - SHOULD fail the channel. + * - SHOULD send an `error` to request the peer to fail the channel. * - SHOULD store `my_current_per_commitment_point` to * retrieve funds should the sending node broadcast its * commitment transaction on-chain. @@ -2532,8 +2531,7 @@ static void check_future_dataloss_fields(struct peer *peer, /* BOLT #2: * * A receiving node: - * - if `option_static_remotekey` or `option_anchors` applies to the - * commitment transaction: + * - if `option_static_remotekey` applies to the commitment transaction: * ... * - if `your_last_per_commitment_secret` does not match the expected values: * - SHOULD send an `error` and fail the channel. @@ -2797,7 +2795,7 @@ skip_tlvs: * of the next `commitment_signed` it expects to receive. * - MUST set `next_revocation_number` to the commitment number * of the next `revoke_and_ack` message it expects to receive. - * - if `option_static_remotekey` or `option_anchors` applies to the commitment transaction: + * - if `option_static_remotekey` applies to the commitment transaction: * - MUST set `my_current_per_commitment_point` to a valid point. * - otherwise: * - MUST set `my_current_per_commitment_point` to its commitment diff --git a/channeld/full_channel.c b/channeld/full_channel.c index 5c7102b24..87e736bb3 100644 --- a/channeld/full_channel.c +++ b/channeld/full_channel.c @@ -617,7 +617,8 @@ static enum channel_add_err add_htlc(struct channel *channel, * * - if a sending node adds more than receiver `max_accepted_htlcs` * HTLCs to its local commitment transaction... - * - SHOULD fail the channel. + * - SHOULD send a `warning` and close the connection, or send an + * `error` and fail the channel. */ if (htlc_count + 1 > channel->config[recipient].max_accepted_htlcs) { return CHANNEL_ERR_TOO_MANY_HTLCS; diff --git a/closingd/closingd.c b/closingd/closingd.c index e2a8fcbff..30739e0a5 100644 --- a/closingd/closingd.c +++ b/closingd/closingd.c @@ -707,8 +707,10 @@ static void do_quickclose(struct amount_sat offer[NUM_SIDES], /* BOLT #2: * - if the message contains a `fee_range`: * - if there is no overlap between that and its own `fee_range`: - * - SHOULD fail the connection + * - SHOULD send a warning + * - MUST fail the channel if it doesn't receive a satisfying `fee_range` after a reasonable amount of time */ + /* (Note we satisfy the "MUST fail" by our close command unilteraltimeout) */ if (!get_overlap(our_feerange, their_feerange, &overlap)) { peer_failed_warn(pps, channel_id, "Unable to agree on a feerate." diff --git a/common/features.c b/common/features.c index e95d631e8..bd7db0bfb 100644 --- a/common/features.c +++ b/common/features.c @@ -131,8 +131,7 @@ static const struct dependency feature_deps[] = { * `option_anchor_outputs` | ... | ... | `option_static_remotekey` */ { OPT_ANCHOR_OUTPUTS, OPT_STATIC_REMOTEKEY }, - /* FIXME: This dep was added later! */ - /* BOLT-master #9: + /* BOLT #9: * Name | Description | Context | Dependencies | *... * `option_anchors_zero_fee_htlc_tx` | ... | ... | `option_static_remotekey` diff --git a/hsmd/libhsmd.c b/hsmd/libhsmd.c index b8e230718..6a5e34962 100644 --- a/hsmd/libhsmd.c +++ b/hsmd/libhsmd.c @@ -1124,7 +1124,7 @@ static u8 *handle_sign_local_htlc_tx(struct hsmd_client *c, const u8 *msg_in) * ## HTLC-Timeout and HTLC-Success Transactions *... * * if `option_anchors` applies to this commitment transaction, - * `SIGHASH_SINGLE|SIGHASH_ANYONECANPAY` is used. + * `SIGHASH_SINGLE|SIGHASH_ANYONECANPAY` is used as described in [BOLT #5] */ sign_tx_input(tx, 0, NULL, wscript, &htlc_privkey, &htlc_pubkey, option_anchor_outputs @@ -1177,7 +1177,7 @@ static u8 *handle_sign_remote_htlc_tx(struct hsmd_client *c, const u8 *msg_in) * ## HTLC-Timeout and HTLC-Success Transactions *... * * if `option_anchors` applies to this commitment transaction, - * `SIGHASH_SINGLE|SIGHASH_ANYONECANPAY` is used. + * `SIGHASH_SINGLE|SIGHASH_ANYONECANPAY` is used as described in [BOLT #5] */ sign_tx_input(tx, 0, NULL, wscript, &htlc_privkey, &htlc_pubkey, option_anchor_outputs @@ -1446,7 +1446,7 @@ static u8 *handle_sign_remote_htlc_to_us(struct hsmd_client *c, * ## HTLC-Timeout and HTLC-Success Transactions *... * * if `option_anchors` applies to this commitment transaction, - * `SIGHASH_SINGLE|SIGHASH_ANYONECANPAY` is used. + * `SIGHASH_SINGLE|SIGHASH_ANYONECANPAY` is used as described in [BOLT #5] */ return handle_sign_to_us_tx( c, msg_in, tx, &privkey, wscript, diff --git a/openingd/dualopend.c b/openingd/dualopend.c index 2bf7d6010..737e9fb70 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -3458,7 +3458,7 @@ static u8 *handle_funding_depth(struct state *state, u8 *msg) /* BOLT #2: * * A receiving node: - * - if `option_static_remotekey` or `option_anchors` applies to the commitment transaction: + * - if `option_static_remotekey` applies to the commitment transaction: * - if `next_revocation_number` is greater than expected above, AND * `your_last_per_commitment_secret` is correct for that * `next_revocation_number` minus 1: @@ -3504,7 +3504,7 @@ check_future_dataloss_fields(struct state *state, /* BOLT #2: * - MUST NOT broadcast its commitment transaction. - * - SHOULD fail the channel. + * - SHOULD send an `error` to request the peer to fail the channel. */ wire_sync_write(REQ_FD, take(towire_dualopend_fail_fallen_behind(NULL))); diff --git a/wallet/wallet.c b/wallet/wallet.c index 93e52b54a..bf0710b0f 100644 --- a/wallet/wallet.c +++ b/wallet/wallet.c @@ -869,7 +869,7 @@ wallet_htlc_sigs_load(const tal_t *ctx, struct wallet *w, u64 channelid, *... * * if `option_anchors` applies to this commitment * transaction, `SIGHASH_SINGLE|SIGHASH_ANYONECANPAY` is - * used. + * used as described in [BOLT #5] */ if (option_anchor_outputs) sig.sighash_type = SIGHASH_SINGLE|SIGHASH_ANYONECANPAY;