Crates.io | xcm-simulator-fuzzer |
lib.rs | xcm-simulator-fuzzer |
version | 1.0.0 |
source | src |
created_at | 2023-06-20 14:16:41.205993 |
updated_at | 2023-08-08 10:02:25.450528 |
description | Examples of xcm-simulator usage. |
homepage | |
repository | |
max_upload_size | |
id | 895173 |
size | 132,464 |
This project will fuzz-test the XCM simulator. It can catch reachable panics, timeouts as well as integer overflows and underflows.
cargo install honggfuzz
In this directory, run this command:
cargo hfuzz run xcm-fuzzer
In this directory, run this command:
cargo hfuzz run-debug xcm-fuzzer hfuzz_workspace/xcm-fuzzer/fuzzer_input_file
In this directory, run these four commands:
RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" CARGO_INCREMENTAL=0 SKIP_WASM_BUILD=1 CARGO_HOME=./cargo cargo build
../../../target/debug/xcm-fuzzer hfuzz_workspace/xcm-fuzzer/input/
zip -0 ccov.zip `find ../../../target/ \( -name "*.gc*" -o -name "test-*.gc*" \) -print`
grcov ccov.zip -s ../../../ -t html --llvm --branch --ignore-not-existing -o ./coverage
The code coverage will be in ./coverage/index.html
.