Skip to content

Commit b30b028

Browse files
committed
channeld: allow announcement_signatures while waiting for STFU message
BOLT #2 quiescence forbids channel state update messages (`update_*`, `commitment_signed`, etc.) after `stfu`, not BOLT #7 gossip messages. `announcement_signatures` does not mutate commitment state and is sent asynchronously via `connectd` when a funding or splice transaction confirms. Commit e11c2f6 exempted `WIRE_ANNOUNCEMENT_SIGNATURES` when in STFU mode with `!stfu_wait_single_msg`, but missed the `stfu_wait_single_msg` check immediately below it, causing `channeld` to warn (`Got invalid message during STFU mode: WIRE_ANNOUNCEMENT_SIGNATURES`) and disconnect. Exempt `WIRE_ANNOUNCEMENT_SIGNATURES` from the `stfu_wait_single_msg` check and preserve `stfu_wait_single_msg` so the following STFU protocol message is still accepted.
1 parent a4a6cef commit b30b028

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

‎channeld/channeld.c‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5361,15 +5361,19 @@ static void peer_in(struct peer *peer, const u8 *msg)
53615361
}
53625362
}
53635363

5364-
/* For cleaner errors, we check message is valid during STFU mode */
5365-
if (peer->stfu_wait_single_msg)
5366-
if (!VALID_STFU_MESSAGE(type))
5367-
peer_failed_warn(peer->pps, &peer->channel_id,
5368-
"Got invalid message during STFU "
5369-
"mode: %s",
5370-
peer_wire_name(type));
5364+
/* For cleaner errors, we check message is valid during STFU mode.
5365+
* A belated announcement_signatures (sent asynchronously via connectd)
5366+
* can arrive here too and must not consume stfu_wait_single_msg. */
5367+
if (type != WIRE_ANNOUNCEMENT_SIGNATURES) {
5368+
if (peer->stfu_wait_single_msg)
5369+
if (!VALID_STFU_MESSAGE(type))
5370+
peer_failed_warn(peer->pps, &peer->channel_id,
5371+
"Got invalid message during STFU "
5372+
"mode: %s",
5373+
peer_wire_name(type));
53715374

5372-
peer->stfu_wait_single_msg = false;
5375+
peer->stfu_wait_single_msg = false;
5376+
}
53735377

53745378
switch (type) {
53755379
case WIRE_CHANNEL_READY:

‎tests/test_connection.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4215,7 +4215,6 @@ def test_quiescence(node_factory, executor):
42154215
pass
42164216

42174217

4218-
@pytest.mark.xfail(strict=True)
42194218
def test_quiescence_announcement_signatures(node_factory, bitcoind):
42204219
plugin_path = Path(__file__).parent / "plugins" / "zeroconf-selective.py"
42214220
l1, l2 = node_factory.get_nodes(2, opts=[

0 commit comments

Comments
 (0)