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

0.8.0 #213

Merged
merged 24 commits into from
Oct 21, 2024
Merged

0.8.0 #213

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6a6f9b9
📝 Update docs
lukacan Aug 14, 2024
7554f95
:bug: updating gitignore by adding a new line #186
hetdagli234 Aug 11, 2024
65f5f22
Handling both EOF and EOL cases
hetdagli234 Aug 15, 2024
6d29943
📝 Update docs structure, design
lukacan Aug 20, 2024
732a5b6
📝 Add recording to docs
lukacan Aug 28, 2024
f509399
⚡️ Instead of creating our own IDL try to use the anchors
lukacan Aug 22, 2024
a504298
✨ Add possibility to add account to the genesis from base64 data
lukacan Sep 8, 2024
c91dcfc
🔥 Say goodbye to the PoC Tests support with anchor-client
lukacan Sep 12, 2024
a7724d1
🚀 Add program id tied to each generated instruction
lukacan Sep 13, 2024
08db9ea
✨ Improve IDL parsing logic with possibility to mix instructions from…
lukacan Sep 13, 2024
3570ac7
📝 Update documentation, removed integration tests and better describe…
lukacan Sep 14, 2024
2aea3a5
🚀 Config is read at start of fuzzing session + transaction processing…
lukacan Sep 29, 2024
2038be1
💚 Pipelines revision
lukacan Oct 3, 2024
ef3cd9f
✨ Introduce AFL support
lukacan Sep 22, 2024
daa9645
🔥 Load genesis programs and accounts using Trident manifest
lukacan Oct 6, 2024
10b4f5d
🔥 AFL Integration - continue
lukacan Oct 9, 2024
0c53db2
🚸 Improve UX
lukacan Oct 9, 2024
c1793f0
🚸 Improve ux during init, fenerate required parts in packages automat…
lukacan Oct 11, 2024
e54ad4e
🔧 Allow empty AccountsSnapshots
lukacan Oct 13, 2024
2ee53fc
🔖 Update changelog
lukacan Oct 13, 2024
fb37072
✨ Review updates + minor versions updates
lukacan Oct 18, 2024
99cdeb5
🔥 Disable afl commands
lukacan Oct 21, 2024
b2f7bb4
🔒️ Update examples
lukacan Oct 21, 2024
72f4ab1
🔖 Bump versions
lukacan Oct 21, 2024
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
9 changes: 9 additions & 0 deletions .github/actions/setup-afl/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: "Setup AFL"

runs:
using: "composite"
steps:
# Install AFL using Cargo
- name: Install AFL
run: cargo install cargo-afl --version ${{ env.AFL_VERSION }} # Install the specified version of AFL via Cargo
shell: bash
16 changes: 0 additions & 16 deletions .github/actions/setup-anchor/action.yml

This file was deleted.

25 changes: 9 additions & 16 deletions .github/actions/setup-honggfuzz/action.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
name: "Setup Honggfuzz"
description: "Setup Honggfuzz"

runs:
using: "composite"
steps:
- uses: actions/cache@v3
name: Cache Honggfuzz
id: cache-honggfuzz
with:
path: |
~/.cache/honggfuzz/
~/.local/share/honggfuzz/
key: honggfuzz-${{ runner.os }}-v0000-${{ env.HONGGFUZZ_VERSION }}
- name: Install honggfuzz
run: cargo install honggfuzz --version ${{ env.HONGGFUZZ_VERSION }}
# Install system dependencies required by Honggfuzz
- name: Install Dependencies (binutils-dev & libunwind-dev)
run: |
sudo apt-get update # Update the system package lists
sudo apt-get install -y binutils-dev libunwind-dev # Install binutils-dev and libunwind-dev, which are required for fuzzing
shell: bash
- name: Install binutils-dev
run: sudo apt-get install binutils-dev
shell: bash
- name: Install libunwind-dev
run: sudo apt-get install libunwind-dev

# Install Honggfuzz using Cargo
- name: Install Honggfuzz
run: cargo install honggfuzz --version ${{ env.HONGGFUZZ_VERSION }} # Install the specified version of Honggfuzz via Cargo
shell: bash
25 changes: 11 additions & 14 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
name: "Setup Rust"
description: "Setup Rust"

outputs:
rustc-hash:
description: "Hash of the rustc version"
value: ${{ steps.rust-version.outputs.RUSTC_HASH }}

runs:
using: "composite"
steps:
# Install essential system packages required for building Rust projects
- name: Install system packages
run: sudo apt-fast update && sudo apt-fast install -y build-essential libudev-dev
run: sudo apt-get update && sudo apt-get install -y build-essential libudev-dev # Installs essential packages like GCC and libudev development headers
shell: bash
- name: Install Rust nightly

# Install Rust nightly toolchain and additional components
# Ensure rustfmt and clippy are installed for the nightly toolchain as well
- name: Install Rust Toolchain Components
run: |
rustup default nightly
rustup install nightly
rustup component add rustfmt clippy
rustup component add rustfmt clippy --toolchain nightly
shell: bash

# Install Cargo Expand for expanding macros in Rust, useful for debugging macro-generated code
- name: Install Cargo Expand
run: cargo install --locked cargo-expand
shell: bash
- name: Get rustc version
id: rust-version
run: echo "::set-output name=RUSTC_HASH::$(rustc -V | cut -d " " -f 3 | tail -c +2)"
run: cargo install --locked cargo-expand # Installs the cargo-expand tool, using --locked to ensure exact versions from Cargo.lock are used
shell: bash
22 changes: 0 additions & 22 deletions .github/actions/setup-solana/action.yml

This file was deleted.

11 changes: 2 additions & 9 deletions .github/actions/setup-trident/action.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
name: "Setup Trident"
description: "Setup Trident"

runs:
# This setup does not use caching, so it always installs Trident fresh
using: "composite"
steps:
- uses: actions/cache@v3
name: Cache Trident
id: cache-trident
with:
path: |
~/.cache/trident/
~/.local/share/trident/
key: trident-${{ runner.os }}-v0000
# Install Trident from the local crates/cli directory
- name: Install Trident
run: cargo install --path crates/cli
shell: bash
1 change: 0 additions & 1 deletion .github/workflows/build-documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
push:
branches:
- develop
- master

jobs:
build:
Expand Down
159 changes: 159 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: Test Fuzz Tests

on:
workflow_dispatch:
pull_request: # Workflow can be triggered by either a manual dispatch or a pull request

env:
HONGGFUZZ_VERSION: 0.5.56 # Honggfuzz version to install in the environment
AFL_VERSION: 0.15.10 # AFL version to install in the environment


jobs:
Fuzz-Tests:
name: Fuzz Tests
runs-on: ubuntu-20.04
steps:
- run: echo "Starting Fuzz Tests"

simple-cpi-6:
name: Fuzz Tests (simple-cpi-6)
needs: Fuzz-Tests
# Runs on an Ubuntu 20.04 runner
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
name: Checkout Repository # Checkout the repository to get access to the project files

# https://github.com/Swatinem/rust-cache
- name: Cache Rust and its Packages
# Caches Rust dependencies to avoid redundant downloads and speed up builds
uses: Swatinem/rust-cache@v2
with:
prefix-key: "fuzz"
shared-key: "trident-rust-cache" # Using a shared cache key for multiple jobs

- name: Setup Rust Environment
# Sets up the Rust environment (e.g., installing Rust and required components)
uses: ./.github/actions/setup-rust/

- name: Install Trident
# Sets up the Trident
uses: ./.github/actions/setup-trident/

- name: Setup AFL
# Sets up AFL, a fuzzing tool that will be used by Trident
uses: ./.github/actions/setup-afl/

- name: Setup Honggfuzz
# Sets up Honggfuzz, a fuzzing tool that will be used by Trident
uses: ./.github/actions/setup-honggfuzz/

# Cache the target folder, which stores the build artifacts generated by the fuzzing process
- name: Cache Target Folder
uses: actions/cache@v3
with:
path: examples/fuzz-tests/simple-cpi-6/trident-tests/fuzz_tests/fuzzing/honggfuzz/hfuzz_target # Cache the folder where build artifacts are stored
key: target-${{ runner.os }}-simple-cpi-6 # Unique key for caching based on OS and test

# Run the fuzzing test using Trident in the simple-cpi-6 directory
- name: Test Fuzz
working-directory: examples/fuzz-tests/simple-cpi-6 # Set the working directory for the fuzzing test
run: trident fuzz run-hfuzz fuzz_0 # Run the fuzz test with trident

arbitrary-limit-inputs-5:
name: Fuzz Tests (arbitrary-limit-inputs-5)
needs: Fuzz-Tests
# Runs on an Ubuntu 20.04 runner for a different fuzz test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
name: Checkout Repository # Checkout the repository

# https://github.com/Swatinem/rust-cache
- name: Cache Rust and its Packages
# Caches Rust dependencies to avoid redundant downloads and speed up builds
uses: Swatinem/rust-cache@v2
with:
prefix-key: "fuzz" # Using a locally shared cache key
shared-key: "trident-rust-cache" # Using a shared cache key for multiple jobs

- name: Setup Rust Environment
# Sets up the Rust environment (e.g., installing Rust and required components)
uses: ./.github/actions/setup-rust/

- name: Install Trident
# Sets up the Trident
uses: ./.github/actions/setup-trident/

- name: Setup AFL
# Sets up AFL, a fuzzing tool that will be used by Trident
uses: ./.github/actions/setup-afl/

- name: Setup Honggfuzz
# Sets up Honggfuzz, a fuzzing tool that will be used by Trident
uses: ./.github/actions/setup-honggfuzz/

# Cache the target folder, which stores the build artifacts generated by the fuzzing process
- name: Cache Target Folder
uses: actions/cache@v3
with:
path: examples/fuzz-tests/arbitrary-limit-inputs-5/trident-tests/fuzz_tests/fuzzing/honggfuzz/hfuzz_target # Cache the folder where build artifacts are stored
key: target-${{ runner.os }}-arbitrary-limit-inputs-5 # Unique key for caching based on OS and test

# Run the fuzzing test using Trident in the arbitrary-limit-inputs-5 directory
- name: Test Fuzz
working-directory: examples/fuzz-tests/arbitrary-limit-inputs-5 # Set the working directory for the fuzzing test
run: trident fuzz run-hfuzz fuzz_0 # Run the fuzz test with trident

cpi-metaplex-7:
name: Fuzz Tests (cpi-metaplex-7)
needs: Fuzz-Tests
# Runs on an Ubuntu 20.04 runner for a different fuzz test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
name: Checkout Repository # Checkout the repository

# https://github.com/Swatinem/rust-cache
- name: Cache Rust and its Packages
# Caches Rust dependencies to avoid redundant downloads and speed up builds
uses: Swatinem/rust-cache@v2
with:
prefix-key: "fuzz" # Using a locally shared cache key
shared-key: "trident-rust-cache" # Using a shared cache key for multiple jobs

- name: Setup Rust Environment
# Sets up the Rust environment (e.g., installing Rust and required components)
uses: ./.github/actions/setup-rust/

- name: Install Trident
# Sets up the Trident
uses: ./.github/actions/setup-trident/

- name: Setup AFL
# Sets up AFL, a fuzzing tool that will be used by Trident
uses: ./.github/actions/setup-afl/

- name: Setup Honggfuzz
# Sets up Honggfuzz, a fuzzing tool that will be used by Trident
uses: ./.github/actions/setup-honggfuzz/

# Cache the target folder, which stores the build artifacts generated by the fuzzing process
- name: Cache Target Folder
uses: actions/cache@v3
with:
path: examples/fuzz-tests/cpi-metaplex-7/trident-tests/fuzz_tests/fuzzing/honggfuzz/hfuzz_target # Cache the folder where build artifacts are stored
key: target-${{ runner.os }}-cpi-metaplex-7 # Unique key for caching based on OS and test

# Run the fuzzing test using Trident in the cpi-metaplex-7 directory
- name: Test Fuzz
working-directory: examples/fuzz-tests/cpi-metaplex-7 # Set the working directory for the fuzzing test
run: trident fuzz run-hfuzz fuzz_0 # Run the fuzz test with trident

checks:
name: Fuzz Tests (Checks)
needs: [simple-cpi-6, arbitrary-limit-inputs-5,cpi-metaplex-7]
runs-on: ubuntu-20.04
steps:
- run: echo "All fuzz tests completed successfully"
Loading
Loading