Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bolt updates after 24.11 #7887

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CCANDIR := ccan

# Where we keep the BOLT RFCs
BOLTDIR := ../bolts/
DEFAULT_BOLTVERSION := 5dec5eb84957d70c9fedf27173e78f1b0b6b0217
DEFAULT_BOLTVERSION := aa5207aeaa32d841353dd2df3ce725a4046d528d
# Can be overridden on cmdline.
BOLTVERSION := $(DEFAULT_BOLTVERSION)

Expand Down
11 changes: 5 additions & 6 deletions common/key_derive.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
*
* pubkey = basepoint + SHA256(per_commitment_point || basepoint) * G
*
* The `localpubkey` uses the local node's `payment_basepoint`;
* The `remotepubkey` uses the remote node's `payment_basepoint`;
* the `local_htlcpubkey` uses the local node's `htlc_basepoint`;
* the `remote_htlcpubkey` uses the remote node's `htlc_basepoint`;
* the `local_delayedpubkey` uses the local node's `delayed_payment_basepoint`;
* and the `remote_delayedpubkey` uses the remote node's `delayed_payment_basepoint`.
* - The `localpubkey` uses the local node's `payment_basepoint`;
* - The `local_htlcpubkey` uses the local node's `htlc_basepoint`;
* - The `remote_htlcpubkey` uses the remote node's `htlc_basepoint`;
* - The `local_delayedpubkey` uses the local node's `delayed_payment_basepoint`;
* - The `remote_delayedpubkey` uses the remote node's `delayed_payment_basepoint`.
*...
* The `remotepubkey` is simply the remote node's `payment_basepoint`.
*/
Expand Down
11 changes: 5 additions & 6 deletions common/keyset.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ bool derive_keyset(const struct pubkey *per_commitment_point,
*
* pubkey = basepoint + SHA256(per_commitment_point || basepoint) * G
*
* The `localpubkey` uses the local node's `payment_basepoint`;
* The `remotepubkey` uses the remote node's `payment_basepoint`;
* the `local_htlcpubkey` uses the local node's `htlc_basepoint`;
* the `remote_htlcpubkey` uses the remote node's `htlc_basepoint`;
* the `local_delayedpubkey` uses the local node's `delayed_payment_basepoint`;
* and the `remote_delayedpubkey` uses the remote node's `delayed_payment_basepoint`.
* - The `localpubkey` uses the local node's `payment_basepoint`;
* - The `local_htlcpubkey` uses the local node's `htlc_basepoint`;
* - The `remote_htlcpubkey` uses the remote node's `htlc_basepoint`;
* - The `local_delayedpubkey` uses the local node's `delayed_payment_basepoint`;
* - The `remote_delayedpubkey` uses the remote node's `delayed_payment_basepoint`.
*/
if (!derive_simple_key(&self->payment,
per_commitment_point,
Expand Down
8 changes: 7 additions & 1 deletion common/test/run-bolt11.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ static void test_b11(const char *b11str,
assert(!expect_b11->description);
else
assert(streq(b11->description, expect_b11->description));
if (b11->description_hash)
assert(sha256_eq(b11->description_hash, expect_b11->description_hash));

if (!b11->payment_secret)
assert(!expect_b11->payment_secret);
Expand Down Expand Up @@ -252,7 +254,7 @@ int main(int argc, char *argv[])
* * `p`: payment hash...
* * `h`: tagged field: hash of description
* * `p5`: `data_length` (`p` = 1, `5` = 20; 1 * 32 + 20 == 52)
* * `8yjmdan79s6qqdhdzgynm4zwqd5d7xmw5fk98klysy043l2ahrqs`: SHA256 of 'One piece of chocolate cake, one icecream cone, one pickle, one slice of swiss cheese, one slice of salami, one lollypop, one piece of cherry pie, one sausage, one cupcake, and one slice of watermelon'
* * `8yjmdan79s6qqdhdzgynm4zwqd5d7xmw5fk98klysy043l2ahrqs`: SHA256 of 'One piece of chocolate cake, one icecream cone, one pickle, one slice of swiss cheese, one slice of salami, one lollypop, one piece of cherry pie, one sausage, one cupcake, and one slice of watermelon' (SHA256 hex: `3925b6f67e2c340036ed12093dd44e0368df1b6ea26c53dbe4811f58fd5db8c1`)
* * `9`: features
* * `qr`: `data_length` (`q` = 0, `r` = 3; 0 * 32 + 3 == 3)
* * `sgq`: b100000100000000
Expand All @@ -271,6 +273,10 @@ int main(int argc, char *argv[])
abort();
b11->receiver_id = node;
b11->description_hash = tal(b11, struct sha256);
if (!hex_decode("3925b6f67e2c340036ed12093dd44e0368df1b6ea26c53dbe4811f58fd5db8c1",
strlen("3925b6f67e2c340036ed12093dd44e0368df1b6ea26c53dbe4811f58fd5db8c1"),
b11->description_hash, sizeof(*b11->description_hash)))
abort();
set_feature_bit(&b11->features, 8);
set_feature_bit(&b11->features, 14);

Expand Down
4 changes: 3 additions & 1 deletion lightningd/channel_gossip.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ static void send_private_cupdate(struct channel *channel, bool even_if_redundant
*
* - MAY create a `channel_update` to communicate the channel
* parameters to the channel peer, even though the channel has not
* yet been announced (i.e. the `announce_channel` bit was not set).
* yet been announced (i.e. the `announce_channel` bit was not set
* or the `channel_update` is sent before the peers exchanged
* [announcement signatures](#the-announcement_signatures-message)).
* - MUST set the `short_channel_id` to either an `alias` it has
* received from the peer, or the real channel `short_channel_id`.
* - MUST set `dont_forward` to 1 in `message_flags`
Expand Down
3 changes: 1 addition & 2 deletions wire/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ BOLT12_PATCHES := $(sort $(wildcard wire/extracted_bolt12*.patch))
# Explicit command to re-extract CSV from BOLTs and patch.
# This is not a normal make depencency, since we don't want this
# called implicitly.
# Note: You will need to run extract-bolt12-csv manually!
extract-bolt-csv: extract-peer-csv extract-onion-csv
extract-bolt-csv: extract-peer-csv extract-onion-csv extract-bolt12-csv

extract-peer-csv: wire/peer_wire.csv.raw
@set -e; T=wire/peer_wire.csv; trap "rm -f $$T.$$$$" 0; cp $< $$T.$$$$; for p in $(PEER_PATCHES); do echo APPLY $$p; patch $$T.$$$$ $$p; done; mv $$T.$$$$ $$T
Expand Down
14 changes: 0 additions & 14 deletions wire/extracted_onion_02_offers.patch

This file was deleted.

12 changes: 6 additions & 6 deletions wire/extracted_onion_03_onionmsg-payload-as-bytearr.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ index 5c52fe9a1..2ac0c4cff 100644
tlvtype,onionmsg_tlv,encrypted_data_tlv,4
tlvdata,onionmsg_tlv,encrypted_data_tlv,encrypted_data_tlv,byte,...
tlvtype,onionmsg_tlv,invoice_request,64
-tlvdata,onionmsg_tlv,invoice_request,invoice_request,tlv_invoice_request,
+tlvdata,onionmsg_tlv,invoice_request,invoice_request,byte,...
-tlvdata,onionmsg_tlv,invoice_request,invreq,tlv_invoice_request,
+tlvdata,onionmsg_tlv,invoice_request,invreq,byte,...
tlvtype,onionmsg_tlv,invoice,66
-tlvdata,onionmsg_tlv,invoice,invoice,tlv_invoice,
+tlvdata,onionmsg_tlv,invoice,invoice,byte,...
-tlvdata,onionmsg_tlv,invoice,inv,tlv_invoice,
+tlvdata,onionmsg_tlv,invoice,inv,byte,...
tlvtype,onionmsg_tlv,invoice_error,68
-tlvdata,onionmsg_tlv,invoice_error,invoice_error,tlv_invoice_error,
+tlvdata,onionmsg_tlv,invoice_error,invoice_error,byte,...
-tlvdata,onionmsg_tlv,invoice_error,inverr,tlv_invoice_error,
+tlvdata,onionmsg_tlv,invoice_error,inverr,byte,...
13 changes: 0 additions & 13 deletions wire/extracted_onion_06_blinded_path_first_sciddir_or_pubkey.patch

This file was deleted.

4 changes: 2 additions & 2 deletions wire/extracted_peer_06_funding_outpoint_sigs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
subtype,witness
subtypedata,witness,len,u16,
subtypedata,witness,witness_data,byte,len
+tlvtype,txsigs_tlvs,funding_outpoint_sig,0
+tlvdata,txsigs_tlvs,funding_outpoint_sig,sig,byte,...
+tlvtype,txsigs_tlvs,shared_input_signature,0
+tlvdata,txsigs_tlvs,shared_input_signature,signature,signature,
msgtype,tx_init_rbf,72
msgdata,tx_init_rbf,channel_id,channel_id,
msgdata,tx_init_rbf,locktime,u32,
14 changes: 14 additions & 0 deletions wire/extracted_peer_08_add_input_tlvs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git b/wire/peer_wire.csv a/wire/peer_wire.csv
index 6543e34ee4..c36d90807b 100644
--- b/wire/peer_wire.csv
+++ a/wire/peer_wire.csv
@@ -44,6 +44,9 @@ msgdata,tx_add_input,prevtx_len,u16,
msgdata,tx_add_input,prevtx,byte,prevtx_len
msgdata,tx_add_input,prevtx_vout,u32,
msgdata,tx_add_input,sequence,u32,
+msgdata,tx_add_input,tlvs,tx_add_input_tlvs,
+tlvtype,tx_add_input_tlvs,shared_input_txid,0
+tlvdata,tx_add_input_tlvs,shared_input_txid,funding_txid,sha256,
msgtype,tx_add_output,67
msgdata,tx_add_output,channel_id,channel_id,
msgdata,tx_add_output,serial_id,u64,
13 changes: 6 additions & 7 deletions wire/extracted_peer_11_splice.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,33 @@ diff --git a/wire/peer_wire.csv b/wire/peer_wire.csv
index 5b5803afc..41b57e85b 100644
--- a/wire/peer_wire.csv
+++ b/wire/peer_wire.csv
@@ -206,6 +206,20 @@ subtypedata,lease_rates,channel_fee_max_base_msat,tu32,
@@ -206,6 +206,18 @@ subtypedata,lease_rates,channel_fee_max_base_msat,tu32,
msgtype,stfu,2
msgdata,stfu,channel_id,channel_id,
msgdata,stfu,initiator,u8,
+msgtype,splice,75
+msgtype,splice,80
+msgdata,splice,channel_id,channel_id,
+msgdata,splice,chain_hash,chain_hash,
+msgdata,splice,relative_satoshis,s64,
+msgdata,splice,funding_feerate_perkw,u32,
+msgdata,splice,locktime,u32,
+msgdata,splice,funding_pubkey,point,
+msgtype,splice_ack,76
+msgtype,splice_ack,81
+msgdata,splice_ack,channel_id,channel_id,
+msgdata,splice_ack,chain_hash,chain_hash,
+msgdata,splice_ack,relative_satoshis,s64,
+msgdata,splice_ack,funding_pubkey,point,
+msgtype,splice_locked,77,
+msgdata,splice_locked,channel_id,channel_id,
msgtype,shutdown,38
msgdata,shutdown,channel_id,channel_id,
msgdata,shutdown,len,u16,
@@ -264,6 +250,9 @@ msgdata,commitment_signed,channel_id,channel_id,
@@ -264,6 +250,10 @@ msgdata,commitment_signed,channel_id,channel_id,
msgdata,commitment_signed,signature,signature,
msgdata,commitment_signed,num_htlcs,u16,
msgdata,commitment_signed,htlc_signature,signature,num_htlcs
+msgdata,commitment_signed,splice_channel_id,commitment_signed_tlvs,
+tlvtype,commitment_signed_tlvs,splice_info,0
+tlvdata,commitment_signed_tlvs,splice_info,splice_channel_id,channel_id,
+tlvdata,commitment_signed_tlvs,splice_info,batch_size,u16,
+tlvdata,commitment_signed_tlvs,splice_info,funding_txid,channel_id,
msgtype,revoke_and_ack,133
msgdata,revoke_and_ack,channel_id,channel_id,
msgdata,revoke_and_ack,per_commitment_secret,byte,32
6 changes: 3 additions & 3 deletions wire/onion_wire.csv
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ tlvdata,onionmsg_tlv,reply_path,path,blinded_path,
tlvtype,onionmsg_tlv,encrypted_recipient_data,4
tlvdata,onionmsg_tlv,encrypted_recipient_data,encrypted_recipient_data,byte,...
tlvtype,onionmsg_tlv,invoice_request,64
tlvdata,onionmsg_tlv,invoice_request,invoice_request,byte,...
tlvdata,onionmsg_tlv,invoice_request,invreq,byte,...
tlvtype,onionmsg_tlv,invoice,66
tlvdata,onionmsg_tlv,invoice,invoice,byte,...
tlvdata,onionmsg_tlv,invoice,inv,byte,...
tlvtype,onionmsg_tlv,invoice_error,68
tlvdata,onionmsg_tlv,invoice_error,invoice_error,byte,...
tlvdata,onionmsg_tlv,invoice_error,inverr,byte,...
Loading