Skip to content

Pytest: test to reproduce issue #9389 - #9390

Draft
enaples wants to merge 1 commit into
ElementsProject:masterfrom
enaples:test_option_shutdown_anysegwit
Draft

Pytest: test to reproduce issue #9389#9390
enaples wants to merge 1 commit into
ElementsProject:masterfrom
enaples:test_option_shutdown_anysegwit

Conversation

@enaples

@enaples enaples commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Important

26.09 FREEZE August 5th: Non-bugfix PRs not ready by this date will wait for 26.12.

RC1 is scheduled on August 17th

The final release is scheduled for September 7th.

Checklist

Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:

  • The changelog has been updated in the relevant commit(s) according to the guidelines.
  • Tests have been added or modified to reflect the changes.
  • Documentation has been reviewed and updated as needed.
  • Related issues have been listed and linked, including any that this PR closes.
  • Important All PRs must consider how to reverse any persistent changes for tools/lightning-downgrade

Changelog-None

Reproduce #9389

What this does

Adds test_closing_anysegwit_lost_unilateral to tests/test_closing.py, which reproduces the reported deadlock: a channel stuck in CHANNELD_SHUTTING_DOWN that cannot be closed cooperatively or unilaterally.

The test drives the exact sequence:

  1. l1 and l2 open a channel while both offer option_shutdown_anysegwit, so l1 records a P2TR shutdown_scriptpubkey[LOCAL].
  2. l2 goes away; l1 issues close with unilateraltimeout=0, which commits that script and moves the channel to CHANNELD_SHUTTING_DOWN.
  3. l2 comes back with dev-force-features=-27, i.e. without option_shutdown_anysegwit.
  4. l1 can no longer close the channel by any means.

Both RPC paths from the issue fail, and the channel stays stuck:

close <id> 1                       -> "Peer does not allow v1+ shutdown addresses"
close <id> 1 <bc1q...>       -> "... does not match already-sent shutdown script ..."

involving a channel opened with a node supporting option_shutdown_anysegwit which then withdraws the supports and the peer cannot close the channel, even unilaterally
@enaples enaples added the QA Blockstream QA team have reproduced, or a test has been created! Look for the linked PR/Issue label Aug 7, 2026
@enaples
enaples marked this pull request as ready for review August 7, 2026 13:46
@enaples enaples changed the title pytests: test to reproduce issue #9389 MEMLEAK found in test to reproduce issue #9389 Aug 7, 2026
@enaples enaples changed the title MEMLEAK found in test to reproduce issue #9389 Pytest: test to reproduce issue #9389 Aug 7, 2026
@daywalker90 daywalker90 added the Type::Repro This reproduces an existing issue. It is not complete on its own, but can be used to address issues. label Aug 7, 2026
@daywalker90
daywalker90 marked this pull request as draft August 7, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA Blockstream QA team have reproduced, or a test has been created! Look for the linked PR/Issue Type::Repro This reproduces an existing issue. It is not complete on its own, but can be used to address issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants