pytest: make sure to use old_hsmsecret on downgrade tests.
What changed, and why it matters
This change only updates a test file so that downgrade tests create nodes using an older-format secret key file. It does not change any production code, network protocol, or wallet behavior, and there is no security issue in the commit itself.
No action needed; this is a test-only adjustment.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies tests/test_downgrade.py to pass ‘old_hsmsecret’: True when creating test nodes. This ensures the test environment matches the supported downgrade scenario (downgrade only after an upgrade, which leaves hsm_secret in the old format). The diff is purely a test-fix with no runtime code changes.
Changed components
tests/test_downgrade.pyInspect captured patch +3 / −2
diff --git a/tests/test_downgrade.py b/tests/test_downgrade.py
index 939aa99..1d8dcc8 100644
--- a/tests/test_downgrade.py
+++ b/tests/test_downgrade.py
@@ -32,7 +32,8 @@ def downgrade_cmdline(node):
def test_downgrade(node_factory, executor):
- l1, l2 = node_factory.line_graph(2, opts={'may_reconnect': True}, wait_for_announce=True)
+ # To downgrade before 25.12, we need old-style hsm_secret.
+ l1, l2 = node_factory.line_graph(2, opts={'may_reconnect': True, 'old_hsmsecret': True}, wait_for_announce=True)
bias_scidd = f"{first_scid(l1, l2)}/0"
# Create a bias for this channel.
@@ -99,7 +100,7 @@ def test_downgrade(node_factory, executor):
def test_downgrade_bias(node_factory, executor):
"""If we have created as node bias, we *can* downgrade this version."""
- l1, l2 = node_factory.line_graph(2, opts={'may_reconnect': True}, wait_for_announce=True)
+ l1, l2 = node_factory.line_graph(2, opts={'may_reconnect': True, 'old_hsmsecret': True}, wait_for_announce=True)
l1.rpc.askrene_bias_node('xpay', l2.info['id'], 'in', 1)
cmd_line = downgrade_cmdline(l1)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.