Skip to content

Commit

Permalink
docs: document the fuzz tests
Browse files Browse the repository at this point in the history
Signed-off-by: ljedrz <[email protected]>
  • Loading branch information
ljedrz committed Apr 7, 2022
1 parent 2638095 commit 0e5f8e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fuzz/fuzz_targets/deserialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ use libfuzzer_sys::fuzz_target;

use snarkos_environment::{network::Message, Client, CurrentNetwork};

// This fuzz target tests network message deserialization, including
// the deferred deserialization of the heavier objects.

// To start fuzzing, run `cargo +nightly fuzz run deserialization`.

fuzz_target!(|message: &[u8]| {
if let Ok(message) = Message::<CurrentNetwork, Client<CurrentNetwork>>::deserialize(message.into()) {
match message {
Expand Down
5 changes: 5 additions & 0 deletions fuzz/fuzz_targets/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ use bytes::BytesMut;
use snarkos_environment::{network::MessageCodec, Client, CurrentNetwork};
use tokio_util::codec::Decoder;

// This fuzz target tests network message buffering and decoding; it does NOT include
// the deferred deserialization of the heavier objects.

// To start fuzzing, run `cargo +nightly fuzz run network`.

fuzz_target!(|messages: Vec<&[u8]>| {
let mut codec = MessageCodec::<CurrentNetwork, Client<CurrentNetwork>>::default();

Expand Down

0 comments on commit 0e5f8e1

Please sign in to comment.