Skip to content
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

test: Investigate Fuzzing #477

Merged
merged 50 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e3ca60b
ref: update PERMIT_TYPEHASH to explicit keccak call
0xNeshi Dec 23, 2024
8383d08
ci: refactor e2e-tests.sh to support more args
0xNeshi Dec 23, 2024
68c7309
ref: update all magic byte values into explicit calculations
0xNeshi Dec 23, 2024
61cb6ee
test: update motsu to version with fuzzer
0xNeshi Dec 23, 2024
0568ce0
docs: update ecdsa comment links
0xNeshi Dec 25, 2024
3b67222
test: use afl l version of motsu for fuzzing
0xNeshi Dec 25, 2024
26db2e0
ref: revert morsu to 0.2.1
0xNeshi Dec 26, 2024
3b98fa4
partial transition to libfuzzer
0xNeshi Jan 8, 2025
1000090
chore: merge with main
0xNeshi Jan 9, 2025
0d86a94
test: get fuzz tests working with lib/crypto
0xNeshi Jan 9, 2025
9e41b5c
ref: remove ./out
0xNeshi Jan 9, 2025
e8248be
ref: remove comments from e2e script
0xNeshi Jan 9, 2025
4e09e35
chore: revert changes to contracts
0xNeshi Jan 9, 2025
37e5d93
chore: revert changes to docs & examples
0xNeshi Jan 9, 2025
de60bf8
test: add openzeppelin_stylus::utils fuzz test (broken)
0xNeshi Jan 9, 2025
06a73e7
Merge branch 'main' into fuzz-lib-crypto
bidzyyys Jan 14, 2025
c8f8e75
ci: add fuzz workflow
0xNeshi Jan 15, 2025
ab84718
test: refactor merkle fuzz test
0xNeshi Jan 15, 2025
91040d5
test: add prop tests for keccak
0xNeshi Jan 15, 2025
3075679
test: add fuzz tests for keccak
0xNeshi Jan 15, 2025
73b25d1
Merge branch 'main' into fuzz-lib-crypto
0xNeshi Jan 15, 2025
00c9033
Merge branch 'main' into fuzz-lib-crypto
0xNeshi Jan 16, 2025
63c01ee
test: add additional keccakt proptests
0xNeshi Jan 20, 2025
eec7e5f
test: add more prop tests to keccak
0xNeshi Jan 20, 2025
cd4b0a5
test: bits
0xNeshi Jan 20, 2025
b3a74aa
test: refactor keccak tests
0xNeshi Jan 20, 2025
2d136ab
test: add empty_input_order_independence to keccak
0xNeshi Jan 20, 2025
301cd78
test: add prop tests for hash
0xNeshi Jan 20, 2025
a996ae0
test: add tests for merkle
0xNeshi Jan 20, 2025
fa82d29
test: fix single_leaf_equals_regular_verify + update previous prop tests
0xNeshi Jan 20, 2025
526cecd
ref: remove merkle.txt proptest regression
0xNeshi Jan 20, 2025
5819d3b
test: remove collision_resistance from merkle
0xNeshi Jan 21, 2025
4543562
test: remove length_extension_attack_resistance
0xNeshi Jan 21, 2025
2ba55b3
test: remove second_preimage_attack_resistance
0xNeshi Jan 21, 2025
9a52180
test: merge proof_consistency & multi_proof_consistency
0xNeshi Jan 21, 2025
78605dd
ref: set min proof len config in valid_merkle_proof
0xNeshi Jan 21, 2025
2caafa6
test: verify shortening the proof affects result + ref
0xNeshi Jan 21, 2025
def680b
test: remove pair_with_empty_hash from hash.rs
0xNeshi Jan 21, 2025
b67e6d0
ci: remove fuzz-tests.yml
0xNeshi Jan 21, 2025
17aecd9
docs: add 'running fuzz tests' section to GUIDELINES
0xNeshi Jan 21, 2025
cb2e229
docs: normalize CLI snippets in GUIDELINES
0xNeshi Jan 21, 2025
3515715
test: fix proof_consistency proof_flags len
0xNeshi Jan 21, 2025
7fb1887
ref: remove merkle proptest regression
0xNeshi Jan 21, 2025
9f32ca1
ref: update fuzz pkg name
0xNeshi Jan 21, 2025
9ef6799
ref: no_panics->does_not_panic
0xNeshi Jan 21, 2025
987769e
docs: update TODO comment
0xNeshi Jan 21, 2025
42bdb8b
docs: fix spelling
0xNeshi Jan 21, 2025
270ab40
Merge branch 'main' into fuzz-lib-crypto
0xNeshi Feb 5, 2025
904e8a1
ref(test): make each proptest standalone
0xNeshi Feb 5, 2025
ee69c65
ref: update bit tests (#525)
qalisander Feb 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ default-members = [
"examples/ecdsa",
"examples/poseidon",
]
exclude = ["fuzz"]

# Explicitly set the resolver to version 2, which is the default for packages
# with edition >= 2021.
Expand Down
33 changes: 29 additions & 4 deletions GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,19 +212,25 @@ Some other examples of automation are:

Always check your code with the linter (`clippy`), by running:

$ cargo clippy --tests --all-features
```shell
cargo clippy --tests --all-features
```

And make sure your code is formatted with, using:

$ cargo +nightly fmt
```shell
cargo +nightly fmt
```

Finally, ensure there is no trailing whitespace anywhere.

### Running tests

Make sure all tests are passing with:

$ cargo test --all-features
```shell
cargo test --all-features
```

### Running end-to-end tests

Expand All @@ -241,12 +247,31 @@ Then you will be able to run e2e tests:
./scripts/e2e-tests.sh
```

### Running fuzz tests

To run fuzz tests, you need to have [cargo-fuzz] installed.
Then from the root of the project you can use `cargo fuzz list` to view the list of all existing fuzz targets:

```shell
cargo fuzz list
```

Finally you need to run:

```shell
cargo fuzz run <fuzz target name>
```

[cargo-fuzz]: https://rust-fuzz.github.io/book/cargo-fuzz/setup.html

### Checking the docs

If you make documentation changes, you may want to check whether there are any
warnings or errors:

$ cargo doc --all-features
```shell
cargo doc --all-features
```

## Pull requests

Expand Down
4 changes: 4 additions & 0 deletions fuzz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target
corpus
artifacts
coverage
Loading