Skip to content

Commit

Permalink
doc: update bolt version
Browse files Browse the repository at this point in the history
And sweep through and remove git qualifiers from many BOLT strings.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Aug 24, 2020
1 parent 95294e2 commit 007daf6
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 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/
BOLTVERSION := 9e8e29af9b9a922eb114b2c716205d0772946e56
BOLTVERSION := f8ef3b42221295f3913aa1b0663221dadd5776f6

-include config.vars

Expand Down
2 changes: 1 addition & 1 deletion common/bolt11.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ struct bolt11 *bolt11_decode(const tal_t *ctx, const char *str,
* amount required for payment.
*/
b11->msat = tal(b11, struct amount_msat);
/* BOLT-50143e388e16a449a92ed574fc16eb35b51426b9 #11:
/* BOLT #11:
*
* - if multiplier is `p` and the last decimal of `amount` is
* not 0:
Expand Down
6 changes: 3 additions & 3 deletions common/sphinx.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,10 @@ struct onionpacket *create_onionpacket(
packet->version = 0;
memset(nexthmac.bytes, 0, sizeof(nexthmac.bytes));

/* BOLT-e116441ee836447ac3f24cdca62bac1e0f223d5f #4:
/* BOLT #4:
*
* The packet is initialized with 1366 _random_ bytes derived from a
* CSPRNG.
* The packet is initialized with 1300 _random_ bytes derived from a
* CSPRNG
*/
/* Note that this is just hop_payloads: the rest of the packet is
* overwritten below or above anyway. */
Expand Down
21 changes: 11 additions & 10 deletions common/test/run-bolt11.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ int main(void)

test_b11("lnbc25m1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5vdhkven9v5sxyetpdeessp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs9q5sqqqqqqqqqqqqqqqpqsq67gye39hfg3zd8rgc80k32tvy9xk2xunwm5lzexnvpx6fd77en8qaq424dxgt56cag2dpt359k3ssyhetktkpqh24jqnjyw6uqd08sgptq44qu", b11, NULL);

/* BOLT-4e228a7fb4ea78af914d1ce82a63cbce8026279e #11
/* BOLT #11
*
* > ### Same, but including fields which must be ignored.
* > lnbc25m1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5vdhkven9v5sxyetpdeessp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs9q5sqqqqqqqqqqqqqqqpqsq2qrqqqfppnqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqppnqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpp4qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqhpnqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqhp4qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqspnqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqsp4qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqnp5qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqnpkqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq2jxxfsnucm4jf4zwtznpaxphce606fvhvje5x7d4gw7n73994hgs7nteqvenq8a4ml8aqtchv5d9pf7l558889hp4yyrqv6a7zpq9fgpskqhza
Expand Down Expand Up @@ -472,7 +472,8 @@ int main(void)
set_feature_bit(&fset->bits[BOLT11_FEATURE], 101);
assert(bolt11_decode(tmpctx, badstr, fset, NULL, &fail));

/* BOLT-1fbccd30bb503203e4a255de67f9adb504563425 #11:
/* FIXME: quoting description in here causes a spurious mismatch! */
/* BOLT #11:
*
* > ### Please send 0.00967878534 BTC for a list of items within one week, amount in pico-BTC
* > lnbc9678785340p1pwmna7lpp5gc3xfm08u9qy06djf8dfflhugl6p7lgza6dsjxq454gxhj9t7a0sd8dgfkx7cmtwd68yetpd5s9xar0wfjn5gpc8qhrsdfq24f5ggrxdaezqsnvda3kkum5wfjkzmfqf3jkgem9wgsyuctwdus9xgrcyqcjcgpzgfskx6eqf9hzqnteypzxz7fzypfhg6trddjhygrcyqezcgpzfysywmm5ypxxjemgw3hxjmn8yptk7untd9hxwg3q2d6xjcmtv4ezq7pqxgsxzmnyyqcjqmt0wfjjq6t5v4khxxqyjw5qcqp2rzjq0gxwkzc8w6323m55m4jyxcjwmy7stt9hwkwe2qxmy8zpsgg7jcuwz87fcqqeuqqqyqqqqlgqqqqn3qq9qn07ytgrxxzad9hc4xt3mawjjt8znfv8xzscs7007v9gh9j569lencxa8xeujzkxs0uamak9aln6ez02uunw6rd2ht2sqe4hz8thcdagpleym0j
Expand All @@ -488,7 +489,7 @@ int main(void)
* * `gc3xfm08u9qy06djf8dfflhugl6p7lgza6dsjxq454gxhj9t7a0s`: payment hash 462264ede7e14047e9b249da94fefc47f41f7d02ee9b091815a5506bc8abf75f
* * `d`: short description
* * `8d`: `data_length` (`8` = 7, `d` = 13; 7 * 32 + 13 == 237)
* * `gfkx7cmtwd68yetpd5s9xar0wfjn5gpc8qhrsdfq24f5ggrxdaezqsnvda3kkum5wfjkzmfqf3jkgem9wgsyuctwdus9xgrcyqcjcgpzgfskx6eqf9hzqnteypzxz7fzypfhg6trddjhygrcyqezcgpzfysywmm5ypxxjemgw3hxjmn8yptk7untd9hxwg3q2d6xjcmtv4ezq7pqxgsxzmnyyqcjqmt0wfjjq6t5v4khx`: 'Blockstream Store: 88.85 USD for Blockstream Ledger Nano S x 1, \"Back In My Day\" Sticker x 2, \"I Got Lightning Working\" Sticker x 2 and 1 more items'
* * `gfkx7cmtwd68yetpd5s9xar0wfjn5gpc8qhrsdfq24f5ggrxdaezqsnvda3kkum5wfjkzmfqf3jkgem9wgsyuctwdus9xgrcyqcjcgpzgfskx6eqf9hzqnteypzxz7fzypfhg6trddjhygrcyqezcgpzfysywmm5ypxxjemgw3hxjmn8yptk7untd9hxwg3q2d6xjcmtv4ezq7pqxgsxzmnyyqcjqmt0wfjjq6t5v4khx`: ...
* * `x`: expiry time
* * `qy`: `data_length` (`q` = 0, `y` = 2; 0 * 32 + 4 == 4)
* * `jw5q`: 604800 seconds (`j` = 18, `w` = 14, `5` = 20, `q` = 0; 18 * 32^3 + 14 * 32^2 + 20 * 32 + 0 == 604800)
Expand Down Expand Up @@ -530,49 +531,49 @@ int main(void)
b11->routes[0]->cltv_expiry_delta = 40;
test_b11("lnbc9678785340p1pwmna7lpp5gc3xfm08u9qy06djf8dfflhugl6p7lgza6dsjxq454gxhj9t7a0sd8dgfkx7cmtwd68yetpd5s9xar0wfjn5gpc8qhrsdfq24f5ggrxdaezqsnvda3kkum5wfjkzmfqf3jkgem9wgsyuctwdus9xgrcyqcjcgpzgfskx6eqf9hzqnteypzxz7fzypfhg6trddjhygrcyqezcgpzfysywmm5ypxxjemgw3hxjmn8yptk7untd9hxwg3q2d6xjcmtv4ezq7pqxgsxzmnyyqcjqmt0wfjjq6t5v4khxxqyjw5qcqp2rzjq0gxwkzc8w6323m55m4jyxcjwmy7stt9hwkwe2qxmy8zpsgg7jcuwz87fcqqeuqqqyqqqqlgqqqqn3qq9qn07ytgrxxzad9hc4xt3mawjjt8znfv8xzscs7007v9gh9j569lencxa8xeujzkxs0uamak9aln6ez02uunw6rd2ht2sqe4hz8thcdagpleym0j", b11, NULL);

/* BOLT-4e228a7fb4ea78af914d1ce82a63cbce8026279e #11:
/* BOLT #11:
*
* > ### Bech32 checksum is invalid.
* > lnbc2500u1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpquwpc4curk03c9wlrswe78q4eyqc7d8d0xqzpuyk0sg5g70me25alkluzd2x62aysf2pyy8edtjeevuv4p2d5p76r4zkmneet7uvyakky2zr4cusd45tftc9c5fh0nnqpnl2jfll544esqchsrnt
*/
assert(!bolt11_decode(tmpctx, "lnbc2500u1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpquwpc4curk03c9wlrswe78q4eyqc7d8d0xqzpuyk0sg5g70me25alkluzd2x62aysf2pyy8edtjeevuv4p2d5p76r4zkmneet7uvyakky2zr4cusd45tftc9c5fh0nnqpnl2jfll544esqchsrnt", NULL, NULL, &fail));
assert(streq(fail, "Bad bech32 string"));

/* BOLT-4e228a7fb4ea78af914d1ce82a63cbce8026279e #11:
/* BOLT #11:
* > ### Malformed bech32 string (no 1)
* > pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpquwpc4curk03c9wlrswe78q4eyqc7d8d0xqzpuyk0sg5g70me25alkluzd2x62aysf2pyy8edtjeevuv4p2d5p76r4zkmneet7uvyakky2zr4cusd45tftc9c5fh0nnqpnl2jfll544esqchsrny
*/
assert(!bolt11_decode(tmpctx, "pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpquwpc4curk03c9wlrswe78q4eyqc7d8d0xqzpuyk0sg5g70me25alkluzd2x62aysf2pyy8edtjeevuv4p2d5p76r4zkmneet7uvyakky2zr4cusd45tftc9c5fh0nnqpnl2jfll544esqchsrny", NULL, NULL, &fail));
assert(streq(fail, "Bad bech32 string"));

/* BOLT-4e228a7fb4ea78af914d1ce82a63cbce8026279e #11:
/* BOLT #11:
* > ### Malformed bech32 string (mixed case)
* > LNBC2500u1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpquwpc4curk03c9wlrswe78q4eyqc7d8d0xqzpuyk0sg5g70me25alkluzd2x62aysf2pyy8edtjeevuv4p2d5p76r4zkmneet7uvyakky2zr4cusd45tftc9c5fh0nnqpnl2jfll544esqchsrny
*/
assert(!bolt11_decode(tmpctx, "LNBC2500u1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpquwpc4curk03c9wlrswe78q4eyqc7d8d0xqzpuyk0sg5g70me25alkluzd2x62aysf2pyy8edtjeevuv4p2d5p76r4zkmneet7uvyakky2zr4cusd45tftc9c5fh0nnqpnl2jfll544esqchsrny", NULL, NULL, &fail));
assert(streq(fail, "Bad bech32 string"));

/* BOLT-4e228a7fb4ea78af914d1ce82a63cbce8026279e #11:
/* BOLT #11:
* > ### Signature is not recoverable.
* > lnbc2500u1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpuaxtrnwngzn3kdzw5hydlzf03qdgm2hdq27cqv3agm2awhz5se903vruatfhq77w3ls4evs3ch9zw97j25emudupq63nyw24cg27h2rspk28uwq
*/
assert(!bolt11_decode(tmpctx, "lnbc2500u1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpuaxtrnwngzn3kdzw5hydlzf03qdgm2hdq27cqv3agm2awhz5se903vruatfhq77w3ls4evs3ch9zw97j25emudupq63nyw24cg27h2rspk28uwq", NULL, NULL, &fail));
assert(streq(fail, "signature recovery failed"));

/* BOLT-4e228a7fb4ea78af914d1ce82a63cbce8026279e #11:
/* BOLT #11:
* > ### String is too short.
* > lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6na6hlh
*/
assert(!bolt11_decode(tmpctx, "lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6na6hlh", NULL, NULL, &fail));

/* BOLT-4e228a7fb4ea78af914d1ce82a63cbce8026279e #11:
/* BOLT #11:
* > ### Invalid multiplier
* > lnbc2500x1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpujr6jxr9gq9pv6g46y7d20jfkegkg4gljz2ea2a3m9lmvvr95tq2s0kvu70u3axgelz3kyvtp2ywwt0y8hkx2869zq5dll9nelr83zzqqpgl2zg
*/
assert(!bolt11_decode(tmpctx, "lnbc2500x1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpujr6jxr9gq9pv6g46y7d20jfkegkg4gljz2ea2a3m9lmvvr95tq2s0kvu70u3axgelz3kyvtp2ywwt0y8hkx2869zq5dll9nelr83zzqqpgl2zg", NULL, NULL, &fail));
assert(streq(fail, "Invalid amount postfix 'x'"));

/* BOLT- #11:
/* BOLT #11:
* > ### Invalid sub-millisatoshi precision.
* > lnbc2500000001p1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpu7hqtk93pkf7sw55rdv4k9z2vj050rxdr6za9ekfs3nlt5lr89jqpdmxsmlj9urqumg0h9wzpqecw7th56tdms40p2ny9q4ddvjsedzcplva53s
*/
Expand Down
4 changes: 2 additions & 2 deletions connectd/peer_exchange_initmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static struct io_plan *peer_init_received(struct io_conn *conn,
return io_close(conn);
}

/* BOLT-ef7c97c02b6fa67a1df1af30b3843eb576100ebd #1:
/* BOLT #1:
* The receiving node:
* ...
* - upon receiving `networks` containing no common chains
Expand Down Expand Up @@ -151,7 +151,7 @@ struct io_plan *peer_exchange_initmsg(struct io_conn *conn,
peer->addr = *addr;
peer->cs = *cs;

/* BOLT-ef7c97c02b6fa67a1df1af30b3843eb576100ebd #1:
/* BOLT #1:
*
* The sending node:
* - MUST send `init` as the first Lightning message for any
Expand Down
19 changes: 9 additions & 10 deletions lightningd/peer_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,17 +563,16 @@ static struct amount_sat commit_txfee(const struct channel *channel,

/*
* BOLT-f5490f17d17ff49dc26ee459432b3c9db4fda8a9 #2:
* Adding an HTLC: update_add_htlc
*
* A sending node:
* - if it is responsible for paying the Bitcoin fee:
* - SHOULD NOT offer amount_msat if, after adding that HTLC to its
* commitment transaction, its remaining balance doesn't allow it
* to pay the fee for a future additional non-dust HTLC at a
* higher feerate while maintaining its channel reserve
* ("fee spike buffer"). A buffer of 2*feerate_per_kw is
* recommended to ensure predictability.
*/
*...
* - SHOULD NOT offer `amount_msat` if, after adding that HTLC to its
* commitment transaction, its remaining balance doesn't allow it to
* pay the commitment transaction fee when receiving or sending a
* future additional non-dust HTLC while maintaining its channel
* reserve. It is recommended that this "fee spike buffer" can
* handle twice the current `feerate_per_kw` to ensure
* predictability between implementations.
*/
fee = commit_tx_base_fee(2 * feerate, num_untrimmed_htlcs + 1,
channel->option_anchor_outputs);

Expand Down

0 comments on commit 007daf6

Please sign in to comment.