Skip to content

Commit

Permalink
wire: Add patch file for peer storage bkp
Browse files Browse the repository at this point in the history
Add msg type peer_storage and your_peer_storage
  • Loading branch information
adi2011 authored and endothermicdev committed Feb 8, 2023
1 parent d7bcac2 commit 5f481aa
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 3 deletions.
2 changes: 2 additions & 0 deletions channeld/channeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
2 changes: 2 additions & 0 deletions connectd/gossip_rcvd_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions connectd/gossip_store.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions connectd/multiplex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions gossipd/gossipd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions openingd/dualopend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions wire/extracted_peer_07_peer_storage.patch
Original file line number Diff line number Diff line change
@@ -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,
6 changes: 3 additions & 3 deletions wire/extracted_peer_exp_upgradable.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions wire/peer_wire.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: */
Expand Down
6 changes: 6 additions & 0 deletions wire/peer_wire.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5f481aa

Please sign in to comment.