Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
shouc committed Sep 25, 2023
2 parents d7b640d + 9051ae6 commit db15bc1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 122 deletions.
72 changes: 13 additions & 59 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,72 +10,26 @@ on:
env:
CARGO_TERM_COLOR: always
jobs:
start-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Start EC2 runner
id: start-ec2-runner
uses: fuzzland/ec2-github-runner@v2
with:
mode: start
pre-runner-script: |
source "/root/.cargo/env"
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
ec2-image-id: ami-0b5bc504b604fe97d
ec2-instance-type: c5d.12xlarge
subnet-id: subnet-0bdfed1a35eccc1fe
security-group-id: sg-088af6a76c47f0e45
aws-resource-tags: |
[
{"Key": "Name", "Value": "ec2-github-runner"},
{"Key": "GitHubRepository", "Value": "${{ github.repository }}"}
]
build:
needs: start-runner
runs-on: ${{ needs.start-runner.outputs.label }}
runs-on: [self-hosted, integration-xl]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Setup Home
run: export HOME="/root"
- name: Download and Extract Cache
run: curl -L https://github.com/fuzzland/ityfuzz-test-cache/releases/latest/download/cache.tar.gz -o cache.tar.gz && tar -xzf cache.tar.gz
- name: Build
run: export PATH="/root/.cargo/bin:$PATH" && echo $PATH && ls "/root/.cargo/bin" && cargo build --verbose
run: cargo build --verbose
- name: Run tests
run: export PATH="/root/.cargo/bin:$PATH" && cargo test --verbose
- name: Run integration tests
run: export PATH="/root/.cargo/bin:$PATH" && NO_TELEMETRY=1 python3 integration_test.py
stop-runner:
name: Stop self-hosted EC2 runner
needs:
- start-runner
- build
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Stop EC2 runner
uses: fuzzland/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
run: cargo test --verbose
- name: Run integration tests (Offchain)
run: NO_TELEMETRY=1 python3 integration_test.py offchain
- name: Run integration tests (Onchain)
run: NO_TELEMETRY=1 python3 integration_test.py onchain
- name: Report onchain tests
env:
BOT_GH_TOKEN: ${{ secrets.BOT_GH_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
run: echo "PR=$PR_NUMBER" && python3 ci.py

3 changes: 1 addition & 2 deletions cli/src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ enum EVMTargetType {
Config
}

pub fn evm_main(args: EvmArgs) {
ityfuzz::telemetry::report_campaign(args.onchain, args.target.clone());
pub fn evm_main(args: EvmArgs) {
let mut target_type: EVMTargetType = match args.target_type {
Some(v) => match v.as_str() {
"glob" => EVMTargetType::Glob,
Expand Down
8 changes: 0 additions & 8 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ pub fn init_sentry() {
release: sentry::release_name!(),
..Default::default()
}));
if let Ok(value) = env::var("NO_TELEMETRY") {
if value == "1" {
println!("Telemetry is disabled.");
unsafe {
ityfuzz::telemetry::TELEMETRY_ENABLED = false;
}
}
}
}

#[derive(Parser)]
Expand Down
4 changes: 0 additions & 4 deletions src/fuzzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ use crate::evm::vm::EVMState;
use crate::input::ConciseSerde;
use crate::oracle::BugMetadata;
use crate::scheduler::{HasReportCorpus, HasVote};
use crate::telemetry::report_vulnerability;

const STATS_TIMEOUT_DEFAULT: Duration = Duration::from_millis(100);
pub static mut RUN_FOREVER: bool = false;
Expand Down Expand Up @@ -516,9 +515,6 @@ where
}
// find the solution
ExecuteInputResult::Solution => {
report_vulnerability(
unsafe {serde_json::to_string(&ORACLE_OUTPUT).expect("")},
);

println!("\n\n\n😊😊 Found violations! \n\n");
let cur_report = format!(
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pub mod oracle;
pub mod scheduler;
pub mod state;
pub mod state_input;
pub mod telemetry;
pub mod tracer;
pub mod mutation_utils;

Expand Down
48 changes: 0 additions & 48 deletions src/telemetry.rs

This file was deleted.

0 comments on commit db15bc1

Please sign in to comment.