Commit Graph

41 Commits

Author SHA1 Message Date
Andrew Poelstra 86eda8feee
Merge rust-bitcoin/rust-bitcoin#1511: Run kani daily on a schedule
3372333865 Add a kani badge to the README (Tobin C. Harding)
3d2a62fdd5 Run kani daily on a schedule (Tobin C. Harding)

Pull request description:

  Running kani takes ages, instead of running it on every pull request we can just run it daily.

ACKs for top commit:
  sanket1729:
    ACK 3372333865
  apoelstra:
    ACK 3372333865

Tree-SHA512: 63f71155eb3f2dd9bfbc3733c407c80b59a019d356127efc6d65cf53b517f15ddd8afd92d89f968734a508882eabbf720757d95c04d688438b762bb55a22f601
2022-12-30 15:25:52 +00:00
Andrew Poelstra bd7ae6d5e9
Merge rust-bitcoin/rust-bitcoin#1509: Use dtonlnay instead of actions-rs
4201612837 Use dtonlnay instead of actions-rs (Tobin C. Harding)

Pull request description:

  Done on top of #1508

  Currently we use the `actions-rs` GitHub action to run our tests. It seems the project is now unmaintained [0].

  Well known Rust developer dtonlnay maintains a GitHub action that can be used instead.

  Replace all uses of `actions-rs/toolchain` with `dtonlnay/rust-toolchain`. Note that with the new action there is no way to configure the toolchain, instead a different `uses` statement is required - this means we have to split our jobs up by toolchain. This is arguably cleaner anyways.

  Note that with this patch applied the "no-std" tests are now _not_ run for MSRV since we explicitly support "no-std" only for the 1.47 and above toolchains - strange that this was working?

  [0] https://github.com/actions-rs/toolchain/issues/216

ACKs for top commit:
  sanket1729:
    ACK 4201612837. Verified that we did not miss any checks in the translation.
  elichai:
    ACK 4201612837

Tree-SHA512: 117b35953c7e0d93ff1ea76fbff948d9a50aff9b3d0854beced540321f84eb83510af23067ff2ebc29b8d9c59b3ca205beeecde6e968bc619e21430b951f02cb
2022-12-30 14:31:42 +00:00
Tobin C. Harding 4201612837
Use dtonlnay instead of actions-rs
Currently we use the `actions-rs` GitHub action to run our tests. It
seems the project is now unmaintained [0].

Well known Rust developer dtonlnay maintains a GitHub action that can be
used instead.

Replace all uses of `actions-rs/toolchain` with
`dtonlnay/rust-toolchain`. Note that with the new action there is no way
to configure the toolchain, instead a different `uses` statement is
required - this means we have to split our jobs up by toolchain. This is
arguably cleaner anyways.

Note that with this patch applied the "no-std" tests are now _not_ run
for MSRV since we explicitly support "no-std" only for the 1.47 and
above toolchains - strange that this was working?

[0] https://github.com/actions-rs/toolchain/issues/216
2022-12-30 09:50:03 +11:00
Tobin C. Harding 3d2a62fdd5 Run kani daily on a schedule
Running kani takes ages, instead of running it on every pull request we
can just run it daily.
2022-12-29 16:23:59 +11:00
Tobin C. Harding 0aef1576fa Use cargo install cross `--locked`
`cross` currently fails to install, this has been reported already

https://github.com/cross-rs/cross/issues/1177

The workaround is to use `cargo install --locked`.
2022-12-28 11:28:37 +11:00
Martin Habovstiak 6acf9ac8b8 Patch hashes and update the code
This patches `bitcoin_hashes` to use the version in the repository and
fixes the code after removal of `Deref`.

This also turns off `AS_DEPENDENCY` check with the intention to refactor
it later.
2022-12-18 14:33:55 +01:00
Andrew Poelstra d4bfc3d7b1
github: add Kani to Github CI 2022-11-27 19:01:32 +00:00
Tobin C. Harding b9643bf3e9 Import bitcoin_hashes crate into hashes
We would like to bring the `bitcoin_hashes` crate into the
`rust-bitcoin` repository.

Import `bitcoin_hashes` into `rust-bitocin/hashes`, doing so looses all
the commit history from the original crate but if we archive the
original repository then the history will be preserved. We maintain the
same version number obviously and in the changelog we note the change of
repository.

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

 commit 54c16249e06cc6b7870c7fc07d90f489d82647c7

Includes making `embedded` and `fuzzing` per-crate i.e., move them into
`bitcoin` as hashes includes these also.

NOTE: Does _not_ enable fuzzing for `hashes` in CI.

Notes on CI:

Attempts to merge in the github actions from the hashes crate however reduces
coverage by not running hashes tests for beta toolchain. Some additional
work could be done to improve the CI to increase efficiency without
reducing coverage. Leaving for another day.
2022-11-08 08:58:09 +11:00
Tobin C. Harding cb9893c4a9 Add Target and Difficulty types
Currently we use the `Uint256` type to represent two proof of work
integers, namely target and difficulty (work).

It would be nice to not have a public integer type that is not fully
implemented (i.e., does not implement arithmetic etc as do integer types
in stdlib). Instead of implementing all the stdlib functions we can
instead add two new wrapper types, since these are not general purpose
integers they do not need to implement anything we do not need to use.

- Add a `pow` module.
- Put a modified version of `Uint256` to `pow`.
- Add two new wrapper types `Target` and `Difficulty`.
- Only implement methods that we use on each type.

Note this patch does not remove the original `Uint256`, that will be
done as a separate patch.
2022-09-28 04:16:59 +10:00
Tobin Harding b79c178ea8 Add fuzz test for PrefilledTransaction
Add a simple deserialization fuzz test for `PrefilledTransaction`.
2022-09-16 13:02:24 +10:00
Andrew Poelstra d25aba8ca0 fuzz: use travis-fuzz.sh in CI 2022-08-30 21:51:42 +00:00
Andrew Poelstra 407cbca111
fuzz: remove mysteriously-not-necessary quotes from gh action script 2022-08-30 20:42:28 +00:00
Andrew Poelstra 0a32525862
fuzz: disable features in honggfuzz 2022-08-30 20:42:28 +00:00
Andrew Poelstra c7910f4561
Revert "Temporarily disable fuzzing"
This reverts commit 720ea29865.
2022-08-30 20:42:28 +00:00
Tobin C. Harding 720ea29865 Temporarily disable fuzzing
Honggfuzz is broken, I have no idea why but no PRs can merge while its
broken.
2022-08-24 08:34:57 +10:00
Tobin C. Harding 74f3a5aeda Run clippy from the test script
Currently we run clippy in CI using a github action. The invocation has
a couple of shortcomings

1. it does not lint the tests (this requires `--all-targets`)
2. it does not lint the examples

I could not find a way to lint the examples without explicitly linting
each example by name.

Move the clippy control to `test.sh` and add an env var `DO_LINT` to
control it. Remove the explicit CI job and run the linter during the
`Test` job using the stable toolchain.
2022-07-26 08:48:15 +10:00
Tobin C. Harding 668b37af5c Enable clippy on CI
Add a clippy configuration file configuring the MSRV. Add a github
actions job to run clippy on CI.

Please note the job does _not_ use `--all-targets` because doing so
causes:
```
error[E0554]: `#![feature]` may not be used on the stable release channel
--> src/lib.rs:46:54
|
46 | #![cfg_attr(all(test, feature = "unstable"), feature(test))]
```
2022-06-23 14:07:02 +10:00
mcroad 7854bd7918
Fix `no_std` MSRV
Fixes #690, #947
2022-04-25 11:14:41 -05:00
Tobin C. Harding 15bae28b6b Remove CI check for Rust 1.29
In preparation for starting to merge patches that rely on an MSRV of
1.41 update the CI pipeline.
2022-04-22 07:41:39 +10:00
Tobin Harding 0d36455d74 Build the docs with test.sh
We currently build the docs as a separate CI job, we can however just do
it as part of the `Tests` job using the nightly toolchain.

Conditionally build the docs based on a `DO_DOCS` env var.

Note, uses `--cfg docsrs` so can only be built run with nightly toolchain.
2022-03-09 08:18:48 +11:00
sanket1729 8016a858f9 Tempararily pin fuzzer on rust 1.58
I think this might take a while to resolve and we should move ahead with
1.58. Looks like the fresh release of 1.59 added LLVM 13.0 that broke
some things.
2022-02-24 23:47:30 -08:00
Andrew Ahlers 006193f5b6 feat: Support running CI locally with `act`
Disable problematic jobs that involve Github Actions caching or `cross`
whenever the environment is set to ACT. This allows running the CI
pipeline locally and hopefully speeds up PR cycle times by reducing
unexpected CI pipeline results.
2022-02-17 21:11:30 +01:00
Dr Maxim Orlovsky f39b1300fa CI: do not fail fast 2022-01-11 16:10:29 +01:00
Riccardo Casatta 106acdc3ac
Add fuzzing for Witness struct 2021-12-28 09:56:41 +01:00
Dr. Maxim Orlovsky ff1ed818b1
Merge pull request #637 from devrandom/2021-08-no-std-cleanup
no-std cleanup
2021-11-12 20:39:16 +01:00
Martin Habovstiak 0e1b99359c Added fuzz test for `Script::bytes_to_asm_fmt`
This adds fuzz target for `Script::bytes_to_asm_fmt` which could
panic due to overflow in the past. Fuzzing should decrease the risk of
other panics.
2021-09-30 15:06:18 +02:00
Riccardo Casatta 2bbf63c7e0
Use stable toolchain for fuzzing 2021-09-27 20:04:14 +02:00
Riccardo Casatta 9b6b50a987
Drop fuzzing in rust workflow 2021-09-24 11:54:17 +02:00
Riccardo Casatta 1aefc1ccf3
In fuzzing add a final job verifying all the fuzz targets have been executed 2021-09-24 11:49:42 +02:00
Riccardo Casatta 3e310d3c26
execute fuzzing in separate ci workflow 2021-09-23 11:41:03 +02:00
Riccardo Casatta 9049eef700
Install deps only if needed for fuzzing 2021-09-23 11:41:01 +02:00
Martin Habovstiak f2042bd89a Add i686 to tested architectures
This adds i686 to CI which can help catching pointer-size-related bugs
such as the one addressed by #658.
2021-09-19 18:42:15 +02:00
Devrandom 206c648869 Clean up embedded test memory configuration 2021-08-02 22:09:14 +02:00
Andrew Poelstra df4d70a37e
Merge pull request #627 from RCasatta/bigendian
Bigendian fixes and CI test
2021-07-20 20:56:16 +00:00
Devrandom bba57d7d69 Embedded test via qemu 2021-07-15 09:04:49 +02:00
Devrandom 4826d0c6cc no_std support
Based on the original work by Justin Moon.

*MSRV unchanged from 1.29.0.*

When `std` is off, `no-std` must be on, and we use the [`alloc`](https://doc.rust-lang.org/alloc/) and core2 crates. The `alloc` crate requires the user define a global allocator.

* Import from `core` and `alloc` instead of `std`
* `alloc` only used if `no-std` is on
* Create `std` feature
* Create `no-std` feature which adds a core2 dependency to polyfill `std::io` features. This is an experimental feature and should be
used with caution.
* CI runs tests `no-std`
* MSRV for `no-std` is 1.51 or so
2021-07-15 09:04:49 +02:00
Riccardo Casatta 95460f5e3c
Add cross testing on big-endian architecture 2021-06-30 10:14:15 +02:00
Riccardo Casatta c58446f9c1
Deny broken doc intra-links and build docs in CI 2021-05-03 12:07:28 +02:00
Sebastian Geisler 7f2a7011a4 Don't fail CI if base image's apt db is outdated 2021-04-04 10:46:15 +02:00
Sebastian Geisler 9457e85069 move fuzzing from stable to nightly 2021-01-03 18:55:04 +01:00
Sebastian Geisler a1e96c398f Migrate CI to GitHub actions 2021-01-01 22:34:51 +01:00