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

feat: add fuzzing #651

Merged
merged 25 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1703c78
macro docs improvements
neysofu Jul 13, 2023
6a281a5
wip
neysofu Jul 13, 2023
46be88a
fuzz experiments
neysofu Jul 13, 2023
1407eb9
macro errors
neysofu Jul 13, 2023
f4d015b
wip
neysofu Jul 14, 2023
1731b5a
Merge branch 'nightly' into filippo/fuzzing
vlopes11 Aug 12, 2023
df46f43
add fuzz makefile & docs
vlopes11 Aug 16, 2023
6c52b42
add generative fuzz for account module implementation
vlopes11 Aug 16, 2023
b400c85
Merge branch 'nightly' into vlopes11/feature/fuzzing
vlopes11 Aug 16, 2023
c56d519
fix statemap arbitrary generation
vlopes11 Aug 16, 2023
3c10fd5
fix lint nits
vlopes11 Aug 16, 2023
72deb23
Merge branch 'nightly' into vlopes11/feature/fuzzing
vlopes11 Aug 21, 2023
23636e7
rollback aligned vec assertion for tests
vlopes11 Aug 21, 2023
aff2d44
Merge branch 'nightly' into vlopes11/feature/fuzzing
vlopes11 Aug 21, 2023
9e50a48
fix native requirement for arbitrary implementation
vlopes11 Aug 21, 2023
337f40e
Merge branch 'nightly' into vlopes11/feature/fuzzing
vlopes11 Aug 22, 2023
4e6b761
fix arbitrary workset to use genesis
vlopes11 Aug 24, 2023
2f8aa50
Merge branch 'nightly' into vlopes11/feature/fuzzing
vlopes11 Aug 24, 2023
d8d0dbe
fix merge generated errors
vlopes11 Aug 25, 2023
8a2c0dc
Merge branch 'nightly' into vlopes11/feature/fuzzing
vlopes11 Aug 25, 2023
a293ec7
Merge branch 'nightly' into vlopes11/feature/fuzzing
vlopes11 Aug 25, 2023
a90ccf6
Merge branch 'nightly' into vlopes11/feature/fuzzing
vlopes11 Aug 25, 2023
cc2b7b6
remove cargo.lock from fuzz directory
vlopes11 Aug 28, 2023
7583a91
Merge branch 'nightly' into vlopes11/feature/fuzzing
vlopes11 Aug 28, 2023
087172d
Merge branch 'nightly' into vlopes11/feature/fuzzing
vlopes11 Aug 29, 2023
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.idea/

target/
fuzz/Cargo.lock

.DS_Store

Expand Down
23 changes: 23 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jmt = { git = "https://github.com/penumbra-zone/jmt", commit = "46b4b00" }
# External dependencies
async-trait = "0.1.71"
anyhow = "1.0.68"
arbitrary = { version = "1.3.0", features = ["derive"] }
borsh = { version = "0.10.3", features = ["rc", "bytes"] }
# TODO: Consider replacing this serialization format
# https://github.com/Sovereign-Labs/sovereign-sdk/issues/283
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ lint-fix: ## cargo fmt, fix and clippy
cargo fix --allow-dirty
cargo clippy --fix --allow-dirty

check-features: ## Checks that project compiles with all combinations of features
check-features: check-fuzz ## Checks that project compiles with all combinations of features
cargo hack --feature-powerset check

check-fuzz: ## Checks that fuzz member compiles
$(MAKE) -C fuzz check

find-unused-deps: ## Prints unused dependencies for project. Note: requires nightly
cargo udeps --all-targets --all-features

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ to have adapters for almost all Data Availability Layers and LLVM-compatible pro
maintain adapters for [`Risc0`](https://www.risczero.com) (a ZKVM) and [`Celestia`](https://www.celestia.org) a (DA layer).
The Avail project also maintains an adapter for their DA layer, which can be found [here](https://github.com/availproject/avail-sovereign-da-adapter).

## Testing

An implementation of LLVM's libFUZZER is available under [fuzz/README.md](./fuzz/README.md).
neysofu marked this conversation as resolved.
Show resolved Hide resolved

## Warning

The Sovereign SDK is Alpha software. It has not been audited and should not be used in production under any circumstances.
Expand Down
5 changes: 5 additions & 0 deletions adapters/celestia/src/shares.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ impl std::error::Error for ShareParsingError {}
impl NamespaceGroup {
pub fn from_b64(b64: &str) -> Result<Self, ShareParsingError> {
let mut decoded = Vec::with_capacity((b64.len() + 3) / 4 * 3);
if b64.is_empty() {
error!("Empty input");
return Err(ShareParsingError::ErrWrongLength);
}

neysofu marked this conversation as resolved.
Show resolved Hide resolved
// unsafe { decoded.set_len((b64.len() / 4 * 3)) }
if let Err(err) = B64_ENGINE.decode_slice(b64, &mut decoded) {
info!("Error decoding NamespaceGroup from base64: {}", err);
Expand Down
Loading