Skip to content

Commit bee9a1e

Browse files
authored
Merge pull request #1012 from TheBlueMatt/2021-07-bump-deps
Bump dependencies to bitcoin 0.27 and bech32 0.8
2 parents fe4b0b8 + 0671ca6 commit bee9a1e

File tree

13 files changed

+30
-22
lines changed

13 files changed

+30
-22
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
1.41.0,
1717
# 1.45.2 is MSRV for lightning-net-tokio, lightning-block-sync, and coverage generation
1818
1.45.2,
19-
# 1.49.0 is MSRV for no_std builds using hashbrown
20-
1.49.0]
19+
# 1.47.0 will be the MSRV for no_std builds using hashbrown once core2 is updated
20+
1.47.0]
2121
include:
2222
- toolchain: stable
2323
build-net-tokio: true
@@ -41,8 +41,8 @@ jobs:
4141
build-net-tokio: true
4242
build-no-std: false
4343
coverage: true
44-
- toolchain: 1.49.0
45-
build-no-std: true
44+
- toolchain: 1.47.0
45+
build-no-std: false
4646
runs-on: ${{ matrix.platform }}
4747
steps:
4848
- name: Checkout source code

fuzz/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ stdin_fuzz = []
1919
[dependencies]
2020
afl = { version = "0.4", optional = true }
2121
lightning = { path = "../lightning", features = ["fuzztarget"] }
22-
bitcoin = { version = "0.26", features = ["fuzztarget", "secp-lowmemory"] }
22+
bitcoin = { version = "0.27", features = ["fuzztarget", "secp-lowmemory"] }
2323
hex = "0.3"
2424
honggfuzz = { version = "0.5", optional = true }
2525
libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git", optional = true }

lightning-background-processor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Utilities to perform required background tasks for Rust Lightning.
1010
edition = "2018"
1111

1212
[dependencies]
13-
bitcoin = "0.26"
13+
bitcoin = "0.27"
1414
lightning = { version = "0.0.99", path = "../lightning", features = ["allow_wallclock_use"] }
1515
lightning-persister = { version = "0.0.99", path = "../lightning-persister" }
1616

lightning-block-sync/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rest-client = [ "serde", "serde_json", "chunked_transfer" ]
1414
rpc-client = [ "serde", "serde_json", "chunked_transfer" ]
1515

1616
[dependencies]
17-
bitcoin = "0.26"
17+
bitcoin = "0.27"
1818
lightning = { version = "0.0.99", path = "../lightning" }
1919
tokio = { version = "1.0", features = [ "io-util", "net", "time" ], optional = true }
2020
serde = { version = "1.0", features = ["derive"], optional = true }

lightning-invoice/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ keywords = [ "lightning", "bitcoin", "invoice", "BOLT11" ]
99
readme = "README.md"
1010

1111
[dependencies]
12-
bech32 = "0.7"
12+
bech32 = "0.8"
1313
lightning = { version = "0.0.99", path = "../lightning" }
1414
secp256k1 = { version = "0.20", features = ["recovery"] }
1515
num-traits = "0.2.8"
16-
bitcoin_hashes = "0.9.4"
16+
bitcoin_hashes = "0.10"
1717

1818
[dev-dependencies]
1919
lightning = { version = "0.0.99", path = "../lightning", features = ["_test_utils"] }

lightning-invoice/fuzz/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ honggfuzz_fuzz = ["honggfuzz"]
1515
honggfuzz = { version = "0.5", optional = true }
1616
afl = { version = "0.4", optional = true }
1717
lightning-invoice = { path = ".."}
18-
bech32 = "0.7"
18+
bech32 = "0.8"
1919

2020
# Prevent this from interfering with workspaces
2121
[workspace]

lightning-invoice/src/de.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,13 @@ impl FromStr for SignedRawInvoice {
250250
type Err = ParseError;
251251

252252
fn from_str(s: &str) -> Result<Self, Self::Err> {
253-
let (hrp, data) = bech32::decode(s)?;
253+
let (hrp, data, var) = bech32::decode(s)?;
254+
255+
if var == bech32::Variant::Bech32m {
256+
// Consider Bech32m addresses to be "Invalid Checksum", since that is what we'd get if
257+
// we didn't support Bech32m (which lightning does not use).
258+
return Err(ParseError::Bech32Error(bech32::Error::InvalidChecksum));
259+
}
254260

255261
if data.len() < 104 {
256262
return Err(ParseError::TooShortDataPart);

lightning-invoice/src/ser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl Display for SignedRawInvoice {
117117
let mut data = self.raw_invoice.data.to_base32();
118118
data.extend_from_slice(&self.signature.to_base32());
119119

120-
bech32::encode_to_fmt(f, &hrp, data).expect("HRP is valid")?;
120+
bech32::encode_to_fmt(f, &hrp, data, bech32::Variant::Bech32).expect("HRP is valid")?;
121121

122122
Ok(())
123123
}

lightning-net-tokio/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ For Rust-Lightning clients which wish to make direct connections to Lightning P2
1111
edition = "2018"
1212

1313
[dependencies]
14-
bitcoin = "0.26"
14+
bitcoin = "0.27"
1515
lightning = { version = "0.0.99", path = "../lightning" }
1616
tokio = { version = "1.0", features = [ "io-util", "macros", "rt", "sync", "net", "time" ] }
1717

lightning-persister/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Utilities to manage Rust-Lightning channel data persistence and retrieval.
1212
unstable = ["lightning/unstable"]
1313

1414
[dependencies]
15-
bitcoin = "0.26"
15+
bitcoin = "0.27"
1616
lightning = { version = "0.0.99", path = "../lightning" }
1717
libc = "0.2"
1818

lightning/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ max_level_debug = []
2626
unsafe_revoked_tx_signing = []
2727
unstable = []
2828

29-
no_std = ["hashbrown"]
30-
std = []
29+
no_std = ["hashbrown", "bitcoin/no-std"]
30+
std = ["bitcoin/std"]
3131

3232
default = ["std"]
3333

3434
[dependencies]
35-
bitcoin = "0.26"
35+
bitcoin = "0.27"
3636

3737
hashbrown = { version = "0.11", optional = true }
3838
hex = { version = "0.3", optional = true }
@@ -43,7 +43,7 @@ hex = "0.3"
4343
regex = "0.1.80"
4444

4545
[dev-dependencies.bitcoin]
46-
version = "0.26"
46+
version = "0.27"
4747
features = ["bitcoinconsensus"]
4848

4949
[package.metadata.docs.rs]

lightning/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#![cfg_attr(all(any(test, feature = "_test_utils"), feature = "unstable"), feature(test))]
3232
#[cfg(all(any(test, feature = "_test_utils"), feature = "unstable"))] extern crate test;
3333

34+
#[macro_use]
3435
extern crate alloc;
3536
extern crate bitcoin;
3637
extern crate core;

lightning/src/ln/channelmanager.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5114,23 +5114,24 @@ impl<'a, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
51145114
mod tests {
51155115
use bitcoin::hashes::Hash;
51165116
use bitcoin::hashes::sha256::Hash as Sha256;
5117-
use core::sync::atomic::{AtomicBool, Ordering};
51185117
use core::time::Duration;
51195118
use ln::{PaymentPreimage, PaymentHash, PaymentSecret};
5120-
use ln::channelmanager::PersistenceNotifier;
51215119
use ln::features::{InitFeatures, InvoiceFeatures};
51225120
use ln::functional_test_utils::*;
51235121
use ln::msgs;
51245122
use ln::msgs::ChannelMessageHandler;
51255123
use routing::router::{get_keysend_route, get_route};
51265124
use util::events::{Event, MessageSendEvent, MessageSendEventsProvider};
51275125
use util::test_utils;
5128-
use std::sync::Arc;
5129-
use std::thread;
51305126

51315127
#[cfg(feature = "std")]
51325128
#[test]
51335129
fn test_wait_timeout() {
5130+
use ln::channelmanager::PersistenceNotifier;
5131+
use sync::Arc;
5132+
use core::sync::atomic::{AtomicBool, Ordering};
5133+
use std::thread;
5134+
51345135
let persistence_notifier = Arc::new(PersistenceNotifier::new());
51355136
let thread_notifier = Arc::clone(&persistence_notifier);
51365137

0 commit comments

Comments
 (0)