Skip to content

smite: add shutdown oracle - #266

Open
ekzyis wants to merge 2 commits into
lnfuzz:masterfrom
ekzyis:shutdown-oracle
Open

ekzyis wants to merge 2 commits into
lnfuzz:masterfrom
ekzyis:shutdown-oracle

Conversation

@ekzyis

@ekzyis ekzyis commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

based on #163, related to #98

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.

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 ekzyis changed the title smite: add ShutdownOracle smite: add shutdown oracle Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant