Merge rust-bitcoin/rust-bitcoin#1284: Import bitcoin hashes

9674bf29fe hashes: Fix clippy warnings (Tobin C. Harding)
b9643bf3e9 Import bitcoin_hashes crate into hashes (Tobin C. Harding)
580feab3f9 internals: Add CHANGELOG file (Tobin C. Harding)
bae64e156e Move CHANGELOG to bitcoin crate (Tobin C. Harding)
9a2c856be6 Update gitignore file (Tobin C. Harding)

Pull request description:

   was split out of this in an attempt to help review, I think we can merge this one though now it has some traction.

  We would like to bring the `bitcoin_hashes` crate into the `rust-bitcoin` repository. https://github.com/rust-bitcoin/rust-bitcoin/issues/550#issuecomment-1248071843

  Import `bitcoin_hashes` crate into `hashes`.

  Commit hash that was tip of `bitcoin_hashes` at time of import:

       commit 2a78c250f78d391599040223870a4d1d6f6f5482

  Please note the commit history of `bitcoin_hashes` is only preserved on the soon-to-be-archived `bitcoin_hashes` repository.

ACKs for top commit:
  sanket1729:
    ACK 9674bf29fe. Did my best to review the CI code, it looks good, and seems like we are testing everything when we add "hashes" to the root level `./contrib/tests.sh`. I would like other reviewers to confirm the same.
  apoelstra:
    ACK 9674bf29fe

Tree-SHA512: db3ce6adeb38430c5a9f372da16be9fb048c2e5cff646b701139fb4b5fa76e10261432284ede7fd139b75cd69bb124d55973ceb7eccaa996226a7be4cad9b68a
This commit is contained in:
Andrew Poelstra 2022-11-18 18:20:26 +00:00
commit 349a8a5b4e
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
501 changed files with 5981 additions and 17 deletions
.github/workflows
.gitignoreCargo.toml
bitcoin
CHANGELOG.md
embedded
fuzz
.gitignoreCargo.tomlcycle.sh
fuzz_targets
hfuzz_input
deserialize_address/input
18b6e222b04bbd45df9508b64b8e47d5.00000014.honggfuzz.cov2418838742eb837088ce87020b701357.0000000e.honggfuzz.cov4c268893957d293ecb031b7a493d5517.0000000b.honggfuzz.cov642cd2ab1075cc9dcbf11d4517132cff.0000000d.honggfuzz.cov733c9c9c9cb000002c9c9c9cc3100000.00000005.honggfuzz.cov804ca76c67dac27d3fa9842a5fbf0acb.00000012.honggfuzz.cova4611c9c91300000211c9c9194400000.00000005.honggfuzz.covc7b1f1e233cb62b7663a33abe7722ab8.0000000e.honggfuzz.covdddf9577343cbfd614aa48444fdc440d.0000000b.honggfuzz.covebdf1f0999769e0dd97c488f9e1629c3.0000000b.honggfuzz.covfea481ecdefcdebf030efcdefcc12454.00000008.honggfuzz.covid-000000_orig-15cad1ae8551b96348bc3115fa7ebe63.0000000e.honggfuzz.covid-000001_orig-215f74c65c586d0f6697654f73f1590f.0000001d.honggfuzz.covid-000002_orig-2cc7e6ae50991ecc4678fc57c3fec235.00000025.honggfuzz.covid-000003_orig-2ce88960000000005938fcb000000000.00000003.honggfuzz.covid-000006_orig-70b17afe56c3a7b354b7c3b6c80a2bb9.0000002b.honggfuzz.covid-000007_orig-728beb87e91000002957ebebb2a00000.00000005.honggfuzz.covid-000008_orig-2c9c9c9cb00000002c9c9c9cb0000000.00000004.honggfuzz.covid-000011_orig-9c3c1fb7a5a5a5a5a60c3c7aa5a5a5a5.0000000b.honggfuzz.covid-000013_orig-c5a6dff88d6d9cded749fcdd9d288fec.00000009.honggfuzz.covid-000014_orig-c609787c4d59cd6ad2d9fe413e542b60.000018a8.honggfuzz.covid-000016_orig-cedfa000000000005f6e800000000000.00000002.honggfuzz.covid-000017_orig-cfe7500000000000d79f300000000000.00000002.honggfuzz.covid-000018_orig-e9b51c311bb9ce0d748f29409e19cbbb.0000000b.honggfuzz.covid-000019_orig-7b300000000000007b30000000000000.00000001.honggfuzz.covid-000019_orig-eaaab62c6d65ea2889ce9e10f05d9924.0000000f.honggfuzz.covid-000021_orig-efa9a6552efcc1b41f947711ecde356c.0000000a.honggfuzz.covid-000022_orig-cb1917e940dd2cde31ebfc9d50d957a3.00000009.honggfuzz.covid-000025_orig-46367000000000004636700000000000.00000002.honggfuzz.covid-000026_orig-2b5a40ad2cdebf606f0efc9d201a4bc0.00000007.honggfuzz.covid-000028_orig-2cdf11c00000000071af4cb000000000.00000003.honggfuzz.covid-000028_orig-e3a0a0acdebf60006f0efc90a0638000.00000006.honggfuzz.covid-000029_orig-2ce927c00000000047994cb000000000.00000003.honggfuzz.covid-000029_orig-e4299c9c9c9c9c9ce4299c9c9c9c9c9c.00000009.honggfuzz.covid-000030_orig-37df2d30000000004d5f57b000000000.00000003.honggfuzz.covid-000031_orig-41736041414141414173604141414141.00000019.honggfuzz.covid-000032_orig-583f57782266bf0cf61b913df4fa7b99.00000011.honggfuzz.covid-000036_orig-d7796363633d2cde4deafc9d73636363.00000009.honggfuzz.covid-000039_orig-id-000033_src-000004_op-havoc_rep-2id-000040_orig-id-000034_src-000004_op-havoc_rep-2id-000041_orig-id-000034_src-000004_op-havoc_rep-64id-000043_orig-id-000042_src-000004_op-havoc_rep-2id-000044_orig-id-000042_src-000004_op-havoc_rep-64id-000045_orig-id-000044_src-000004_op-havoc_rep-4id-000046_orig-id-000045_src-000004_op-havoc_rep-2id-000046_src-000004_op-havoc_rep-2id-000047_src-000004+000012_op-splice_rep-2id-000058_sync-deserialize_address_0_src-000050id-000059_sync-deserialize_address_0_src-000057id-000062_sync-deserialize_address_0_src-000059id-000062_sync-deserialize_address_master_src-000062id-000063_sync-deserialize_address_master_src-000044id-000064_sync-deserialize_address_0_src-000044id-000064_sync-deserialize_address_0_src-000060id-000065_sync-deserialize_address_master_src-000067id-000068_src-000004_op-flip1_pos-3id-000069_src-000004_op-flip2_pos-3id-000069_src-000050_op-havoc_rep-8id-000070_src-000050_op-havoc_rep-4id-000070_sync-deserialize_address_0_src-000062id-000071_src-000050_op-havoc_rep-2id-000072_src-000004_op-havoc_rep-64id-000072_src-000051_op-flip2_pos-22id-000074_src-000004_op-havoc_rep-2id-000074_sync-deserialize_address_0_src-000064id-000075_src-000004_op-havoc_rep-64id-000075_sync-deserialize_address_0_src-000049id-000076_src-000061_op-havoc_rep-8id-000077_src-000006_op-flip1_pos-30id-000077_sync-deserialize_address_0_src-000043id-000080_src-000006_op-havoc_rep-2id-000082_src-000010_op-havoc_rep-4id-000090_src-000081_op-havoc_rep-2
deserialize_block/input

View File

@ -29,7 +29,7 @@ jobs:
override: true
profile: minimal
- name: fuzz
run: cd fuzz && ./travis-fuzz.sh "${{ matrix.fuzz_target }}"
run: cd bitcoin/fuzz && ./travis-fuzz.sh "${{ matrix.fuzz_target }}"
- run: echo "${{ matrix.fuzz_target }}.rs" >executed_${{ matrix.fuzz_target }}
- uses: actions/upload-artifact@v2
with:
@ -46,5 +46,5 @@ jobs:
- name: Display structure of downloaded files
run: ls -R
- run: find executed_* -type f -exec cat {} + | sort > executed
- run: ls fuzz/fuzz_targets | sort > expected
- run: ls bitcoin/fuzz/fuzz_targets | sort > expected
- run: diff expected executed

View File

@ -16,6 +16,8 @@ jobs:
DO_LINT: true
AS_DEPENDENCY: true
DO_NO_STD: true
DO_FEATURE_MATRIX: true # Currently only used in hashes crate.
DO_SCHEMARS_TESTS: true # Currently only used in hashes crate.
- rust: beta
env:
AS_DEPENDENCY: true
@ -89,6 +91,9 @@ jobs:
Embedded:
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-C link-arg=-Tlink.x"
CARGO_TARGET_THUMBV7M_NONE_EABI_RUNNER: "qemu-system-arm -cpu cortex-m3 -machine mps2-an385 -nographic -semihosting-config enable=on,target=native -kernel"
steps:
- name: Checkout
uses: actions/checkout@v2
@ -102,8 +107,44 @@ jobs:
override: true
components: rust-src
target: thumbv7m-none-eabi
- name: Run
- name: Run bitcoin/embedded
run: cd bitcoin/embedded && cargo run --target thumbv7m-none-eabi
- name: Run hashes/embedded no alloc
run: cd hashes/embedded && cargo run --target thumbv7m-none-eabi
- name: Run hashes/embedded with alloc
run: cd hashes/embedded && cargo run --target thumbv7m-none-eabi --features=alloc
ASAN:
name: Address sanitizer # hashes crate only.
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v2
- name: Checkout Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rust-src
- name: Running address sanitizer
env:
RUSTFLAGS: "-C link-arg=-Tlink.x"
CARGO_TARGET_THUMBV7M_NONE_EABI_RUNNER: "qemu-system-arm -cpu cortex-m3 -machine mps2-an385 -nographic -semihosting-config enable=on,target=native -kernel"
run: cd embedded && cargo run --target thumbv7m-none-eabi
DO_ASAN: true
run: ./hashes/contrib/test.sh
WASM:
name: WebAssembly Build # hashes crate only.
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v2
- name: Checkout Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Running WASM build
env:
DO_WASM: true
run: ./hashes/contrib/test.sh

27
.gitignore vendored
View File

@ -1,7 +1,22 @@
target
Cargo.lock
dep_test
# .gitignore for rust-bitcoin repository workspace.
#fuzz
fuzz/hfuzz_target
fuzz/hfuzz_workspace
# Lock files
Cargo.lock
internals/Cargo.lock
bitcoin/Cargo.lock
hashes/Cargo.lock
# Build artifacts
target
internals/target
bitcoin/target
hashes/target
# Test artifacts
bitcoin/dep_test
# Fuzz artifacts
bitcoin/fuzz/hfuzz_target
bitcoin/fuzz/hfuzz_workspace
hashes/fuzz/hfuzz_target
hashes/fuzz/hfuzz_workspace

View File

@ -1,3 +1,2 @@
[workspace]
members = ["bitcoin", "internals"]
exclude = ["embedded", "fuzz"]
members = ["bitcoin", "hashes", "internals"]

View File

@ -5,13 +5,17 @@ readme = "README.md"
name = "embedded"
version = "0.1.0"
# Prevent this from interfering with workspaces
[workspace]
members = ["."]
[dependencies]
cortex-m = "0.6.0"
cortex-m-rt = "0.6.10"
cortex-m-semihosting = "0.3.3"
panic-halt = "0.2.0"
alloc-cortex-m = "0.4.1"
bitcoin = { path="../bitcoin", default-features = false, features = ["no-std", "secp-lowmemory"] }
bitcoin = { path="../", default-features = false, features = ["no-std", "secp-lowmemory"] }
[[bin]]
name = "embedded"

View File

@ -14,7 +14,7 @@ honggfuzz_fuzz = ["honggfuzz"]
[dependencies]
honggfuzz = { version = "0.5", optional = true, default-features = false }
afl = { version = "0.4", optional = true }
bitcoin = { path = "../bitcoin" }
bitcoin = { path = "../" }
# Prevent this from interfering with workspaces
[workspace]

Some files were not shown because too many files have changed in this diff Show More