plugin: Expand stuck HSM detection to cover onchaind signing types#724
Merged
Conversation
`is_stuck()` previously only checked for SIGN_COMMITMENT_TX (5) and CHECK_PUBKEY (28), missing all onchaind signing types. A node stuck on SIGN_ANY_REMOTE_HTLC_TO_US (143) would spin for the full 10-minute bgsync session without making progress. Add a `stuck_request_types()` method returning the blocking type numbers, and expand the set to include all onchaind signing types: SIGN_DELAYED_PAYMENT_TO_US (12), SIGN_REMOTE_HTLC_TO_US (13), SIGN_PENALTY_TO_US (14), SIGN_REMOTE_HTLC_TX (20), SIGN_MUTUAL_CLOSE_TX (21), SIGN_ANY_DELAYED_PAYMENT_TO_US (142), SIGN_ANY_REMOTE_HTLC_TO_US (143), SIGN_ANY_PENALTY_TO_US (144), SIGN_ANY_LOCAL_HTLC_TX (146), SIGN_ANCHORSPEND (147), SIGN_HTLC_TX_MINGLE (149). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
is_stuck()previously only checked forSIGN_COMMITMENT_TX(5) andCHECK_PUBKEY(28), missing all onchaind signing types. A bgsync node stuck waiting for e.g.SIGN_ANY_REMOTE_HTLC_TO_US(143) would spin silently for the full 10-minute session window without advancing its blockheight.stuck_request_types() -> Vec<u16>method that returns the blocking type numbers;is_stuck()now delegates to it.SIGN_DELAYED_PAYMENT_TO_US(12),SIGN_REMOTE_HTLC_TO_US(13),SIGN_PENALTY_TO_US(14),SIGN_REMOTE_HTLC_TX(20),SIGN_MUTUAL_CLOSE_TX(21),SIGN_ANY_DELAYED_PAYMENT_TO_US(142),SIGN_ANY_REMOTE_HTLC_TO_US(143),SIGN_ANY_PENALTY_TO_US(144),SIGN_ANY_LOCAL_HTLC_TX(146),SIGN_ANCHORSPEND(147),SIGN_HTLC_TX_MINGLE(149).Context
Discovered by inspecting bgsync session logs for a node stuck 124k blocks behind chain tip. The node had a unilateral close on one of its channels; onchaind fired when block 828110 was added and queued a
SIGN_ANY_REMOTE_HTLC_TO_US(143) request to claim an expired HTLC timeout output. The signerproxy could not fulfil it, so the node blocked for ~9 minutes until the 10-minute preemption kicked in — making zero block progress per session.Test plan
is_stuck()still returnsfalsewhen no requests are queuedstuck_request_types()returns the correct type numbers when onchaind signing requests are pending🤖 Generated with Claude Code