Skip to content

Commit aeabad8

Browse files
committed
Cut over to using the bitcoin core subtree
We now have a git subtree for the Bitcoin Core code at `depend/bitcoin`. Cut over from the `tmp/bitcoin` submodule to the `depend/bitcoin` subtree. Please note, this moves the bitcoin repository tip to the tagged release of the 0.19.2 version instead of the tip used in the current submodule (0.19.0 with a few extra patches). We update the library version appropriately to 0.19.2-0.4.1
1 parent 2642821 commit aeabad8

File tree

5 files changed

+32
-40
lines changed

5 files changed

+32
-40
lines changed

.gitmodules

Lines changed: 0 additions & 4 deletions
This file was deleted.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[package]
22
name = "bitcoinconsensus"
33
# The first part is the Bitcoin Core version, the second part is the version of this lib.
4-
version = "0.19.0-0.4.0"
4+
version = "0.19.2-0.4.1"
55
authors = ["Tamas Blummer <tamas.blummer@gmail.com>"]
66
license = "Apache-2.0"
77
homepage = "https://github.com/rust-bitcoin/rust-bitcoinconsensus/"
88
repository = "https://github.com/rust-bitcoin/rust-bitcoinconsensus/"
99
description = "Bitcoin's libbitcoinconsensus with Rust binding."
1010
keywords = [ "bitcoin", "bitcoinconsensus", "libbitcoinconsensus" ]
1111
readme = "README.md"
12-
exclude = ["/tmp/bitcoin/.github/**", "/tmp/bitcoin/.tx/**", "/tmp/bitcoin/build-aux/**", "/tmp/bitcoin/contrib/**", "/tmp/bitcoin/tmps/**", "/tmp/bitcoin/doc/**", "/tmp/bitcoin/share/**", "/tmp/bitcoin/test/**", "/tmp/bitcoin/src/bench/**", "/tmp/bitcoin/src/config/**", "/tmp/bitcoin/src/consensus/**", "/tmp/bitcoin/src/leveldb/**", "/tmp/bitcoin/src/policy/**", "/tmp/bitcoin/src/qt/**", "/tmp/bitcoin/src/rpc/**", "/tmp/bitcoin/src/support/**", "/tmp/bitcoin/src/test/**", "/tmp/bitcoin/src/univalue/**", "/tmp/bitcoin/src/wallet/**", "/tmp/bitcoin/src/zmq/**"]
12+
exclude = ["/depend/bitcoin/.github/**", "/depend/bitcoin/.tx/**", "/depend/bitcoin/build-aux/**", "/depend/bitcoin/contrib/**", "/depend/bitcoin/depends/**", "/depend/bitcoin/doc/**", "/depend/bitcoin/share/**", "/depend/bitcoin/test/**", "/depend/bitcoin/src/bench/**", "/depend/bitcoin/src/config/**", "/depend/bitcoin/src/consensus/**", "/depend/bitcoin/src/leveldb/**", "/depend/bitcoin/src/policy/**", "/depend/bitcoin/src/qt/**", "/depend/bitcoin/src/rpc/**", "/depend/bitcoin/src/support/**", "/depend/bitcoin/src/test/**", "/depend/bitcoin/src/univalue/**", "/depend/bitcoin/src/wallet/**", "/depend/bitcoin/src/zmq/**"]
1313
build = "build.rs"
1414
edition = "2018"
1515

README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,18 @@ The project [rust-secp256k1](https://github.com/rust-bitcoin/rust-secp256k1) off
1818
This introduces a risk, since a difference between the two secp256k1 sources could break consensus with Bitcoin.
1919

2020

21-
## Build
22-
23-
This project has a submodule (the Bitcoin Core sources), you have to clone it using:
24-
25-
`
26-
git clone --recurse-submodules git@github.com:rust-bitcoin/rust-bitcoinconsensus.git
27-
`
28-
29-
then build it simple with:
30-
31-
`
32-
cargo build
33-
`
34-
35-
I verified the build for Linux and OSX. Aleksey Sidorov contributed the windows build. PRs are welcome to extend support for other platforms.
21+
## Bitcoin Core subtree
22+
23+
We use a git subtree to vendor the Bitcoin Core code. This can be seen from the following commits that were created using `git subtree add --prefix='depend/bitcoin' git@github.com:bitcoin/bitcoin.git v0.19.2 --squash`.
24+
```
25+
f751613e62 Squashed 'depend/bitcoin/' content from commit 204cc0f575
26+
264282188a Merge commit 'f751613e6203770fa94143b9aba1d116512f0ce7' as 'depend/bitcoin'
27+
```
28+
29+
To use a later version of Bitcoin Core, for example, v0.20.2
30+
```
31+
git subtree pull --prefix='depend/bitcoin' git@github.com:bitcoin/bitcoin.git v0.20.2 --squash
32+
```
3633

3734

3835
## MSRV

build.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ fn main() {
2222
let mut base_config = cc::Build::new();
2323
base_config
2424
.cpp(true)
25-
.include("tmp/bitcoin/src")
26-
.include("tmp/bitcoin/src/secp256k1/include")
25+
.include("depend/bitcoin/src")
26+
.include("depend/bitcoin/src/secp256k1/include")
2727
.define("__STDC_FORMAT_MACROS", None);
2828

2929
// **Secp256k1**
3030
if !cfg!(feature = "external-secp") {
3131
base_config
32-
.include("tmp/bitcoin/src/secp256k1")
32+
.include("depend/bitcoin/src/secp256k1")
3333
.flag_if_supported("-Wno-unused-function") // some ecmult stuff is defined but not used upstream
3434
.define("SECP256K1_BUILD", "1")
3535
// Bitcoin core defines libsecp to *not* use libgmp.
@@ -39,7 +39,7 @@ fn main() {
3939
// Technically libconsensus doesn't require the recovery feautre, but `pubkey.cpp` does.
4040
.define("ENABLE_MODULE_RECOVERY", "1")
4141
// The actual libsecp256k1 C code.
42-
.file("tmp/bitcoin/src/secp256k1/src/secp256k1.c");
42+
.file("depend/bitcoin/src/secp256k1/src/secp256k1.c");
4343

4444
if is_big_endian {
4545
base_config.define("WORDS_BIGENDIAN", "1");
@@ -68,19 +68,19 @@ fn main() {
6868
base_config.define("WIN32", "1");
6969
}
7070
base_config
71-
.file("tmp/bitcoin/src/util/strencodings.cpp")
72-
.file("tmp/bitcoin/src/uint256.cpp")
73-
.file("tmp/bitcoin/src/pubkey.cpp")
74-
.file("tmp/bitcoin/src/hash.cpp")
75-
.file("tmp/bitcoin/src/primitives/transaction.cpp")
76-
.file("tmp/bitcoin/src/crypto/ripemd160.cpp")
77-
.file("tmp/bitcoin/src/crypto/sha1.cpp")
78-
.file("tmp/bitcoin/src/crypto/sha256.cpp")
79-
.file("tmp/bitcoin/src/crypto/sha512.cpp")
80-
.file("tmp/bitcoin/src/crypto/hmac_sha512.cpp")
81-
.file("tmp/bitcoin/src/script/bitcoinconsensus.cpp")
82-
.file("tmp/bitcoin/src/script/interpreter.cpp")
83-
.file("tmp/bitcoin/src/script/script.cpp")
84-
.file("tmp/bitcoin/src/script/script_error.cpp")
71+
.file("depend/bitcoin/src/util/strencodings.cpp")
72+
.file("depend/bitcoin/src/uint256.cpp")
73+
.file("depend/bitcoin/src/pubkey.cpp")
74+
.file("depend/bitcoin/src/hash.cpp")
75+
.file("depend/bitcoin/src/primitives/transaction.cpp")
76+
.file("depend/bitcoin/src/crypto/ripemd160.cpp")
77+
.file("depend/bitcoin/src/crypto/sha1.cpp")
78+
.file("depend/bitcoin/src/crypto/sha256.cpp")
79+
.file("depend/bitcoin/src/crypto/sha512.cpp")
80+
.file("depend/bitcoin/src/crypto/hmac_sha512.cpp")
81+
.file("depend/bitcoin/src/script/bitcoinconsensus.cpp")
82+
.file("depend/bitcoin/src/script/interpreter.cpp")
83+
.file("depend/bitcoin/src/script/script.cpp")
84+
.file("depend/bitcoin/src/script/script_error.cpp")
8585
.compile("libbitcoinconsensus.a");
8686
}

tmp/bitcoin

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)