Skip to content

Commit bfda1b6

Browse files
authored
Merge pull request #3063 from jirijakes/upgrade-bitcoin-031
Upgrade rust-bitcoin dependency to 0.31
2 parents c57b94a + a8bd4c0 commit bfda1b6

File tree

148 files changed

+1132
-661
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+1132
-661
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ jobs:
192192
run: |
193193
cd fuzz && cargo update -p regex --precise "1.9.6" --verbose && cd ..
194194
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
195-
run: cd fuzz && RUSTFLAGS="--cfg=fuzzing" cargo test --verbose --color always
195+
run: cd fuzz && RUSTFLAGS="--cfg=fuzzing --cfg=secp256k1_fuzz --cfg=hashes_fuzz" cargo test --verbose --color always
196196
- name: Run fuzzers
197197
run: cd fuzz && ./ci-fuzz.sh && cd ..
198198

ci/check-cfg-flags.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ def check_target_os(os):
8282
def check_cfg_tag(cfg):
8383
if cfg == "fuzzing":
8484
pass
85+
elif cfg == "secp256k1_fuzz":
86+
pass
87+
elif cfg == "hashes_fuzz":
88+
pass
8589
elif cfg == "test":
8690
pass
8791
elif cfg == "debug_assertions":

ci/check-compiles.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ echo Testing $(git log -1 --oneline)
55
cargo check
66
cargo doc
77
cargo doc --document-private-items
8-
cd fuzz && RUSTFLAGS="--cfg=fuzzing" cargo check --features=stdin_fuzz
8+
cd fuzz && RUSTFLAGS="--cfg=fuzzing --cfg=secp256k1_fuzz --cfg=hashes_fuzz" cargo check --features=stdin_fuzz
99
cd ../lightning && cargo check --no-default-features --features=no-std
1010
cd .. && RUSTC_BOOTSTRAP=1 RUSTFLAGS="--cfg=c_bindings" cargo check -Z avoid-dev-deps

fuzz/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ stdin_fuzz = []
2121
lightning = { path = "../lightning", features = ["regex", "hashbrown", "_test_utils"] }
2222
lightning-invoice = { path = "../lightning-invoice" }
2323
lightning-rapid-gossip-sync = { path = "../lightning-rapid-gossip-sync" }
24-
bitcoin = { version = "0.30.2", features = ["secp-lowmemory"] }
24+
bech32 = "0.9.1"
25+
bitcoin = { version = "0.31.2", features = ["secp-lowmemory"] }
2526
hex = { package = "hex-conservative", version = "0.1.1", default-features = false }
2627

2728
afl = { version = "0.12", optional = true }

fuzz/ci-fuzz.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ popd
1515

1616
cargo install --color always --force honggfuzz --no-default-features
1717
sed -i 's/lto = true//' Cargo.toml
18-
HFUZZ_BUILD_ARGS="--features honggfuzz_fuzz" cargo --color always hfuzz build
18+
19+
export RUSTFLAGS="--cfg=secp256k1_fuzz --cfg=hashes_fuzz"
20+
export HFUZZ_BUILD_ARGS="--features honggfuzz_fuzz"
21+
22+
cargo --color always hfuzz build
1923
for TARGET in src/bin/*.rs; do
2024
FILENAME=$(basename $TARGET)
2125
FILE="${FILENAME%.*}"
@@ -28,7 +32,7 @@ for TARGET in src/bin/*.rs; do
2832
HFUZZ_RUN_ARGS="$HFUZZ_RUN_ARGS -N1000000"
2933
fi
3034
export HFUZZ_RUN_ARGS
31-
HFUZZ_BUILD_ARGS="--features honggfuzz_fuzz" cargo --color always hfuzz run $FILE
35+
cargo --color always hfuzz run $FILE
3236
if [ -f hfuzz_workspace/$FILE/HONGGFUZZ.REPORT.TXT ]; then
3337
cat hfuzz_workspace/$FILE/HONGGFUZZ.REPORT.TXT
3438
for CASE in hfuzz_workspace/$FILE/SIG*; do

fuzz/src/bin/base32_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::base32::*;
2026

fuzz/src/bin/bech32_parse_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::bech32_parse::*;
2026

fuzz/src/bin/bolt11_deser_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::bolt11_deser::*;
2026

fuzz/src/bin/chanmon_consistency_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::chanmon_consistency::*;
2026

fuzz/src/bin/chanmon_deser_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::chanmon_deser::*;
2026

fuzz/src/bin/fromstr_to_netaddress_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::fromstr_to_netaddress::*;
2026

fuzz/src/bin/full_stack_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::full_stack::*;
2026

fuzz/src/bin/indexedmap_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::indexedmap::*;
2026

fuzz/src/bin/invoice_deser_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::invoice_deser::*;
2026

fuzz/src/bin/invoice_request_deser_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::invoice_request_deser::*;
2026

fuzz/src/bin/msg_accept_channel_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_accept_channel::*;
2026

fuzz/src/bin/msg_accept_channel_v2_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_accept_channel_v2::*;
2026

fuzz/src/bin/msg_announcement_signatures_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_announcement_signatures::*;
2026

fuzz/src/bin/msg_channel_announcement_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_channel_announcement::*;
2026

fuzz/src/bin/msg_channel_details_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_channel_details::*;
2026

fuzz/src/bin/msg_channel_ready_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_channel_ready::*;
2026

fuzz/src/bin/msg_channel_reestablish_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_channel_reestablish::*;
2026

fuzz/src/bin/msg_channel_update_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_channel_update::*;
2026

fuzz/src/bin/msg_closing_signed_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_closing_signed::*;
2026

fuzz/src/bin/msg_commitment_signed_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_commitment_signed::*;
2026

fuzz/src/bin/msg_decoded_onion_error_packet_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_decoded_onion_error_packet::*;
2026

fuzz/src/bin/msg_error_message_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_error_message::*;
2026

fuzz/src/bin/msg_funding_created_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_funding_created::*;
2026

fuzz/src/bin/msg_funding_signed_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_funding_signed::*;
2026

fuzz/src/bin/msg_gossip_timestamp_filter_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_gossip_timestamp_filter::*;
2026

fuzz/src/bin/msg_init_target.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#[cfg(not(fuzzing))]
1616
compile_error!("Fuzz targets need cfg=fuzzing");
1717

18+
#[cfg(not(hashes_fuzz))]
19+
compile_error!("Fuzz targets need cfg=hashes_fuzz");
20+
21+
#[cfg(not(secp256k1_fuzz))]
22+
compile_error!("Fuzz targets need cfg=secp256k1_fuzz");
23+
1824
extern crate lightning_fuzz;
1925
use lightning_fuzz::msg_targets::msg_init::*;
2026

0 commit comments

Comments
 (0)