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

🔥 Remove fuzzing flag #176

Merged
merged 3 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 20 additions & 4 deletions .github/workflows/run_fuzz_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ on:
pull_request:

env:
SOLANA_CLI_VERSION: 1.18.12
ANCHOR_VERSION: 0.29.0
HONGGFUZZ_VERSION: 0.5.55
SOLANA_CLI_VERSION: 1.18.17
HONGGFUZZ_VERSION: 0.5.56

jobs:
run_fuzz_example:
unchecked-arithmetic-0:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set Anchor Version
run: echo "ANCHOR_VERSION=0.29.0" >> $GITHUB_ENV
- uses: ./.github/actions/setup-rust/
- uses: ./.github/actions/setup-solana/
- uses: ./.github/actions/setup-honggfuzz/
Expand All @@ -23,3 +24,18 @@ jobs:
- name: Test Fuzz
working-directory: examples/fuzz-tests/unchecked-arithmetic-0
run: cargo run --manifest-path ../../../Cargo.toml fuzz run fuzz_0
arbitrary-limit-inputs-5:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set Anchor Version
run: echo "ANCHOR_VERSION=0.30.1" >> $GITHUB_ENV
- uses: ./.github/actions/setup-rust/
- uses: ./.github/actions/setup-solana/
- uses: ./.github/actions/setup-honggfuzz/
id: rust-setup
- uses: Swatinem/rust-cache@v2
name: Cache Rust and it's packages
- name: Test Fuzz
working-directory: examples/fuzz-tests/arbitrary-limit-inputs-5
run: cargo run --manifest-path ../../../Cargo.toml fuzz run fuzz_0
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
incremented upon a breaking change and the patch version will be incremented for features.

## [dev] - Unreleased
- del/remove unnecessary fuzzing feature as trident is mainly fuzzer ([#176](https://github.com/Ackee-Blockchain/trident/pull/176))
- feat/fuzzing moved to separate crate trident-fuzz ([#175](https://github.com/Ackee-Blockchain/trident/pull/175))
- feat/unify dependencies provided by the Trident ([#172](https://github.com/Ackee-Blockchain/trident/pull/172))
- fix/in case of fuzzing failure throw error instead of only printing message ([#167](https://github.com/Ackee-Blockchain/trident/pull/167))
Expand Down
53 changes: 44 additions & 9 deletions Cargo.lock

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

32 changes: 18 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@ resolver = "1"

[workspace.dependencies]
# ANCHOR
anchor-client = { version = ">=0.29.0" }
anchor-syn = { version = ">=0.29.0" }
anchor-spl = { version = ">=0.29.0" }
anchor-lang = { version = ">=0.29.0" }
anchor-client = ">=0.29.0"
anchor-syn = ">=0.29.0"
anchor-spl = ">=0.29.0"
anchor-lang = ">=0.29.0"


# SOLANA
solana-sdk = "1.16"
solana-cli-output = "1.16"
solana-transaction-status = "1.16"
solana-account-decoder = "1.16"
solana-program = "1.16"
solana-banks-client = "1.16"
solana-program-runtime = "1.16"
solana-program-test = "1.16"
spl-token = "4.0.0"
spl-associated-token-account = "2.0.0"
solana-sdk = "1.17.4"
solana-cli-output = "1.17.4"
solana-transaction-status = "1.17.4"
solana-account-decoder = "1.17.4"
solana-program = "1.17.4"
solana-banks-client = "1.17.4"
solana-program-runtime = "1.17.4"
solana-program-test = "1.17.4"
spl-associated-token-account = { version = "3.0.2", features = [
"no-entrypoint",
] }
spl-token = { version = "4.0.0", features = ["no-entrypoint"] }
13 changes: 5 additions & 8 deletions crates/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ license-file = "../../LICENSE"
readme = "../../README.md"
description = "The trident_client crate helps you build and deploy an Anchor program to a local cluster and run a test suite against it."

[features]
fuzzing = ["dep:solana-program-test", "dep:honggfuzz", "quinn-proto/arbitrary"]

[build-dependencies]
anyhow = { version = "1.0.45", features = ["std"], default-features = false }

Expand All @@ -27,8 +24,8 @@ trident-fuzz = { path = "../fuzz", version = "0.1.0" }
# ANCHOR
# INFO: Anchor-spl is here as dependency only to activate the idl-build feature, so that
# users do not have to do it manually in their program's Cargo.toml
anchor-spl = { workspace = true, features = ["idl-build"] }
anchor-lang = { workspace = true, features = ["idl-build", "init-if-needed"] }
anchor-spl = { workspace = true }
anchor-lang = { workspace = true, features = ["init-if-needed"] }
anchor-syn = { workspace = true }
anchor-client = { workspace = true, features = ["async"] }

Expand All @@ -39,11 +36,11 @@ solana-transaction-status = { workspace = true }
solana-account-decoder = { workspace = true }
spl-token = { workspace = true }
spl-associated-token-account = { workspace = true }
solana-program-test = { workspace = true, optional = true }
solana-program-test = { workspace = true }


# HONGGFUZZ
honggfuzz = { version = "0.5.55", optional = true }
honggfuzz = { version = "0.5.55" }
# ARBITRARY
arbitrary = { version = "1.3.0", features = ["derive"] }

Expand All @@ -69,7 +66,7 @@ toml = { version = "0.5.8", features = ["preserve_order"] }
log = "0.4"
rstest = "0.18.1"
proc-macro2 = { version = "1.0.66", default-features = false }
quinn-proto = { version = "0.10.6", optional = true }
quinn-proto = { version = "0.10.6", features = ["arbitrary"] }
pathdiff = "0.2.1"
indicatif = "0.17.8"
regex = "1.10.3"
1 change: 0 additions & 1 deletion crates/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//! Trident could be useful for writing Rust dApps, too.

/// Aimed for the fuzz tests
#[cfg(feature = "fuzzing")]
pub mod fuzzing {
/// anchor_lang
pub use anchor_lang;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ edition = "2021"
# Dependencies specific to Fuzz test
[dependencies]
# ... your dependencies here
honggfuzz = "0.5.55"
honggfuzz = "0.5.56"
arbitrary = "1.3.0"
assert_matches = "1.4.0"


[dependencies.trident-client]
version = "0.6.0"
features=["fuzzing"]
2 changes: 1 addition & 1 deletion crates/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ solana-program-runtime = { workspace = true }
solana-program-test = { workspace = true }

# ANCHOR
anchor-lang = { workspace = true, features = ["idl-build", "init-if-needed"] }
anchor-lang = { workspace = true, features = ["init-if-needed"] }
anchor-syn = { workspace = true }


Expand Down
1 change: 0 additions & 1 deletion crates/fuzz/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ pub mod accounts_storage;
pub mod data_builder;
pub mod error;
pub mod fuzzing_stats;
// #[cfg(feature = "fuzzing")]
pub mod program_test_client_blocking;
pub mod snapshot;
pub type AccountId = u8;
Loading
Loading