This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Improve XCM fuzzer #6190
Merged
paritytech-processbot
merged 10 commits into
paritytech:master
from
louismerlin:lm-xcm-fuzzer
Feb 23, 2023
Merged
Improve XCM fuzzer #6190
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a187289
Add improved XCM fuzzer
louismerlin 1d10c56
Add command for running a single input
louismerlin 79abd73
Add installation command
louismerlin e0891e4
Fix @m-cat's nit
louismerlin 5860cef
Add newline
KiChjang 4b0b980
Add info about current directory in fuzzing README
louismerlin 6612bca
Update Cargo.lock
louismerlin 8b3d120
Merge branch 'lm-xcm-fuzzer' of github.com:louismerlin/polkadot into …
louismerlin 19a33d5
Merge branch 'master' of github.com:paritytech/polkadot into lm-xcm-f…
louismerlin 9bfca31
Merge branch 'master' of github.com:paritytech/polkadot into lm-xcm-f…
louismerlin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| hfuzz_target | ||
| hfuzz_workspace | ||
| cargo | ||
| coverage | ||
| ccov.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # XCM Simulator Fuzzer | ||
|
|
||
| This project will fuzz-test the XCM simulator. It can catch reachable panics, timeouts as well as integer overflows and underflows. | ||
|
|
||
| ## Install dependencies | ||
|
|
||
| ``` | ||
| cargo install honggfuzz | ||
| ``` | ||
|
|
||
| ## Run the fuzzer | ||
|
|
||
| ``` | ||
| cargo hfuzz run xcm-fuzzer | ||
| ``` | ||
|
|
||
| ## Run a single input | ||
|
|
||
| ``` | ||
| cargo hfuzz run-debug xcm-fuzzer hfuzz_workspace/xcm-fuzzer/fuzzer_input_file | ||
| ``` | ||
|
|
||
| ## Generate coverage | ||
|
|
||
| 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`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.