Skip to content

Bolt updates v24.11 #7586

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

Merged
Merged
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
20 changes: 17 additions & 3 deletions .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,7 @@
"DecodeInvreq_paths": {
"Decode.invreq_paths[].blinding": 2,
"Decode.invreq_paths[].first_node_id": 3,
"Decode.invreq_paths[].first_path_key": 6,
"Decode.invreq_paths[].first_scid": 4,
"Decode.invreq_paths[].first_scid_dir": 1,
"Decode.invreq_paths[].path[]": 5
Expand All @@ -922,6 +923,7 @@
"DecodeOffer_paths": {
"Decode.offer_paths[].blinding": 2,
"Decode.offer_paths[].first_node_id": 1,
"Decode.offer_paths[].first_path_key": 6,
"Decode.offer_paths[].first_scid": 5,
"Decode.offer_paths[].first_scid_dir": 4,
"Decode.offer_paths[].path[]": 3
Expand Down Expand Up @@ -4437,12 +4439,16 @@
},
"Decode.invoice_paths[].blinding": {
"added": "pre-v0.10.1",
"deprecated": null
"deprecated": "v24.11"
},
"Decode.invoice_paths[].first_node_id": {
"added": "pre-v0.10.1",
"deprecated": null
},
"Decode.invoice_paths[].first_path_key": {
"added": "v24.11",
"deprecated": null
},
"Decode.invoice_paths[].first_scid": {
"added": "v23.05",
"deprecated": null
Expand Down Expand Up @@ -4517,12 +4523,16 @@
},
"Decode.invreq_paths[].blinding": {
"added": "v24.08",
"deprecated": null
"deprecated": "v24.11"
},
"Decode.invreq_paths[].first_node_id": {
"added": "v24.08",
"deprecated": null
},
"Decode.invreq_paths[].first_path_key": {
"added": "v24.11",
"deprecated": null
},
"Decode.invreq_paths[].first_scid": {
"added": "v24.08",
"deprecated": null
Expand Down Expand Up @@ -4621,12 +4631,16 @@
},
"Decode.offer_paths[].blinding": {
"added": "pre-v0.10.1",
"deprecated": null
"deprecated": "v24.11"
},
"Decode.offer_paths[].first_node_id": {
"added": "pre-v0.10.1",
"deprecated": null
},
"Decode.offer_paths[].first_path_key": {
"added": "v24.11",
"deprecated": null
},
"Decode.offer_paths[].first_scid": {
"added": "v23.05",
"deprecated": null
Expand Down
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 := 57ce4b1e05c996fa649f00dc13521f6d496a288f
DEFAULT_BOLTVERSION := 5dec5eb84957d70c9fedf27173e78f1b0b6b0217
# Can be overridden on cmdline.
BOLTVERSION := $(DEFAULT_BOLTVERSION)

Expand Down
24 changes: 12 additions & 12 deletions channeld/channeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static void handle_stfu(struct peer *peer, const u8 *stfu)

status_debug("STFU initiator was remote.");
} else {
/* BOLT-quiescent #2:
/* BOLT #2:
*
* If both sides send `stfu` simultaneously, they will both
* set `initiator` to `1`, in which case the "initiator" is
Expand All @@ -329,7 +329,7 @@ static void handle_stfu(struct peer *peer, const u8 *stfu)
}
}

/* BOLT-quiescent #2:
/* BOLT #2:
* The receiver of `stfu`:
* - if it has sent `stfu` then:
* - MUST now consider the channel to be quiescent
Expand Down Expand Up @@ -622,7 +622,7 @@ static void handle_peer_add_htlc(struct peer *peer, const u8 *msg)
}
add_err = channel_add_htlc(peer->channel, REMOTE, id, amount,
cltv_expiry, &payment_hash,
onion_routing_packet, tlvs->blinding_point, &htlc, NULL,
onion_routing_packet, tlvs->blinded_path, &htlc, NULL,
/* We don't immediately fail incoming htlcs,
* instead we wait and fail them after
* they've been committed */
Expand Down Expand Up @@ -1496,7 +1496,7 @@ static void marshall_htlc_info(const tal_t *ctx,
memcpy(a.onion_routing_packet,
htlc->routing,
sizeof(a.onion_routing_packet));
a.blinding = htlc->blinding;
a.path_key = htlc->path_key;
a.fail_immediate = htlc->fail_immediate;
tal_arr_expand(added, a);
} else if (htlc->state == RCVD_REMOVE_COMMIT) {
Expand Down Expand Up @@ -4410,10 +4410,10 @@ static void resend_commitment(struct peer *peer, struct changed_htlc *last)

if (h->state == SENT_ADD_COMMIT) {
struct tlv_update_add_htlc_tlvs *tlvs;
if (h->blinding) {
if (h->path_key) {
tlvs = tlv_update_add_htlc_tlvs_new(tmpctx);
tlvs->blinding_point = tal_dup(tlvs, struct pubkey,
h->blinding);
tlvs->blinded_path = tal_dup(tlvs, struct pubkey,
h->path_key);
} else
tlvs = NULL;
msg = towire_update_add_htlc(NULL, &peer->channel_id,
Expand Down Expand Up @@ -5346,7 +5346,7 @@ static void handle_offer_htlc(struct peer *peer, const u8 *inmsg)
const u8 *failwiremsg;
const char *failstr;
struct amount_sat htlc_fee;
struct pubkey *blinding;
struct pubkey *path_key;
struct tlv_update_add_htlc_tlvs *tlvs;

if (!peer->channel_ready[LOCAL] || !peer->channel_ready[REMOTE])
Expand All @@ -5355,18 +5355,18 @@ static void handle_offer_htlc(struct peer *peer, const u8 *inmsg)

if (!fromwire_channeld_offer_htlc(tmpctx, inmsg, &amount,
&cltv_expiry, &payment_hash,
onion_routing_packet, &blinding))
onion_routing_packet, &path_key))
master_badmsg(WIRE_CHANNELD_OFFER_HTLC, inmsg);

if (blinding) {
if (path_key) {
tlvs = tlv_update_add_htlc_tlvs_new(tmpctx);
tlvs->blinding_point = tal_dup(tlvs, struct pubkey, blinding);
tlvs->blinded_path = tal_dup(tlvs, struct pubkey, path_key);
} else
tlvs = NULL;

e = channel_add_htlc(peer->channel, LOCAL, peer->htlc_id,
amount, cltv_expiry, &payment_hash,
onion_routing_packet, take(blinding), NULL,
onion_routing_packet, take(path_key), NULL,
&htlc_fee, true);
status_debug("Adding HTLC %"PRIu64" amount=%s cltv=%u gave %s",
peer->htlc_id,
Expand Down
2 changes: 1 addition & 1 deletion channeld/channeld_htlc.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct htlc {
const u8 *routing;

/* Blinding (optional). */
struct pubkey *blinding;
struct pubkey *path_key;

/* Should we immediately fail this htlc? */
bool fail_immediate;
Expand Down
2 changes: 1 addition & 1 deletion channeld/channeld_wire.csv
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ msgdata,channeld_offer_htlc,amount_msat,amount_msat,
msgdata,channeld_offer_htlc,cltv_expiry,u32,
msgdata,channeld_offer_htlc,payment_hash,sha256,
msgdata,channeld_offer_htlc,onion_routing_packet,u8,1366
msgdata,channeld_offer_htlc,blinding,?pubkey,
msgdata,channeld_offer_htlc,path_key,?pubkey,

# Reply; synchronous since IDs have to increment.
msgtype,channeld_offer_htlc_reply,1104
Expand Down
10 changes: 5 additions & 5 deletions channeld/full_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ static enum channel_add_err add_htlc(struct channel *channel,
u32 cltv_expiry,
const struct sha256 *payment_hash,
const u8 routing[TOTAL_PACKET_SIZE(ROUTING_INFO_SIZE)],
const struct pubkey *blinding TAKES,
const struct pubkey *path_key TAKES,
struct htlc **htlcp,
bool enforce_aggregate_limits,
struct amount_sat *htlc_fee,
Expand All @@ -605,7 +605,7 @@ static enum channel_add_err add_htlc(struct channel *channel,
htlc->fail_immediate = false;

htlc->rhash = *payment_hash;
htlc->blinding = tal_dup_or_null(htlc, struct pubkey, blinding);
htlc->path_key = tal_dup_or_null(htlc, struct pubkey, path_key);
htlc->failed = NULL;
htlc->r = NULL;
htlc->routing = tal_dup_arr(htlc, u8, routing, TOTAL_PACKET_SIZE(ROUTING_INFO_SIZE), 0);
Expand Down Expand Up @@ -898,7 +898,7 @@ enum channel_add_err channel_add_htlc(struct channel *channel,
u32 cltv_expiry,
const struct sha256 *payment_hash,
const u8 routing[TOTAL_PACKET_SIZE(ROUTING_INFO_SIZE)],
const struct pubkey *blinding TAKES,
const struct pubkey *path_key TAKES,
struct htlc **htlcp,
struct amount_sat *htlc_fee,
bool err_immediate_failures)
Expand All @@ -918,7 +918,7 @@ enum channel_add_err channel_add_htlc(struct channel *channel,
status_broken("Peer sent out-of-order HTLC ids (is that you, old c-lightning node?)");

return add_htlc(channel, state, id, amount, cltv_expiry,
payment_hash, routing, blinding,
payment_hash, routing, path_key,
htlcp, true, htlc_fee, err_immediate_failures);
}

Expand Down Expand Up @@ -1616,7 +1616,7 @@ bool channel_force_htlcs(struct channel *channel,
htlcs[i]->cltv_expiry,
&htlcs[i]->payment_hash,
htlcs[i]->onion_routing_packet,
htlcs[i]->blinding,
htlcs[i]->path_key,
&htlc, false, NULL, false);
if (e != CHANNEL_ERR_ADD_OK) {
status_broken("%s HTLC %"PRIu64" failed error %u",
Expand Down
8 changes: 5 additions & 3 deletions channeld/test/run-full_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,11 @@ int main(int argc, const char *argv[])
*/
local_per_commitment_point = pubkey_from_hex("025f7117a78150fe2ef97db7cfc83bd57b2e2c0d0dd25eaf467a4a1c2a45ce1486");
/* BOLT #3:
* localpubkey: 030d417a46946384f88d5f3337267c5e579765875dc4daca813e21734b140639e7
* remotepubkey: 0394854aa6eab5b2a8122cc726e9dded053a2184d88256816826d6231c068d4a5b
* local_funding_pubkey: 023da092f6980e58d2c037173180e9a465476026ee50f96695963e8efe436f54eb
* remote_funding_pubkey: 030e9f7b623d2ccc7c9bd44d66d5ce21ce504c0acf6385a132cec6d3c39fa711c1
* local_privkey: bb13b121cdc357cd2e608b0aea294afca36e2b34cf958e2e6451a2f27469449101
* local_htlcpubkey: 030d417a46946384f88d5f3337267c5e579765875dc4daca813e21734b140639e7
* remote_htlcpubkey: 0394854aa6eab5b2a8122cc726e9dded053a2184d88256816826d6231c068d4a5b
* local_delayedpubkey: 03fd5960528dc152014952efdb702a88f71e3c1653b2314431701ec77e57fde83c
* local_revocation_pubkey: 0212a140cd0c6539d07cd08dfe09984dec3251ea808b892efeac3ede9402bf2b19
*/
Expand All @@ -526,7 +529,6 @@ int main(int argc, const char *argv[])
keyset.self_delayed_payment_key = pubkey_from_hex("03fd5960528dc152014952efdb702a88f71e3c1653b2314431701ec77e57fde83c");
keyset.self_revocation_key = pubkey_from_hex("0212a140cd0c6539d07cd08dfe09984dec3251ea808b892efeac3ede9402bf2b19");

/* FIXME: Update bolt */
keyset.self_htlc_key = pubkey_from_hex("030d417a46946384f88d5f3337267c5e579765875dc4daca813e21734b140639e7");
keyset.other_htlc_key = pubkey_from_hex("0394854aa6eab5b2a8122cc726e9dded053a2184d88256816826d6231c068d4a5b");

Expand Down
6 changes: 4 additions & 2 deletions cln-grpc/proto/node.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions cln-grpc/src/convert.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions cln-rpc/src/model.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading