Conversation
RecvShutdown consumes the SentShutdown of a previous SendShutdown, which now carries the `shutdown` we sent, and waits for the target's `shutdown` in reply. It returns the target's scriptpubkey, or empty bytes if no `shutdown` was received. If our own scriptpubkey isn't standard, BOLT 2 says the target should send a warning instead of replying, so we accept a warning for the channel as a reply. A `shutdown` for another channel may answer one we sent there earlier, which we can't check against the `shutdown` we sent here, so it ends the program as an unexpected message. RecvShutdown is a no-op if we don't track the channel or the target already replied. Before the target sent `channel_ready`, it may choose not to reply, but we still expect one: LDK always replies, and a target that doesn't only costs us a receive timeout, which isn't reported as a violation.
RecvShutdown now checks the target's `shutdown` with a new ShutdownOracle. It flags the target if: * the reply is for a channel we never established * we sent an invalid signature, so the target should have failed the channel instead of replying * its scriptpubkey isn't a standard form for the negotiated features A `shutdown` for a channel we don't track is now passed to the oracle instead of ending the program as an unexpected message.
ekzyis
force-pushed
the
shutdown-oracle
branch
from
September 22, 2026 18:44
e7ae6db to
5e463ae
Compare
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.
based on #163, related to #98
RecvShutdownnow checks the target'sshutdownwith a newShutdownOracle. It flags the target if:A
shutdownfor a channel we don't track is now passed to the oracle instead of ending the program as an unexpected message.