Skip to content

Commit 2e3b81d

Browse files
committed
bitcoin 0.28.0
1 parent e3a305c commit 2e3b81d

Some content is hidden

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

46 files changed

+377
-347
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
1.41.1,
1515
# 1.45.2 is MSRV for lightning-net-tokio, lightning-block-sync, and coverage generation
1616
1.45.2,
17-
# 1.47.0 will be the MSRV for no-std builds using hashbrown once core2 is updated
18-
1.47.0]
17+
# 1.53.0 is the MSRV for no-std builds
18+
1.53.0]
1919
include:
2020
- toolchain: stable
2121
build-net-tokio: true
@@ -47,7 +47,7 @@ jobs:
4747
build-net-tokio: true
4848
build-no-std: false
4949
coverage: true
50-
- toolchain: 1.47.0
50+
- toolchain: 1.53.0
5151
build-no-std: true
5252
runs-on: ${{ matrix.platform }}
5353
steps:
@@ -288,7 +288,7 @@ jobs:
288288
linting:
289289
runs-on: ubuntu-latest
290290
env:
291-
TOOLCHAIN: 1.47.0
291+
TOOLCHAIN: 1.53.0
292292
steps:
293293
- name: Checkout source code
294294
uses: actions/checkout@v3

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 = ["regex"] }
22-
bitcoin = { version = "0.27", features = ["fuzztarget", "secp-lowmemory"] }
22+
bitcoin = { version = "0.28.0", features = ["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 }

fuzz/src/chanmon_consistency.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ use lightning::routing::router::{Route, RouteHop};
5353
use utils::test_logger::{self, Output};
5454
use utils::test_persister::TestPersister;
5555

56-
use bitcoin::secp256k1::key::{PublicKey,SecretKey};
57-
use bitcoin::secp256k1::recovery::RecoverableSignature;
56+
use bitcoin::secp256k1::{PublicKey,SecretKey};
57+
use bitcoin::secp256k1::ecdsa::RecoverableSignature;
5858
use bitcoin::secp256k1::Secp256k1;
5959

6060
use std::mem;

fuzz/src/full_stack.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ use lightning::util::ser::ReadableArgs;
5050
use utils::test_logger;
5151
use utils::test_persister::TestPersister;
5252

53-
use bitcoin::secp256k1::key::{PublicKey,SecretKey};
54-
use bitcoin::secp256k1::recovery::RecoverableSignature;
53+
use bitcoin::secp256k1::{PublicKey,SecretKey};
54+
use bitcoin::secp256k1::ecdsa::RecoverableSignature;
5555
use bitcoin::secp256k1::Secp256k1;
5656

5757
use std::cell::RefCell;

fuzz/src/peer_crypt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
use lightning::ln::peer_channel_encryptor::PeerChannelEncryptor;
1111

12-
use bitcoin::secp256k1::key::{PublicKey,SecretKey};
12+
use bitcoin::secp256k1::{PublicKey,SecretKey};
1313

1414
use utils::test_logger;
1515

fuzz/src/router.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use lightning::util::ser::Readable;
2323
use lightning::routing::network_graph::{NetworkGraph, RoutingFees};
2424

2525
use bitcoin::hashes::Hash;
26-
use bitcoin::secp256k1::key::PublicKey;
26+
use bitcoin::secp256k1::PublicKey;
2727
use bitcoin::network::constants::Network;
2828
use bitcoin::blockdata::constants::genesis_block;
2929

lightning-background-processor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ all-features = true
1414
rustdoc-args = ["--cfg", "docsrs"]
1515

1616
[dependencies]
17-
bitcoin = "0.27"
17+
bitcoin = "0.28.0"
1818
lightning = { version = "0.0.106", path = "../lightning", features = ["std"] }
1919

2020
[dev-dependencies]

lightning-block-sync/Cargo.toml

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

2020
[dependencies]
21-
bitcoin = "0.27"
21+
bitcoin = "0.28.0"
2222
lightning = { version = "0.0.106", path = "../lightning" }
2323
futures = { version = "0.3" }
2424
tokio = { version = "1.0", features = [ "io-util", "net", "time" ], optional = true }

lightning-block-sync/src/test_utils.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use lightning::chain;
1111

1212
use std::cell::RefCell;
1313
use std::collections::VecDeque;
14+
use bitcoin::Transaction;
15+
use bitcoin::util::hash::bitcoin_merkle_root;
1416

1517
#[derive(Default)]
1618
pub struct Blockchain {
@@ -37,16 +39,27 @@ impl Blockchain {
3739
let prev_block = &self.blocks[i - 1];
3840
let prev_blockhash = prev_block.block_hash();
3941
let time = prev_block.header.time + height as u32;
42+
// Must have at least one transaction, because the merkle root is not defined for an empty block
43+
// and we would fail when we later checked, as of bitcoin 0.28.0.
44+
// Note that elsewhere in tests we assume that the merkle root of an empty block is all zeros,
45+
// but that's OK because those tests don't trigger the check.
46+
let coinbase = Transaction {
47+
version: 0,
48+
lock_time: 0,
49+
input: vec![],
50+
output: vec![]
51+
};
52+
let merkle_root = bitcoin_merkle_root(vec![coinbase.txid().as_hash()].into_iter()).unwrap();
4053
self.blocks.push(Block {
4154
header: BlockHeader {
4255
version: 0,
4356
prev_blockhash,
44-
merkle_root: Default::default(),
57+
merkle_root: merkle_root.into(),
4558
time,
4659
bits,
4760
nonce: 0,
4861
},
49-
txdata: vec![],
62+
txdata: vec![coinbase],
5063
});
5164
}
5265
self

lightning-invoice/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ std = ["bitcoin_hashes/std", "num-traits/std", "lightning/std", "bech32/std"]
2020
[dependencies]
2121
bech32 = { version = "0.8", default-features = false }
2222
lightning = { version = "0.0.106", path = "../lightning", default-features = false }
23-
secp256k1 = { version = "0.20", default-features = false, features = ["recovery", "alloc"] }
23+
secp256k1 = { version = "0.22", default-features = false, features = ["recovery", "alloc"] }
2424
num-traits = { version = "0.2.8", default-features = false }
2525
bitcoin_hashes = { version = "0.10", default-features = false }
2626
hashbrown = { version = "0.11", optional = true }

0 commit comments

Comments
 (0)