-
Notifications
You must be signed in to change notification settings - Fork 36
feat: add initial fuzz testing #271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: add initial fuzz testing #271
Conversation
Pull Request Test Coverage Report for Build 16808127177Details
💛 - Coveralls |
31f422f
to
2b885dc
Compare
Could you include the rationale for having a separate crate for fuzzing? Is it because we need to use nightly cargo? |
Rather than requiring use of |
1166295
to
8422bc6
Compare
8422bc6
to
f309e1d
Compare
f309e1d
to
3b70fa6
Compare
- creates a new `fuzz` crate, it's meant to run fuzz testing over bdk_wallet targets, with `cargo fuzz` (libFuzzer). - creates an initial `wallet_update` fuzz target for `bdk_wallet`. - creates an initial `fuzzed_data_provider` and `fuzz_utils` files with useful methods to consume the fuzzed data into `bdk_wallet` API-specific types.
- renames the fuzz target to `bdk_wallet`. - add the `WalletAction` enum, in order to fuzz test different behaviors: wallet update, persistance/load, and tx creation. - use macros (e.g `try_consume_*`) in `fuzzed_data_provider` and `fuzz_utils` in order to properly handle an exhausted fuzzer byte stream, returning early. - update `Wallet::ApplyUpdate` target to use the newly added macros.
- update `bdk_wallet_fuzz` to use `rusqlite` feature. - update the created wallet in `bdk_wallet` fuzz target to use an in-memory sqlite database connection, initializing wallet with persistance. - add the `PersistAndLoad` scenario to `bdk_wallet` fuzz target.
- add the `CreateTx` scenario to `bdk_wallet` fuzz target. - add two new macros: `try_consume_tx_builder` and `try_consume_sign_options`, in order to build the specific structures and types required for tx creation, signing and applying to wallet.
- adds a new daily CI fuzz job, it runs every day at 5am UTC and uploads the artifacts on failures. - it currently only uses the `cargo fuzz`, as it's the only supported harness at the moment.
47ecc5f
to
7f1fa74
Compare
Description
It's an initial work towards the goal of #61, it adds a new
fuzz
crate to the project which is meant to be used to add new fuzz target in order to increase the fuzz coverage.It's built on top of and with inspiration from previous Antoine's work through the most recent BDK Audit.
So far, this PR:
fuzz
crate withcargo fuzz
relying on LibFuzzer engine.Update
toWallet
.fuzzed_data_provider
andfuzz_utils
with common used fns to build BDK's-specific types from fuzzed bytes.Still to be done by this PR:
Notes to the reviewers
Are there any other BDK usage scenarios you'd like to see covered by a fuzz target ? Let's discuss it either on the issue or under this PR comments.
Changelog notice
TBD
Checklists
All Submissions:
just p
before pushing