A lightweight fuzz-like tool that sends prepared messages using the Fuzz Proto (V1) and collects statistics.
Picofuzz is designed to test Typeberry nodes by sending pre-prepared binary fuzz messages through socket communication. It establishes a handshake with the target node, processes binary files containing fuzz data, and measures response times while collecting statistics.
# Run directly with tsx
npx tsx index.ts [options] <directory> <socket>
# Using npm script
npm start [options] <directory> <socket>
# Using Docker
docker build -t picofuzz .
docker run picofuzz [options] <directory> <socket>-f, --flavour <spec>: JAM spec: tiny | full (default: tiny)-r, --repeat <count>: Number of repetitions (default: 1)-s, --stats <file>: Append aggregated stats to a CSV file-h, --help: Show help
<directory>: Directory containing .bin files with fuzz data<socket>: Socket path or address for communication with the target node
# Run picofuzz on data directory, connect to local socket, repeat 3 times
npm start -r 3 ./fuzz-data /tmp/typeberry.sock
# Run with full JAM spec and save stats to CSV
npm start -f full -s results.csv ./fuzz-data /tmp/typeberry.sock# Start typeberry fuzz target first.
npx @typeberry/jam fuzz-target
# Select and execute some tests (data is available via submodules)
npm start -r 3 ../picofuzz-stf-data/picofuzz-data/safrole /tmp/jam_target.sock- Handshake: Establishes connection with target node using PeerInfo exchange
- File Processing: Reads all .bin files from the specified directory
- Message Sending: For each file, decodes the message and sends it to the target
- Response Handling: Receives and decodes responses from the target node
- Statistics: Collects timing and success/failure statistics
- Reporting: Outputs comprehensive statistics at the end of the run
@typeberry/lib- Core typeberry protocol implementation
# Build the Docker image
docker build -t picofuzz .
# Run with mounted data directory
docker run -v /path/to/fuzz-data:/data picofuzz /data /tmp/socketPicofuzz tracks response times for each request
Statistics are printed at the end of each run for performance analysis and debugging.