From 4a6a060c5abe19ae046b76698fffab97c1e85a22 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Fri, 23 Oct 2026 13:28:54 -0500 Subject: [PATCH] smite: fix inconsistent usage of 'funded' instead of 'tracked' A channel is tracked when we have a channel state for it. A channel is funded when we received `funding_signed`. Update documentation to match this definition. --- smite-scenarios/src/executor/tests.rs | 2 +- smite/src/oracles/channel_ready.rs | 12 ++++++------ smite/src/violation.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/smite-scenarios/src/executor/tests.rs b/smite-scenarios/src/executor/tests.rs index 4b06179d..d4e77ee0 100644 --- a/smite-scenarios/src/executor/tests.rs +++ b/smite-scenarios/src/executor/tests.rs @@ -1620,7 +1620,7 @@ fn execute_recv_implicit_channel_ready_unknown_channel() { panic!("unexpected error: {err:?}"); }; assert_eq!(*id, funding_channel_id()); - assert!(reason.contains("unknown channel_id: no channel was funded for it")); + assert!(reason.contains("unknown channel_id: no channel is tracked for it")); } #[test] diff --git a/smite/src/oracles/channel_ready.rs b/smite/src/oracles/channel_ready.rs index 3dca5657..c63b0f99 100644 --- a/smite/src/oracles/channel_ready.rs +++ b/smite/src/oracles/channel_ready.rs @@ -14,7 +14,7 @@ pub struct ChannelReadyContext<'a> { /// The `channel_ready` received from the peer. pub channel_ready: &'a ChannelReady, /// The channel the `channel_ready` belongs to, identified by its - /// `channel_id`, or `None` if no channel was funded for it. + /// `channel_id`, or `None` if no channel is tracked for it. pub channel: Option<&'a ChannelState>, /// Features negotiated between the target node and Smite. pub negotiated_features: &'a Features, @@ -35,11 +35,11 @@ pub struct ChannelReadyOracle; impl Oracle> for ChannelReadyOracle { fn evaluate(&self, context: &ChannelReadyContext<'_>) -> Result<(), Violation> { - // Check that the `channel_ready` answers a channel we funded. + // Check that the `channel_ready` answers a channel we track. let Some(channel) = context.channel else { return Err(Violation::InvalidChannelReady( context.channel_ready.channel_id, - "unknown channel_id: no channel was funded for it".to_string(), + "unknown channel_id: no channel is tracked for it".to_string(), )); }; @@ -197,7 +197,7 @@ mod tests { } /// Oracle inputs for testing. Defaults to a conforming `channel_ready` - /// for a funded channel at the minimum depth. + /// for a tracked channel at the minimum depth. struct OracleInputs { channel_ready: ChannelReady, channel: Option, @@ -233,7 +233,7 @@ mod tests { } fn channel_mut(&mut self) -> &mut ChannelState { - self.channel.as_mut().expect("funded channel") + self.channel.as_mut().expect("tracked channel") } } @@ -270,7 +270,7 @@ mod tests { ..OracleInputs::default() }; - assert_fail(&inputs, "unknown channel_id: no channel was funded for it"); + assert_fail(&inputs, "unknown channel_id: no channel is tracked for it"); } #[test] diff --git a/smite/src/violation.rs b/smite/src/violation.rs index 5e45eb03..f891f1b9 100644 --- a/smite/src/violation.rs +++ b/smite/src/violation.rs @@ -50,7 +50,7 @@ pub enum Violation { /// The target's `channel_ready` broke a BOLT 2 requirement, as judged by /// [`crate::oracles::ChannelReadyOracle`]. The reason names the breached /// requirement, one of: - /// - it names a `channel_id` we have not funded, + /// - it names a `channel_id` we have no channel tracked for, /// - its funding output does not match the negotiated funding script and /// amount, /// - it arrives before the funding transaction reached `minimum_depth`,