Skip to content

smite-scenarios: panic on unreachable initial commitment errors - #293

Merged
morehouse merged 1 commit into
masterfrom
panic_initial_commitment_error
Oct 21, 2026
Merged

morehouse merged 1 commit into
masterfrom
panic_initial_commitment_error

Conversation

@morehouse

Copy link
Copy Markdown
Collaborator

Now that AcceptChannelOracle validates the channel parameters prior to saving the negotiation entry, it is impossible for new_initial_commitments() to fail. push_msat is always less than the funding amount, which is always less than MAX_MONEY.

This also enables us to remove the final two tests that still use negotiation injection.

Depends on #292.

@morehouse
morehouse added this pull request to stack #289 October 16, 2026 03:59

@erickcestari erickcestari left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be able to opt out of an oracle? If a target accepts invalid params, this panic stops us from following it to funding_created, where it could per example crash the target or any other odd thing could happen.

Comment thread smite-scenarios/src/executor.rs Outdated
Comment on lines +831 to +832
/// This should be unreachable since `AcceptChannelOracle` validates the
/// parameters before any negotiation is recorded.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This isn't entirely true. A negotiation is recorded as soon as the unvalidated open_channel is sent.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@morehouse
morehouse force-pushed the panic_initial_commitment_error branch from 3d73771 to c253fe3 Compare October 16, 2026 21:06
@morehouse
morehouse force-pushed the panic_initial_commitment_error branch from c253fe3 to adbf2f4 Compare October 16, 2026 22:08
@morehouse

Copy link
Copy Markdown
Collaborator Author

Should we be able to opt out of an oracle? If a target accepts invalid params, this panic stops us from following it to funding_created, where it could per example crash the target or any other odd thing could happen.

Maybe? Ideally the known violations would get fixed relatively quickly and then we'd be able to fuzz past the oracle checks. But some violations may be low-priority for maintainers.

If we do want to selectively disable oracles, I think that's a whole other challenge in itself and would require some design work. Currently we already rely on the oracles catching certain invalid states before we progress further, so we'd have to undo that.

For this particular PR, it makes no difference whether the oracle is disabled or not -- if it is disabled then we hit the ExecuteError::Commitment and can't fuzz any deeper; if it isn't disabled then we never get past the oracle either.

@NishantBansal2003 NishantBansal2003 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to remove this given the current design!

Needs rebase.

Should we be able to opt out of an oracle? If a target accepts invalid params, this panic stops us from following it to funding_created, where it could per example crash the target or any other odd thing could happen.

I agree that the oracle might shadow some crash sites, though fixing these oracle violations might fix the underlying issues as well. Unless there's another way past the oracle that we would catch directly anyway, we don't lose anything on the crash/bug side. What we do lose is the ability to report some crashes.

If we want to go this route, one option could be to make oracle error checks apply only to the target, not smite. We could collect violations instead of returning immediately, handle errors explicitly in each state, and log the violations at the end, preferably after check_alive or ping_pong

Base automatically changed from stop_injecting_negotiations to master October 20, 2026 23:02
Now that AcceptChannelOracle validates the channel parameters prior to
saving the negotiation entry, it is impossible for
new_initial_commitments() to fail.  push_msat is always less than the
funding amount, which is always less than MAX_MONEY.

This also enables us to remove the final two tests that still use
negotiation injection.
@morehouse
morehouse force-pushed the panic_initial_commitment_error branch from adbf2f4 to a3713c9 Compare October 21, 2026 00:02
@morehouse
morehouse merged commit 8d94445 into master Oct 21, 2026
5 checks passed
@morehouse
morehouse deleted the panic_initial_commitment_error branch October 21, 2026 00:11
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.

3 participants