From f7adbd5d58f87d526a5e314dc156b5eae6a9d06e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 31 May 2021 12:37:50 +0930 Subject: [PATCH] EXPERIMENTAL: import spec for quiescence. Imported from commit b96218b06b68cf349457b282f05d48ebd89c7273 Signed-off-by: Rusty Russell --- channeld/channeld.c | 3 +++ gossipd/gossipd.c | 3 +++ openingd/dualopend.c | 9 +++++++++ wire/extracted_peer_exp_quiescence-protocol.patch | 12 ++++++++++++ wire/peer_wire.c | 6 ++++++ 5 files changed, 33 insertions(+) create mode 100644 wire/extracted_peer_exp_quiescence-protocol.patch diff --git a/channeld/channeld.c b/channeld/channeld.c index 862f5e5a6..e2a41c28e 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -1949,6 +1949,9 @@ static void peer_in(struct peer *peer, const u8 *msg) return; case WIRE_INIT_RBF: case WIRE_ACK_RBF: +#if EXPERIMENTAL_FEATURES + case WIRE_STFU: +#endif break; case WIRE_CHANNEL_REESTABLISH: diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index d47bda25c..5619b5ef7 100644 --- a/gossipd/gossipd.c +++ b/gossipd/gossipd.c @@ -741,6 +741,9 @@ static struct io_plan *peer_msg_in(struct io_conn *conn, case WIRE_ACCEPT_CHANNEL2: case WIRE_INIT_RBF: case WIRE_ACK_RBF: +#if EXPERIMENTAL_FEATURES + case WIRE_STFU: +#endif status_broken("peer %s: relayed unexpected msg of type %s", type_to_string(tmpctx, struct node_id, &peer->id), peer_wire_name(fromwire_peektype(msg))); diff --git a/openingd/dualopend.c b/openingd/dualopend.c index 640c8ebf2..a264bbf20 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -1273,6 +1273,9 @@ static u8 *opening_negotiate_msg(const tal_t *ctx, struct state *state) case WIRE_WARNING: case WIRE_PING: case WIRE_PONG: +#if EXPERIMENTAL_FEATURES + case WIRE_STFU: +#endif break; } @@ -1614,6 +1617,9 @@ static bool run_tx_interactive(struct state *state, case WIRE_REPLY_SHORT_CHANNEL_IDS_END: case WIRE_PING: case WIRE_PONG: +#if EXPERIMENTAL_FEATURES + case WIRE_STFU: +#endif open_err_warn(state, "Unexpected wire message %s", tal_hex(tmpctx, msg)); return false; @@ -3402,6 +3408,9 @@ static u8 *handle_peer_in(struct state *state) case WIRE_WARNING: case WIRE_PING: case WIRE_PONG: +#if EXPERIMENTAL_FEATURES + case WIRE_STFU: +#endif break; } diff --git a/wire/extracted_peer_exp_quiescence-protocol.patch b/wire/extracted_peer_exp_quiescence-protocol.patch new file mode 100644 index 000000000..804b726b9 --- /dev/null +++ b/wire/extracted_peer_exp_quiescence-protocol.patch @@ -0,0 +1,12 @@ +--- wire/peer_exp_wire.csv 2021-05-17 09:30:02.302260471 +0930 ++++ - 2021-05-31 12:20:36.390910632 +0930 +@@ -120,6 +82,9 @@ + msgtype,ack_rbf,73 + msgdata,ack_rbf,channel_id,channel_id, + msgdata,ack_rbf,funding_satoshis,u64, ++msgtype,stfu,2 ++msgdata,stfu,channel_id,channel_id, ++msgdata,stfu,initiator,u8, + msgtype,shutdown,38 + msgdata,shutdown,channel_id,channel_id, + msgdata,shutdown,len,u16, diff --git a/wire/peer_wire.c b/wire/peer_wire.c index a79a16a2e..1f8fc3731 100644 --- a/wire/peer_wire.c +++ b/wire/peer_wire.c @@ -44,6 +44,9 @@ static bool unknown_type(enum peer_wire t) case WIRE_ACCEPT_CHANNEL2: case WIRE_INIT_RBF: case WIRE_ACK_RBF: +#if EXPERIMENTAL_FEATURES + case WIRE_STFU: +#endif return false; } return true; @@ -93,6 +96,9 @@ bool is_msg_for_gossipd(const u8 *cursor) case WIRE_ACCEPT_CHANNEL2: case WIRE_INIT_RBF: case WIRE_ACK_RBF: +#if EXPERIMENTAL_FEATURES + case WIRE_STFU: +#endif break; } return false;