consensus_encoding: Remove derive feature outside tests
What changed, and why it matters
This commit is a routine build optimization. It removes the automatic 'derive' feature from the serde dependency in the consensus_encoding crate, keeping it only for test builds. This reduces compile time and prevents unused derive machinery from being pulled in. There is no security-relevant change.
No security action needed. Treat as a normal dependency/build cleanup change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change modifies consensus_encoding/Cargo.toml so that the optional serde dependency no longer requests the ‘derive’ feature by default. The ‘derive’ feature is instead enabled only under [dev-dependencies] for tests. The commit message explicitly frames this as a compile-time reduction measure and a way to ensure the feature is not re-enabled when derives are removed from types in units and primitives.
Changed components
consensus_encoding/Cargo.tomlInspect captured patch +2 / −1
### consensus_encoding/Cargo.toml
@@ -24,10 +24,11 @@ serde = ["alloc", "hex", "dep:serde"]
internals = { package = "bitcoin-internals", path = "../internals", version = "0.8.2" }
hex = { package = "hex-conservative", version = "1.1.0", default-features = false, features = [], optional = true }
-serde = { version = "1.0.195", default-features = false, features = ["derive"], optional = true }
+serde = { version = "1.0.195", default-features = false, optional = true }
[dev-dependencies]
hex = { package = "hex-conservative", version = "1.1.0" }
+serde = { version = "1.0.195", default-features = false, features = ["derive"] }
serde_json = "1.0.68"
[package.metadata.docs.rs]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.