key_expression: Forward serde feature to network
What changed, and why it matters
This is a small Cargo.toml fix in a Rust Bitcoin subcrate. When the optional 'serde' feature was enabled on the key_expression crate alone, it did not also enable serde on the network crate. That meant a type called NetworkKind could not be serialized or deserialized in that configuration. The patch adds 'network/serde' to the feature forwarding list so the dependency's serde support is turned on too. It is a build/feature correctness bug, not a security vulnerability.
No security action needed. Treat as a normal build/dependency feature fix. Downstream users building key_expression standalone with --features serde will now get correct serde support for NetworkKind.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The key_expression crate’s serde feature previously forwarded serde to hashes, internals, and crypto, but not to network. Because NetworkKind (in the network crate) only gains Serialize/Deserialize derives when network’s serde feature is active, building key_expression with –features serde alone failed to compile code that tried to serialize NetworkKind. Workspace builds masked the issue because the top-level bitcoin crate enables network/serde. The fix adds ‘network/serde’ to the serde feature list in key_expression/Cargo.toml.
Changed components
key_expression/Cargo.tomlkey_expression crate feature 'serde'network crate feature 'serde'NetworkKind serde derivesInspect captured patch +1 / −1
### key_expression/Cargo.toml
@@ -17,7 +17,7 @@ exclude = ["tests", "contrib"]
default = ["std"]
std = ["alloc", "base58/std", "crypto/std", "hashes/std", "hex/std", "internals/std", "network/std", "serde?/std"]
alloc = ["base58/alloc", "crypto/alloc", "hashes/alloc", "hex/alloc", "internals/alloc", "network/alloc", "serde?/alloc"]
-serde = ["dep:serde", "hashes/serde", "internals/serde", "crypto/serde"]
+serde = ["dep:serde", "hashes/serde", "internals/serde", "crypto/serde", "network/serde"]
arbitrary = ["crypto/arbitrary", "dep:arbitrary", "hashes/arbitrary", "network/arbitrary"]
[dependencies]Why this scored 17/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.