rust-bitcoin-unsafe-fast/bitcoin
Andrew Poelstra 4abbdc20a0
Merge rust-bitcoin/rust-bitcoin#1820: Expose valid (min, max) difficulty transition thresholds
8e6f953aa7 Expose valid (min, max) difficulty transition thresholds (Wilmer Paulino)

Pull request description:

  Once `U256` was made private, we lost the ability to check whether a valid difficulty transition was made in the chain, since `Target` doesn't expose any operations. We only choose to expose `Shl<u32>` and `Shr<u32>` such that we can compute the min and max target thresholds allowed for a difficulty transition.

  This is something we realized was missing after bumping to `rust-bitcoin v0.30.0` in `rust-lightning`, specifically for our `lightning-block-sync` crate. It may also be worth having a helper in `rust-bitcoin` that checks a header properly builds upon the previous, but that can be left for future work.

ACKs for top commit:
  Kixunil:
    ACK 8e6f953aa7
  sanket1729:
    ACK 8e6f953aa7 . Sorry, was confused by some details.
  apoelstra:
    ACK 8e6f953aa7

Tree-SHA512: 740dd64089426463dc6a19726d5a562276bd0966e0e31af8e1e67b28d18945644ac0e50be3cf0cc7fa604acc3d2c5b912a77a7caa69d8cff85f70fd57e5328c5
2023-05-06 18:53:15 +00:00
..
contrib Test with minimal dependency versions 2023-05-03 08:06:46 +10:00
embedded embedded: Remove error handler 2023-04-26 14:29:39 +10:00
examples Use Amount type for TxOut value field 2023-05-04 17:09:08 +02:00
src Merge rust-bitcoin/rust-bitcoin#1820: Expose valid (min, max) difficulty transition thresholds 2023-05-06 18:53:15 +00:00
tests Use Amount type for TxOut value field 2023-05-04 17:09:08 +02:00
CHANGELOG.md Bump version to v0.30.0 2023-03-22 08:41:21 +11:00
Cargo.toml Bump core2 dependency from 0.3.0 -> 0.3.2 2023-05-01 10:07:43 +10:00
build.rs Remove rust_v_1_46 2023-03-23 08:27:10 +11:00