Blockstream / greenlight

Build apps using self-custodial lightning nodes in the cloud
https://blockstream.github.io/greenlight/getting-started/
MIT License
110 stars 28 forks source link

Remove duplicate bitcoin dependency #352

Closed ok300 closed 7 months ago

ok300 commented 7 months ago

This PR replaces the explicit bitcoin dependency with the lightning_signer::bitcoin re-exported one, for two reasons:

First, the explicit one it's not used. The re-exported lightning_signer::bitcoin is already used as such, for example

https://github.com/Blockstream/greenlight/blob/62ade9c53b68b8f7625725033121babb51720dbb/libs/gl-client/src/export.rs#L5-L8

Second, the explicit dependency brings with it a separate version into the dependency tree. Removing it and instead re-using the exported one consolidates the dependency tree and helps remove duplicates.

For example, before this PR, GL had 3 separate bitcoin versions in the dependency tree.

cargo tree --duplicate | grep bitcoin

...
bitcoin v0.29.2 (*)
bitcoin v0.30.2 (*)
bitcoin v0.31.0 (*)

With this PR, there are only 2 left:

cargo tree --duplicate | grep bitcoin

...
bitcoin v0.29.2 (*)
bitcoin v0.30.2 (*)

Related to https://github.com/Blockstream/greenlight/issues/335

ok300 commented 7 months ago

This also consolidates a few other duplicate transitive dependencies, for example bech32, bitcoin_hashes and secp256k1 (see Cargo.lock PR changes).

cdecker commented 7 months ago

ACK https://github.com/Blockstream/greenlight/pull/352/commits/fc6ffafeda9ba58768c3d0a1b659312e91145213