Conversation
This change makes `secp256k1` an optional dependency so that applications requiring chain parsing but not doing any validation nor signing do not have to compile `secp256k1`. This is a breaking change because dependencies of this crate must fix their feature settings but apart from that they don't need to do anything. There are two things which may be surprising: moving of some modules and removing `secp256k1/serde` from `use-serde`. The former one is explained in the doc of `src/util/psbt_no_key/mod.rs`. The latter is due to inability to avoid compiling `secp256k1` when not needed. (`electrs` hit this)
|
Compile times on my machine after the change: |
This feature makes it possible to enable `serde` in `secp256k1` without having to import it and without forcing use of `secp256k1` when `serde` is needed.
|
IMO secp should be on by default |
|
@elichai I'm personally not very happy about default features as users sometimes forget to turn them off when not needed. Forgetting to turn it on is impossible, since compiler will let you know very quickly. :) But if other agree with you, I will add it to deafults. |
|
Targeting 0.27. It may be that we want to split the crates up more to achieve this same goal. |
|
Is the intended design described somewhere? |
|
No, I'll try to open a tracking/discussion issue today. |
|
Note that with rust-bitcoin/rust-secp256k1#289, while compile times won't change, release binaries should entirely drop any secp functions that are unused. |
|
Making the C library optional seems to be cleaner approach, closing. |
This change makes
secp256k1an optional dependency so thatapplications requiring chain parsing but not doing any validation nor
signing do not have to compile
secp256k1. This is a breaking changebecause dependencies of this crate must fix their feature settings but
apart from that they don't need to do anything.
There are two things which may be surprising: moving of some modules and
removing
secp256k1/serdefromuse-serde. The former one is explainedin the doc of
src/util/psbt_no_key/mod.rs. The latter is due toinability to avoid compiling
secp256k1when not needed. (electrshitthis)
Closes #526