What changed, and why it matters
This commit only fixes compiler warnings that appear when building the project's fuzzing test harness. It removes one unused import, narrows three conditional compilation flags so they don't conflict during fuzz builds, and reduces the visibility of one internal encryption helper from public to crate-internal. None of these changes affect runtime behavior or fix any security vulnerability.
No security action required. Treat as normal build-cleanup commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is a build-hygiene patch for fuzz targets: (1) removes an unused lightning::chain::Filter import in fuzz/src/lsps_message.rs; (2) changes #[cfg(feature = "std")] to #[cfg(all(feature = "std", not(fuzzing)))] in outbound_payment.rs and gossip.rs, and #[cfg(not(test))] to #[cfg(all(not(test), not(fuzzing)))] in util/time.rs, so the fuzzing configuration can use its own time mocks without duplicate-import warnings; (3) changes encrypt_message from pub to pub(crate) in peer_channel_encryptor.rs, which is a visibility tightening with no functional change. There are no logic, cryptographic, or protocol changes.
Changed components
fuzz/src/lsps_message.rslightning/src/ln/outbound_payment.rslightning/src/ln/peer_channel_encryptor.rslightning/src/routing/gossip.rslightning/src/util/time.rsInspect captured patch +4 / −5
diff --git a/fuzz/src/lsps_message.rs b/fuzz/src/lsps_message.rs
index 83fa5dd..7a3cb0c 100644
--- a/fuzz/src/lsps_message.rs
+++ b/fuzz/src/lsps_message.rs
@@ -5,7 +5,6 @@ use bitcoin::hashes::{sha256, Hash};
use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
use bitcoin::Network;
-use lightning::chain::Filter;
use lightning::chain::{chainmonitor, BlockLocator};
use lightning::ln::channelmanager::{ChainParameters, ChannelManager};
use lightning::ln::peer_handler::CustomMessageHandler;
diff --git a/lightning/src/ln/outbound_payment.rs b/lightning/src/ln/outbound_payment.rs
index 7259f60..273ed4e 100644
--- a/lightning/src/ln/outbound_payment.rs
+++ b/lightning/src/ln/outbound_payment.rs
@@ -38,7 +38,7 @@ use crate::types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
use crate::util::errors::APIError;
use crate::util::logger::{Logger, WithContext};
use crate::util::ser::ReadableArgs;
-#[cfg(feature = "std")]
+#[cfg(all(feature = "std", not(fuzzing)))]
use crate::util::time::Instant;
use core::fmt::{self, Display, Formatter};
diff --git a/lightning/src/ln/peer_channel_encryptor.rs b/lightning/src/ln/peer_channel_encryptor.rs
index d9fc6dd..5f46131 100644
--- a/lightning/src/ln/peer_channel_encryptor.rs
+++ b/lightning/src/ln/peer_channel_encryptor.rs
@@ -556,7 +556,7 @@ impl PeerChannelEncryptor {
/// Encrypts the given message, returning the encrypted version.
/// panics if the length of `message`, once encoded, is greater than 65535 or if the Noise
/// handshake has not finished.
- pub fn encrypt_message<T: wire::Type>(&mut self, message: wire::Message<T>) -> Vec<u8> {
+ pub(crate) fn encrypt_message<T: wire::Type>(&mut self, message: wire::Message<T>) -> Vec<u8> {
// Allocate a buffer with 2KB, fitting most common messages. Reserve the first 16+2 bytes
// for the 2-byte message type prefix and its MAC.
let mut res = VecWriter(Vec::with_capacity(MSG_BUF_ALLOC_SIZE));
diff --git a/lightning/src/routing/gossip.rs b/lightning/src/routing/gossip.rs
index adeb67a..7688db1 100644
--- a/lightning/src/routing/gossip.rs
+++ b/lightning/src/routing/gossip.rs
@@ -57,7 +57,7 @@ use core::{cmp, fmt};
pub use lightning_types::routing::RoutingFees;
-#[cfg(feature = "std")]
+#[cfg(all(feature = "std", not(fuzzing)))]
use std::time::{SystemTime, UNIX_EPOCH};
/// We remove stale channel directional info two weeks after the last update, per BOLT 7's
diff --git a/lightning/src/util/time.rs b/lightning/src/util/time.rs
index c604154..626e96e 100644
--- a/lightning/src/util/time.rs
+++ b/lightning/src/util/time.rs
@@ -7,7 +7,7 @@
//! A simple module which either re-exports [`std::time::Instant`] or a mocked version of it for
//! tests.
-#[cfg(not(test))]
+#[cfg(all(not(test), not(fuzzing)))]
pub use std::time::Instant;
#[cfg(test)]
pub use test::Instant;
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.