Skip to content

Commit

Permalink
Makefile: update to latest spec.
Browse files Browse the repository at this point in the history
This includes anysegwit and the updated HTLC tiebreak test vector.  It
also adds explicit wording for invalid per_commitment_secret (which
nicely matches our code already!).

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed May 25, 2021
1 parent 495c5fc commit 673d680
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CCANDIR := ccan

# Where we keep the BOLT RFCs
BOLTDIR := ../lightning-rfc/
DEFAULT_BOLTVERSION := b201efe0546120c14bf154ce5f4e18da7243fe7a
DEFAULT_BOLTVERSION := 3508e4e85d26240ae7492c3d2e02770cdc360fe9
# Can be overridden on cmdline.
BOLTVERSION := $(DEFAULT_BOLTVERSION)

Expand Down
4 changes: 2 additions & 2 deletions channeld/channeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -1494,8 +1494,8 @@ static void handle_peer_revoke_and_ack(struct peer *peer, const u8 *msg)
/* BOLT #2:
*
* A receiving node:
* - if `per_commitment_secret` does not generate the previous
* `per_commitment_point`:
* - if `per_commitment_secret` is not a valid secret key or does not
* generate the previous `per_commitment_point`:
* - MUST fail the channel.
*/
memcpy(&privkey, &old_commit_secret, sizeof(privkey));
Expand Down
2 changes: 1 addition & 1 deletion channeld/test/run-commit_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ static const struct htlc **setup_htlcs_0_to_4(const tal_t *ctx)
return htlcs;
}

/* BOLT-3508e4e85d26240ae7492c3d2e02770cdc360fe9 #3:
/* BOLT #3:
* htlc 5 direction: local->remote
* htlc 5 amount_msat: 5000000
* htlc 5 expiry: 506
Expand Down
6 changes: 1 addition & 5 deletions common/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,12 @@ u8 *featurebits_or(const tal_t *ctx, const u8 *f1 TAKES, const u8 *f2 TAKES);
* | 16/17 | `basic_mpp` |... IN9 ...
* | 18/19 | `option_support_large_channel` |... IN ...
* | 20/21 | `option_anchor_outputs` |... IN ...
* | 26/27 | `option_shutdown_anysegwit` |... IN ...
*/
#define OPT_PAYMENT_SECRET 14
#define OPT_BASIC_MPP 16
#define OPT_LARGE_CHANNELS 18
#define OPT_ANCHOR_OUTPUTS 20

/* BOLT-4e329271a358ee52bf43ddbd96776943c5d74508 #9:
*
* | 26/27 | `option_shutdown_anysegwit` |... IN ...
*/
#define OPT_SHUTDOWN_ANYSEGWIT 26

/* BOLT-f53ca2301232db780843e894f55d95d512f297f9 #9:
Expand Down
2 changes: 1 addition & 1 deletion common/shutdown_scriptpubkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <stdio.h>

/* BOLT-4e329271a358ee52bf43ddbd96776943c5d74508 #2:
/* BOLT #2:
* 5. if (and only if) `option_shutdown_anysegwit` is negotiated:
* * `OP_1` through `OP_16` inclusive, followed by a single
* push of 2 to 40 bytes
Expand Down
5 changes: 4 additions & 1 deletion common/shutdown_scriptpubkey.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
* (pay to pubkey hash), OR
* 2. `OP_HASH160` `20` 20-bytes `OP_EQUAL` (pay to script hash), OR
* 3. `OP_0` `20` 20-bytes (version 0 pay to witness pubkey hash), OR
* 4. `OP_0` `32` 32-bytes (version 0 pay to witness script hash)
* 4. `OP_0` `32` 32-bytes (version 0 pay to witness script hash), OR
* 5. if (and only if) `option_shutdown_anysegwit` is negotiated:
* * `OP_1` through `OP_16` inclusive, followed by a single push of 2 to 40 bytes
* (witness program versions 1 through 16)
*
* A receiving node:
*...
Expand Down
2 changes: 1 addition & 1 deletion tests/test_closing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2626,7 +2626,7 @@ def test_segwit_shutdown_script(node_factory, bitcoind, executor):
"""
l1 = node_factory.get_node(allow_warning=True)

# BOLT-4e329271a358ee52bf43ddbd96776943c5d74508 #2:
# BOLT #2:
# 5. if (and only if) `option_shutdown_anysegwit` is negotiated:
# * `OP_1` through `OP_16` inclusive, followed by a single push of 2 to 40 bytes
# (witness program versions 1 through 16)
Expand Down

0 comments on commit 673d680

Please sign in to comment.