Skip to content

Accidentally closed: ~Release v0.28.0~ #621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from
Closed
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Unreleased
# 0.28.0 - 202-08-09

* Bump MSRV to 1.48
* Depend on recent release of `bitcoin_hashes` v0.13.0 [#621](https://github.com/rust-bitcoin/rust-secp256k1/pull/621)
* Add a verify function to `PublicKey` [#618](https://github.com/rust-bitcoin/rust-secp256k1/pull/618)
* Add serialize function for schnorr::Signature [#607](https://github.com/rust-bitcoin/rust-secp256k1/pull/607)
* Bump MSRV to 1.48 [#595](https://github.com/rust-bitcoin/rust-secp256k1/pull/595)
* Remove implementations of `PartialEq`, `Eq`, `PartialOrd`, `Ord`, and `Hash` from the
`impl_array_newtype` macro. Users will now need to derive these traits if they are wanted.

Expand Down
22 changes: 14 additions & 8 deletions contrib/Cargo.minimal.lock → Cargo-minimal.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ dependencies = [
]

[[package]]
name = "bitcoin-private"
version = "0.1.0"
name = "bitcoin-internals"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57"
checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb"

[[package]]
name = "bitcoin_hashes"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501"
version = "0.13.0"
source = "git+https://github.com/tcharding/rust-bitcoin?rev=37d1d288a67fe7e0cd53962f66faa854621bade0#37d1d288a67fe7e0cd53962f66faa854621bade0"
dependencies = [
"bitcoin-private",
"bitcoin-internals",
"hex-conservative",
]

[[package]]
Expand Down Expand Up @@ -103,6 +103,12 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee6c0438de3ca4d8cac2eec62b228e2f8865cfe9ebefea720406774223fa2d2e"

[[package]]
name = "hex-conservative"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2"

[[package]]
name = "itoa"
version = "0.3.0"
Expand Down Expand Up @@ -250,7 +256,7 @@ checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"

[[package]]
name = "secp256k1"
version = "0.27.0"
version = "0.28.0"
dependencies = [
"bincode",
"bitcoin_hashes",
Expand Down
22 changes: 14 additions & 8 deletions contrib/Cargo.latest.lock → Cargo-recent.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ dependencies = [
]

[[package]]
name = "bitcoin-private"
version = "0.1.0"
name = "bitcoin-internals"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57"
checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb"

[[package]]
name = "bitcoin_hashes"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501"
version = "0.13.0"
source = "git+https://github.com/tcharding/rust-bitcoin?rev=37d1d288a67fe7e0cd53962f66faa854621bade0#37d1d288a67fe7e0cd53962f66faa854621bade0"
dependencies = [
"bitcoin-private",
"bitcoin-internals",
"hex-conservative",
]

[[package]]
Expand Down Expand Up @@ -79,6 +79,12 @@ version = "1.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7"

[[package]]
name = "hex-conservative"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2"

[[package]]
name = "js-sys"
version = "0.3.61"
Expand Down Expand Up @@ -171,7 +177,7 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"

[[package]]
name = "secp256k1"
version = "0.27.0"
version = "0.28.0"
dependencies = [
"bincode",
"bitcoin_hashes",
Expand Down
22 changes: 15 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "secp256k1"
version = "0.27.0"
version = "0.28.0"
authors = [ "Dawid Ciężarkiewicz <[email protected]>",
"Andrew Poelstra <[email protected]>" ]
license = "CC0-1.0"
Expand All @@ -21,8 +21,7 @@ default = ["std"]
std = ["alloc", "secp256k1-sys/std"]
# allow use of Secp256k1::new and related API that requires an allocator
alloc = ["secp256k1-sys/alloc"]
bitcoin-hashes = ["bitcoin_hashes"] # Feature alias because of the underscore.
bitcoin-hashes-std = ["std", "bitcoin_hashes", "bitcoin_hashes/std"]
hashes-std = ["std", "hashes/std"]
rand-std = ["std", "rand", "rand/std", "rand/std_rng"]
recovery = ["secp256k1-sys/recovery"]
lowmemory = ["secp256k1-sys/lowmemory"]
Expand All @@ -40,8 +39,8 @@ secp256k1-sys = { version = "0.8.1", default-features = false, path = "./secp256
serde = { version = "1.0.103", default-features = false, optional = true }

# You likely only want to enable these if you explicitly do not want to use "std", otherwise enable
# the respective -std feature e.g., bitcoin-hashes-std
bitcoin_hashes = { version = "0.12", default-features = false, optional = true }
# the respective -std feature e.g., hashes-std
hashes = { package = "bitcoin_hashes", version = "0.13.0", default-features = false, optional = true }
rand = { version = "0.8", default-features = false, optional = true }

[dev-dependencies]
Expand All @@ -57,11 +56,11 @@ getrandom = { version = "0.2", features = ["js"] }

[[example]]
name = "sign_verify_recovery"
required-features = ["recovery", "bitcoin-hashes-std"]
required-features = ["recovery", "hashes-std"]

[[example]]
name = "sign_verify"
required-features = ["bitcoin-hashes-std"]
required-features = ["hashes-std"]

[[example]]
name = "generate_keys"
Expand All @@ -70,3 +69,12 @@ required-features = ["rand-std"]
[workspace]
members = ["secp256k1-sys"]
exclude = ["no_std_test"]

# TODO: Remove this when hashes v.0.13.0 is released.
[patch.crates-io.bitcoin_hashes]
git = "https://github.com/tcharding/rust-bitcoin"
# source branch: tharding/06-20-hashes-release
# rust-bicoin PR: #1917
# One commit back from branch tip.
# commit: `hashes: Bump version to 0.13.0`
rev = "37d1d288a67fe7e0cd53962f66faa854621bade0"
120 changes: 120 additions & 0 deletions contrib/_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/bin/sh

set -ex

FEATURES="hashes global-context lowmemory rand recovery serde std alloc hashes-std rand-std"

cargo --version
rustc --version

# Work out if we are using a nightly toolchain.
NIGHTLY=false
if cargo --version | grep nightly; then
NIGHTLY=true
fi

# Pin dependencies as required if we are using MSRV toolchain.
if cargo --version | grep "1\.48"; then
cargo update -p wasm-bindgen-test --precise 0.3.34
cargo update -p serde --precise 1.0.156
fi

# Test if panic in C code aborts the process (either with a real panic or with SIGILL)
cargo test --locked -- --ignored --exact 'tests::test_panic_raw_ctx_should_terminate_abnormally' 2>&1 | tee /dev/stderr | grep "SIGILL\\|panicked at '\[libsecp256k1\]"

# Make all cargo invocations verbose
export CARGO_TERM_VERBOSE=true

# Defaults / sanity checks
cargo build --locked --all
cargo test --locked --all

if [ "$DO_FEATURE_MATRIX" = true ]; then
cargo build --locked --all --no-default-features
cargo test --locked --all --no-default-features

# All features
cargo build --locked --all --no-default-features --features="$FEATURES"
cargo test --locked --all --no-default-features --features="$FEATURES"
# Single features
for feature in ${FEATURES}
do
cargo build --locked --all --no-default-features --features="$feature"
cargo test --locked --all --no-default-features --features="$feature"
done
# Features tested with 'std' feature enabled.
for feature in ${FEATURES}
do
cargo build --locked --all --no-default-features --features="std,$feature"
cargo test --locked --all --no-default-features --features="std,$feature"
done
# Other combos
RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --locked --all
RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --locked --all --features="$FEATURES"
cargo test --locked --all --features="rand serde"

if [ "$NIGHTLY" = true ]; then
cargo test --locked --all --all-features
RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --locked --all --all-features
fi

# Examples
cargo run --locked --example sign_verify --features=hashes-std
cargo run --locked --example sign_verify_recovery --features=recovery,hashes-std
cargo run --locked --example generate_keys --features=rand-std
fi

if [ "$DO_LINT" = true ]
then
cargo clippy --locked --all-features --all-targets -- -D warnings
cargo clippy --locked --example sign_verify --features=hashes-std -- -D warnings
cargo clippy --locked --example sign_verify_recovery --features=recovery,hashes-std -- -D warnings
cargo clippy --locked --example generate_keys --features=rand-std -- -D warnings
fi

# Build the docs if told to (this only works with the nightly toolchain)
if [ "$DO_DOCSRS" = true ]; then
RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +nightly doc --all-features
fi

# Build the docs with a stable toolchain, in unison with the DO_DOCSRS command
# above this checks that we feature guarded docs imports correctly.
if [ "$DO_DOCS" = true ]; then
RUSTDOCFLAGS="-D warnings" cargo +stable doc --all-features
fi

# Address Sanitizer
if [ "$DO_ASAN" = true ]; then
clang --version
cargo clean
CC='clang -fsanitize=address -fno-omit-frame-pointer' \
RUSTFLAGS='-Zsanitizer=address -Clinker=clang -Cforce-frame-pointers=yes' \
ASAN_OPTIONS='detect_leaks=1 detect_invalid_pointer_pairs=1 detect_stack_use_after_return=1' \
cargo test --lib --all --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu
cargo clean
# The -Cllvm-args=-msan-eager-checks=0 flag was added to overcome this issue:
# https://github.com/rust-bitcoin/rust-secp256k1/pull/573#issuecomment-1399465995
CC='clang -fsanitize=memory -fno-omit-frame-pointer' \
RUSTFLAGS='-Zsanitizer=memory -Zsanitizer-memory-track-origins -Cforce-frame-pointers=yes -Cllvm-args=-msan-eager-checks=0' \
cargo test --lib --all --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu
cargo run --release --manifest-path=./no_std_test/Cargo.toml | grep -q "Verified Successfully"
cargo run --release --features=alloc --manifest-path=./no_std_test/Cargo.toml | grep -q "Verified alloc Successfully"
fi

# Run formatter if told to.
if [ "$DO_FMT" = true ]; then
if [ "$NIGHTLY" = false ]; then
echo "DO_FMT requires a nightly toolchain (consider using RUSTUP_TOOLCHAIN)"
exit 1
fi
rustup component add rustfmt
cargo fmt --check || exit 1
fi

# Bench if told to, only works with non-stable toolchain (nightly, beta).
if [ "$DO_BENCH" = true ]
then
RUSTFLAGS='--cfg=bench' cargo bench --features=recovery,rand-std
fi

exit 0
Loading