Drop `Readable`/`Writeable` for `InFlightHtlcs`
What changed, and why it matters
This commit removes the ability to save and load a small routing helper object called InFlightHtlcs to disk. The developer says this object should normally be built fresh while the program is running, and its old save/load format is not forward-compatible, meaning future additions could break old stored data. Removing it prevents that compatibility problem. There is no direct evidence in the commit of an active security vulnerability, but non-forward-compatible serialization in a Lightning payment router can, in principle, lead to crashes or inconsistent routing state if old data is loaded after an upgrade.
Treat as a defensive cleanup. Review any downstream code that previously persisted InFlightHtlcs to disk and ensure it now reconstructs the object at runtime, since old serialized instances will no longer load. Monitor release notes for related forward-compatibility guidance.
Security signals we found
Removal of non-forward-compatible serialization
Potential for state deserialization mismatch in routing/payment pathfinding
Commit message explicitly frames change as needed to allow safe future extension
Evidence from the diff
The patch deletes the Writeable and Readable trait implementations for InFlightHtlcs in lightning/src/routing/router.rs. Previously, InFlightHtlcs serialized only its unblinded_hops HashMap<(u64, bool), u64>. The commit message states this serialization is not forward-compatible and should be dropped so that additional fields can later be added to InFlightHtlcs. The object is described as generally generated live when needed. The change is a hardening/cleanup rather than a fix for an exploitable bug visible in the diff.
Changed components
lightning/src/routing/router.rsInFlightHtlcs serialization (Readable/Writeable)Inspect captured patch +0 / −13
diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs
index 8867286..69d677b 100644
--- a/lightning/src/routing/router.rs
+++ b/lightning/src/routing/router.rs
@@ -416,19 +416,6 @@ impl InFlightHtlcs {
}
}
-impl Writeable for InFlightHtlcs {
- fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
- self.unblinded_hops.write(writer)
- }
-}
-
-impl Readable for InFlightHtlcs {
- fn read<R: io::Read>(reader: &mut R) -> Result<Self, DecodeError> {
- let unblinded_hops: HashMap<(u64, bool), u64> = Readable::read(reader)?;
- Ok(Self { unblinded_hops })
- }
-}
-
/// A hop in a route, and additional metadata about it. "Hop" is defined as a node and the channel
/// that leads to it.
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
Why this scored 32/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.