Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
89ea0d9
Create empty `bip158` crate
rustaceanrob Dec 9, 2025
2503669
Pin all RC dependencies
tcharding Dec 9, 2025
7b11af8
primitives: Remove deprecated type from API test
tcharding Dec 9, 2025
01d9c3c
bitcoin: Remove call to deprecated function
tcharding Dec 9, 2025
0341c7f
Release tracking PR: `primitives v1.0.0-rc.1`
tcharding Dec 4, 2025
683de6f
Fix panic messages in from_sat_i32 and from_sat_u32 to include input …
nseguias Jul 28, 2025
19a1208
Share lint configs in new packages
nyonson Dec 10, 2025
c8d5d03
Move `FilterHash`, `FilterHeader` to `p2p`
rustaceanrob Dec 10, 2025
43e7e05
p2p: remove HeaderExt dependency
nyonson Dec 10, 2025
78ee4e1
Fix script::Builder::push_verify() following a push_int()
shesek Dec 10, 2025
8608dad
Put feature gate below test attribute
tcharding Dec 11, 2025
cc77b00
Automated update to Github CI to rustc stable-1.92.0
Dec 12, 2025
cd2b41d
bitcoin: Use beta in release name
tcharding Oct 28, 2025
e1899cc
bitcoin: Update changelog
tcharding Oct 31, 2025
3a8b950
Use roundtrip instead of rinsed
tcharding Dec 11, 2025
fbcba69
Remove redundant readme sections in packages
nyonson Dec 11, 2025
3ebe0e1
Move maintainer docs to CONTRIBUTING
shinghim Dec 21, 2025
73c134d
Add missing release note links
nyonson Dec 11, 2025
3c2dbb5
chore: Implement Copy
uncomputable Dec 13, 2025
ebd2ff3
Implement Decodable for Witness using encoding crate
tcharding Oct 15, 2025
5438bb8
primitives: Remove Witness::from_parts__unstable
tcharding Oct 15, 2025
a9db10b
primitives: migrate to workspace lint rules
nyonson Dec 11, 2025
354dd2a
docs: extend consensus encoding adr with tech design
nyonson Oct 16, 2025
34c8e48
docs: fix mismatch between docs and code
Bashmunta Dec 12, 2025
51b6eb8
Fix script::Builder::push_slice() handling of 0x00
shesek Dec 10, 2025
2c70f48
Fix push_slice() tests
shesek Dec 10, 2025
6ded413
Fix ScriptBuf::push_slice() handling of 0x00
shesek Dec 10, 2025
4f7532b
Add comment explaining push_slice()'s minimality
shesek Dec 10, 2025
553441d
p2p: Remove `OutPointExt` from `p2p` tests
rustaceanrob Dec 13, 2025
6003bd4
Run the formatter
shinghim Dec 21, 2025
656cd9a
hashes: Remove uneeded wildcard import
tcharding Dec 15, 2025
d886bc8
Extend test coverage for BlockTime
mpbagot Dec 10, 2025
414a30d
bip158: Remove doc_auto_cfg
tcharding Dec 16, 2025
2bca7ac
Add a test of Witness::size()
jamillambert Dec 15, 2025
13d2000
Exclude deprecated functions from mutation testing
jamillambert Dec 15, 2025
d10194d
internals: Add api files
mpbagot Dec 13, 2025
a88ade6
Use usize for CompactSizeDecoder and add new_with_limit
mpbagot Dec 1, 2025
07cd465
primitives: Remove arrayvec dependency
mpbagot Dec 13, 2025
53e809d
internals: upgrade to workspace lint rules
nyonson Dec 17, 2025
f997891
p2p: upgrade to workspace lint rules
nyonson Dec 17, 2025
9c7ed16
Depend on primitives instead of bitcoin where type definitions overlap
yancyribbens Nov 26, 2025
3bc2910
Add re-export for primitives to Bitcoin crate
yancyribbens Dec 15, 2025
9e15f76
Use libfuzzer instead of honggfuzz
shinghim Dec 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/mutants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ exclude_re = [
"units/.* FeeRate::fee_vb", # Deprecated
"units/.* FeeRate::fee_wu", # Deprecated
"units/.* SignedAmount::checked_abs", # Deprecated
"units/.* NumberOfBlocks::to_consensus_u32", # Deprecated
"units/.* NumberOfBlocks::value", # Deprecated
"units/.* NumberOf512Seconds::to_consensus_u32", # Deprecated
"units/.* NumberOf512Seconds::value", # Deprecated
"units/.* MedianTimePast::to_consensus_u32", # Deprecated
"units/.* Height::to_consensus_u32", # Deprecated
"units/.* Sequence::to_hex", # Deprecated
Expand Down
37 changes: 37 additions & 0 deletions .github/docker/Dockerfile.s390x
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM ubuntu:24.04

# Install both native (x86_64) and cross (s390x) compilation toolchains
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gcc g++ \
gcc-13-s390x-linux-gnu \
g++-13-s390x-linux-gnu \
libc6-dev-s390x-cross \
qemu-user-static \
binfmt-support \
curl \
ca-certificates && \
rm -rf /var/lib/apt/lists/*

# Set up alternatives to use GCC 13 for s390x
RUN update-alternatives --install /usr/bin/s390x-linux-gnu-gcc s390x-linux-gnu-gcc /usr/bin/s390x-linux-gnu-gcc-13 100 && \
update-alternatives --install /usr/bin/s390x-linux-gnu-g++ s390x-linux-gnu-g++ /usr/bin/s390x-linux-gnu-g++-13 100

# Register QEMU for s390x binary execution
RUN update-binfmts --enable qemu-s390x || true

# Verify GCC versions
RUN gcc --version && \
s390x-linux-gnu-gcc --version && \
s390x-linux-gnu-g++ --version

# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup target add s390x-unknown-linux-gnu

# Set up cross-compilation environment
ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="qemu-s390x-static -L /usr/s390x-linux-gnu" \
CC_s390x_unknown_linux_gnu=s390x-linux-gnu-gcc \
CXX_s390x_unknown_linux_gnu=s390x-linux-gnu-g++
8 changes: 6 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,15 @@ jobs:
persist-credentials: false
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable
- name: "Add architecture i386"
- name: "Add architecture i386 and install dependencies"
run: |
sudo dpkg --add-architecture i386
sudo apt-get update -y
sudo apt-get install -y gcc-multilib g++-multilib
sudo apt-get install -y \
gcc-multilib \
g++-multilib \
libc6-dev-i386 \
lib32stdc++-13-dev
- name: "Install i686 gcc"
run: sudo apt-get update -y && sudo apt-get install -y gcc-multilib
- name: "Install target"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stable-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.91.1
1.92.0
95 changes: 93 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ changes to this document in a pull request.
- [General](#general)
- [Communication channels](#communication-channels)
- [Asking questions](#asking-questions)
- [Getting Started](#getting-started)
* [Installing Rust](#installing-rust)
* [Building](#building)
- [Development Tools](#development-tools)
* [Just](#just)
* [Githooks](#githooks)
* [Building the docs](#building-the-docs)
- [Contribution workflow](#contribution-workflow)
* [Preparing PRs](#preparing-prs)
* [Peer review](#peer-review)
Expand All @@ -25,6 +32,10 @@ changes to this document in a pull request.
* [Policy](#policy)
- [Security](#security)
- [Testing](#testing)
* [Unit/Integration tests](#unitintegration-tests)
* [Benchmarks](#benchmarks)
* [Mutation tests](#mutation-tests)
* [Code verification](#code-verification)
- [Going further](#going-further)


Expand Down Expand Up @@ -68,6 +79,58 @@ We have a dedicated developer channel on IRC, #bitcoin-rust@libera.chat where
you may get helpful advice if you have questions.


## Getting Started

### Installing Rust

Rust can be installed using your package manager of choice or [rustup.rs](https://rustup.rs). The
former way is considered more secure since it typically doesn't involve trust in the CA system. But
you should be aware that the version of Rust shipped by your distribution might be out of date.
Generally this isn't a problem for `rust-bitcoin` since we support much older versions than the
current stable one (see MSRV section in [README.md](./README.md)).

### Building

The library can be built and tested using [`cargo`](https://github.com/rust-lang/cargo/):

```
git clone git@github.com:rust-bitcoin/rust-bitcoin.git
cd rust-bitcoin
cargo build
```

You can run tests with:

```
cargo test
```

Please refer to the [`cargo` documentation](https://doc.rust-lang.org/stable/cargo/) for more
detailed instructions.


## Development Tools

### Just

We support [`just`](https://just.systems/man/en/) for running dev workflow commands. Run `just` from
your shell to see a list of available sub-commands.

### Githooks

To assist devs in catching errors _before_ running CI we provide some githooks. Copy the hooks in `githooks/`
to your githooks folder or run `just githooks-install` to copy them all.

### Building the docs

We build docs with the nightly toolchain, you may wish to use the following shell alias to check
your documentation changes build correctly.

```
alias build-docs='RUSTDOCFLAGS="--cfg docsrs" cargo +nightly rustdoc --features="$FEATURES" -- -D rustdoc::broken-intra-doc-links'
```


## Contribution workflow

The codebase is maintained using the "contributor workflow" where everyone
Expand Down Expand Up @@ -248,8 +311,36 @@ seriously. Due to the modular nature of the project, writing new test cases is
easy and good test coverage of the codebase is an important goal. Refactoring
the project to enable fine-grained unit testing is also an ongoing effort.

Various methods of testing are in use (e.g. fuzzing, mutation), please see
the [readme](./README.md) for more information.
Unit and integration tests are available for those interested, along with benchmarks. For project
developers, especially new contributors looking for something to work on, we do:

- Fuzz testing with [`Honggfuzz`](https://github.com/rust-fuzz/honggfuzz-rs)
- Mutation testing with [`cargo-mutants`](https://github.com/sourcefrog/cargo-mutants)
- Code verification with [`Kani`](https://github.com/model-checking/kani)

There are always more tests to write and more bugs to find. PRs are extremely welcomed.
Please consider testing code as a first-class citizen. We definitely do take PRs
improving and cleaning up test code.

### Unit/Integration tests

Run as for any other Rust project `cargo test --all-features`.

### Benchmarks

We use a custom Rust compiler configuration conditional to guard the bench mark code. To run the
bench marks use: `RUSTFLAGS='--cfg=bench' cargo +nightly bench`.

### Mutation tests

We are doing mutation testing with [cargo-mutants](https://github.com/sourcefrog/cargo-mutants). To run
these tests first install with `cargo install --locked cargo-mutants` then run with `cargo mutants --in-place --no-shuffle`.
Note that running these mutation tests will take on the order of 10's of minutes.

### Code verification

We have started using [kani](https://github.com/model-checking/kani), install with `cargo install --locked kani-verifier`
(no need to run `cargo kani setup`). Run the tests with `cargo kani`.


## LLMs, GitHub bot accounts, and AI agents
Expand Down
46 changes: 12 additions & 34 deletions Cargo-minimal.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ dependencies = [

[[package]]
name = "bitcoin"
version = "0.33.0-alpha.0"
version = "0.33.0-beta.0"
dependencies = [
"arbitrary",
"base58ck",
"base64",
"bech32",
"bincode",
"bitcoin-consensus-encoding",
"bitcoin-internals",
"bitcoin-io",
"bitcoin-primitives",
Expand All @@ -72,6 +73,10 @@ dependencies = [
name = "bitcoin-addresses"
version = "0.0.0"

[[package]]
name = "bitcoin-bip158"
version = "0.0.0"

[[package]]
name = "bitcoin-consensus-encoding"
version = "1.0.0-rc.2"
Expand Down Expand Up @@ -126,6 +131,7 @@ dependencies = [
"bitcoin-consensus-encoding",
"bitcoin-internals",
"bitcoin-io",
"bitcoin-primitives",
"bitcoin-units",
"bitcoin_hashes",
"hex-conservative 0.3.0",
Expand All @@ -134,10 +140,9 @@ dependencies = [

[[package]]
name = "bitcoin-primitives"
version = "1.0.0-rc.0"
version = "1.0.0-rc.1"
dependencies = [
"arbitrary",
"arrayvec",
"bincode",
"bitcoin-consensus-encoding",
"bitcoin-internals",
Expand Down Expand Up @@ -197,15 +202,9 @@ checksum = "60f0b0d4c0a382d2734228fd12b5a6b5dac185c60e938026fd31b265b94f9bd2"

[[package]]
name = "cc"
version = "1.2.47"
version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd405d82c84ff7f35739f175f67d8b9fb7687a0e84ccdc78bd3568839827cf07"
dependencies = [
"find-msvc-tools",
"jobserver",
"libc",
"shlex",
]
checksum = "bb4a8b715cb4597106ea87c7c84b2f1d452c7492033765df7f32651e66fcf749"

[[package]]
name = "cfg-if"
Expand All @@ -220,12 +219,6 @@ dependencies = [
"hex-conservative 0.3.0",
]

[[package]]
name = "find-msvc-tools"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844"

[[package]]
name = "getrandom"
version = "0.3.0"
Expand Down Expand Up @@ -265,15 +258,6 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"

[[package]]
name = "jobserver"
version = "0.1.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0"
dependencies = [
"libc",
]

[[package]]
name = "libc"
version = "0.2.155"
Expand All @@ -282,9 +266,9 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"

[[package]]
name = "libfuzzer-sys"
version = "0.4.10"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5037190e1f70cbeef565bd267599242926f724d3b8a9f510fd7e0b540cfa4404"
checksum = "86c975d637bc2a2f99440932b731491fc34c7f785d239e38af3addd3c2fd0e46"
dependencies = [
"arbitrary",
"cc",
Expand Down Expand Up @@ -411,12 +395,6 @@ dependencies = [
"serde",
]

[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"

[[package]]
name = "standard_test"
version = "0.1.0"
Expand Down
Loading
Loading