From 5f481aaf96b0a0a0dc2a006daecc1ab7fecfb891 Mon Sep 17 00:00:00 2001 From: adi2011 Date: Thu, 2 Feb 2023 20:31:22 +1030 Subject: [PATCH] wire: Add patch file for peer storage bkp Add msg type peer_storage and your_peer_storage --- channeld/channeld.c | 2 ++ connectd/gossip_rcvd_filter.c | 2 ++ connectd/gossip_store.c | 2 ++ connectd/multiplex.c | 2 ++ gossipd/gossipd.c | 2 ++ openingd/dualopend.c | 6 ++++++ wire/extracted_peer_07_peer_storage.patch | 15 +++++++++++++++ wire/extracted_peer_exp_upgradable.patch | 6 +++--- wire/peer_wire.c | 6 ++++++ wire/peer_wire.csv | 6 ++++++ 10 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 wire/extracted_peer_07_peer_storage.patch diff --git a/channeld/channeld.c b/channeld/channeld.c index 70f4e9700..feba13169 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -2300,6 +2300,8 @@ static void peer_in(struct peer *peer, const u8 *msg) case WIRE_WARNING: case WIRE_ERROR: case WIRE_ONION_MESSAGE: + case WIRE_PEER_STORAGE: + case WIRE_YOUR_PEER_STORAGE: abort(); } diff --git a/connectd/gossip_rcvd_filter.c b/connectd/gossip_rcvd_filter.c index b3a73ee24..740b52957 100644 --- a/connectd/gossip_rcvd_filter.c +++ b/connectd/gossip_rcvd_filter.c @@ -87,6 +87,8 @@ static bool is_msg_gossip_broadcast(const u8 *cursor) case WIRE_TX_INIT_RBF: case WIRE_TX_ACK_RBF: case WIRE_TX_ABORT: + case WIRE_PEER_STORAGE: + case WIRE_YOUR_PEER_STORAGE: case WIRE_OPEN_CHANNEL2: case WIRE_ACCEPT_CHANNEL2: #if EXPERIMENTAL_FEATURES diff --git a/connectd/gossip_store.c b/connectd/gossip_store.c index 9101812c1..0ebb4f377 100644 --- a/connectd/gossip_store.c +++ b/connectd/gossip_store.c @@ -92,6 +92,8 @@ static bool public_msg_type(enum peer_wire type) case WIRE_REPLY_CHANNEL_RANGE: case WIRE_GOSSIP_TIMESTAMP_FILTER: case WIRE_ONION_MESSAGE: + case WIRE_PEER_STORAGE: + case WIRE_YOUR_PEER_STORAGE: #if EXPERIMENTAL_FEATURES case WIRE_STFU: #endif diff --git a/connectd/multiplex.c b/connectd/multiplex.c index 5623a4c6b..3332f1e4c 100644 --- a/connectd/multiplex.c +++ b/connectd/multiplex.c @@ -385,6 +385,8 @@ static bool is_urgent(enum peer_wire type) case WIRE_REPLY_CHANNEL_RANGE: case WIRE_GOSSIP_TIMESTAMP_FILTER: case WIRE_ONION_MESSAGE: + case WIRE_PEER_STORAGE: + case WIRE_YOUR_PEER_STORAGE: #if EXPERIMENTAL_FEATURES case WIRE_STFU: #endif diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index 9d34f91c5..ab9951921 100644 --- a/gossipd/gossipd.c +++ b/gossipd/gossipd.c @@ -569,6 +569,8 @@ static void handle_recv_gossip(struct daemon *daemon, const u8 *outermsg) case WIRE_OPEN_CHANNEL2: case WIRE_ACCEPT_CHANNEL2: case WIRE_ONION_MESSAGE: + case WIRE_PEER_STORAGE: + case WIRE_YOUR_PEER_STORAGE: #if EXPERIMENTAL_FEATURES case WIRE_STFU: #endif diff --git a/openingd/dualopend.c b/openingd/dualopend.c index f213f2c02..4f46b6d02 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -1439,6 +1439,8 @@ static u8 *opening_negotiate_msg(const tal_t *ctx, struct state *state) case WIRE_WARNING: case WIRE_PING: case WIRE_PONG: + case WIRE_PEER_STORAGE: + case WIRE_YOUR_PEER_STORAGE: #if EXPERIMENTAL_FEATURES case WIRE_STFU: #endif @@ -1813,6 +1815,8 @@ static bool run_tx_interactive(struct state *state, case WIRE_REPLY_SHORT_CHANNEL_IDS_END: case WIRE_PING: case WIRE_PONG: + case WIRE_PEER_STORAGE: + case WIRE_YOUR_PEER_STORAGE: #if EXPERIMENTAL_FEATURES case WIRE_STFU: #endif @@ -4170,6 +4174,8 @@ static u8 *handle_peer_in(struct state *state) case WIRE_WARNING: case WIRE_PING: case WIRE_PONG: + case WIRE_PEER_STORAGE: + case WIRE_YOUR_PEER_STORAGE: #if EXPERIMENTAL_FEATURES case WIRE_STFU: #endif diff --git a/wire/extracted_peer_07_peer_storage.patch b/wire/extracted_peer_07_peer_storage.patch new file mode 100644 index 000000000..71afebd85 --- /dev/null +++ b/wire/extracted_peer_07_peer_storage.patch @@ -0,0 +1,15 @@ +--- wire/peer_wire.csv 2022-07-18 13:49:29.079542016 +0530 ++++ - 2022-07-18 13:58:17.706696582 +0530 +@@ -249,6 +249,12 @@ + msgdata,channel_reestablish,next_revocation_number,u64, + msgdata,channel_reestablish,your_last_per_commitment_secret,byte,32 + msgdata,channel_reestablish,my_current_per_commitment_point,point, ++msgtype,peer_storage,7 ++msgdata,peer_storage,len,u16, ++msgdata,peer_storage,blob,byte,len ++msgtype,your_peer_storage,9 ++msgdata,your_peer_storage,len,u16, ++msgdata,your_peer_storage,blob,byte,len + msgtype,announcement_signatures,259 + msgdata,announcement_signatures,channel_id,channel_id, + msgdata,announcement_signatures,short_channel_id,short_channel_id, diff --git a/wire/extracted_peer_exp_upgradable.patch b/wire/extracted_peer_exp_upgradable.patch index e5818692f..c168586ab 100644 --- a/wire/extracted_peer_exp_upgradable.patch +++ b/wire/extracted_peer_exp_upgradable.patch @@ -13,6 +13,6 @@ +tlvdata,channel_reestablish_tlvs,current_channel_type,type,byte,... +tlvtype,channel_reestablish_tlvs,upgradable_channel_type,7 +tlvdata,channel_reestablish_tlvs,upgradable_channel_type,type,byte,... - msgtype,announcement_signatures,259 - msgdata,announcement_signatures,channel_id,channel_id, - msgdata,announcement_signatures,short_channel_id,short_channel_id, + msgtype,peer_storage,7 + msgdata,peer_storage,len,u16, + msgdata,peer_storage,blob,byte,len diff --git a/wire/peer_wire.c b/wire/peer_wire.c index 29e67f386..aa6f55493 100644 --- a/wire/peer_wire.c +++ b/wire/peer_wire.c @@ -45,6 +45,8 @@ static bool unknown_type(enum peer_wire t) case WIRE_TX_INIT_RBF: case WIRE_TX_ACK_RBF: case WIRE_TX_ABORT: + case WIRE_PEER_STORAGE: + case WIRE_YOUR_PEER_STORAGE: case WIRE_OPEN_CHANNEL2: case WIRE_ACCEPT_CHANNEL2: #if EXPERIMENTAL_FEATURES @@ -101,6 +103,8 @@ bool is_msg_for_gossipd(const u8 *cursor) case WIRE_OPEN_CHANNEL2: case WIRE_ACCEPT_CHANNEL2: case WIRE_ONION_MESSAGE: + case WIRE_PEER_STORAGE: + case WIRE_YOUR_PEER_STORAGE: #if EXPERIMENTAL_FEATURES case WIRE_STFU: #endif @@ -140,6 +144,8 @@ bool extract_channel_id(const u8 *in_pkt, struct channel_id *channel_id) case WIRE_REPLY_CHANNEL_RANGE: case WIRE_GOSSIP_TIMESTAMP_FILTER: case WIRE_ONION_MESSAGE: + case WIRE_PEER_STORAGE: + case WIRE_YOUR_PEER_STORAGE: return false; /* Special cases: */ diff --git a/wire/peer_wire.csv b/wire/peer_wire.csv index b01d1f40d..7b1e33d8c 100644 --- a/wire/peer_wire.csv +++ b/wire/peer_wire.csv @@ -264,6 +264,12 @@ msgdata,channel_reestablish,next_commitment_number,u64, msgdata,channel_reestablish,next_revocation_number,u64, msgdata,channel_reestablish,your_last_per_commitment_secret,byte,32 msgdata,channel_reestablish,my_current_per_commitment_point,point, +msgtype,peer_storage,7 +msgdata,peer_storage,len,u16, +msgdata,peer_storage,blob,byte,len +msgtype,your_peer_storage,9 +msgdata,your_peer_storage,len,u16, +msgdata,your_peer_storage,blob,byte,len msgtype,announcement_signatures,259 msgdata,announcement_signatures,channel_id,channel_id, msgdata,announcement_signatures,short_channel_id,short_channel_id,