Skip to content

Commit

Permalink
Mirror the private repo
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgar2017 committed Mar 11, 2024
1 parent 650488b commit 17ddc9d
Show file tree
Hide file tree
Showing 258 changed files with 5,309 additions and 2,508 deletions.
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug report
about: Use this template for reporting issues
title: ''
labels: bug
assignees: ''
---

### 🐛 Bug Report

#### 📝 Description

Provide a clear and concise description of the bug.

#### 🔄 Reproduction Steps

Steps to reproduce the behaviour

#### 🤔 Expected Behavior

Describe what you expected to happen.

#### 😯 Current Behavior

Describe what actually happened.

#### 🖥️ Environment

Any relevant environment details.

#### 📋 Additional Context

Add any other context about the problem here. If applicable, add screenshots to help explain.

#### 📎 Log Output

```
Paste any relevant log output here.
```
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Feature request
about: Use this template for requesting features
title: ''
labels: feat
assignees: ''
---

### 🌟 Feature Request

#### 📝 Description

Provide a clear and concise description of the feature you'd like to see.

#### 🤔 Rationale

Explain why this feature is important and how it benefits the project.

#### 📋 Additional Context

Add any other context or information about the feature request here.
20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# What ❔

<!-- What are the changes this PR brings about? -->
<!-- Example: This PR adds a PR template to the repo. -->
<!-- (For bigger PRs adding more context is appreciated) -->

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `cargo fmt` and checked with `cargo clippy`.
202 changes: 202 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
name: Benchmarking

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
benchmarks_candidate:
runs-on: [matterlabs-ci-runner]
container:
image: matterlabs/llvm_runner:latest
credentials:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
options: -m 110g
steps:
- uses: AutoModality/action-clean@492b2d2e2e77247bfd0b17eaa89a371b2f3430ee # v1
- name: Preparing workspace. Setting environment.
run: |
echo "BENCHMARK_MODE=${{ github.event.inputs.compiler_llvm_benchmark_mode || '^M^B3' }}" >> $GITHUB_ENV
echo "BENCHMARK_PATH=${{ github.event.inputs.compiler_llvm_benchmark_path || '' }}" >> $GITHUB_ENV
echo "CANDIDATE_BRANCH_NAME=${{ github.event.inputs.compiler_tester_candidate_branch }}" >> $GITHUB_ENV
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_BASE_REF} | tr / -)" >> $GITHUB_ENV

- name: Preparing workspace. Checkout compiler-tester candidate (pull request)
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
submodules: recursive
path: compiler-tester

- name: Preparing workspace. Checkout compiler-tester candidate (workflow dispatch)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
path: compiler-tester
submodules: recursive
ref: ${{ env.CANDIDATE_BRANCH_NAME }}

- name: Testing. Benchmarking LLVM framework candidate.
id: compiler_tester_run
run: |
cd compiler-tester
cargo install compiler-llvm-builder
/usr/local/cargo/bin/zkevm-llvm clone && /usr/local/cargo/bin/zkevm-llvm build
export RUST_BACKTRACE='full'
export LLVM_SYS_150_PREFIX="$(pwd)/target-llvm/target-final/"
cargo build --verbose --release --bin 'compiler-tester'
cargo build --verbose --release --manifest-path /usr/local/cargo/git/checkouts/era-compiler-solidity-*/*/Cargo.toml --target-dir './target-zksolc/'
cargo build --verbose --release --manifest-path /usr/local/cargo/git/checkouts/era-compiler-vyper-*/*/Cargo.toml --target-dir './target-zkvyper/'
./target/release/compiler-tester \
--zksolc './target-zksolc/release/zksolc' \
--zkvyper './target-zkvyper/release/zkvyper' \
--path=${{ env.BENCHMARK_PATH || '' }} \
--mode=${{ env.BENCHMARK_MODE || '' }} \
--benchmark='candidate.json'
- uses: actions/upload-artifact@v4
with:
name: candidate-benchmark
path: compiler-tester/candidate.json

benchmarks_reference:
runs-on: [matterlabs-ci-runner]
container:
image: matterlabs/llvm_runner:latest
credentials:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
options: -m 110g
steps:
- uses: AutoModality/action-clean@492b2d2e2e77247bfd0b17eaa89a371b2f3430ee # v1
- name: Preparing workspace. Setting environment.
run: |
echo "BENCHMARK_MODE=${{ github.event.inputs.compiler_llvm_benchmark_mode || '^M^B3' }}" >> $GITHUB_ENV
echo "BENCHMARK_PATH=${{ github.event.inputs.compiler_llvm_benchmark_path || '' }}" >> $GITHUB_ENV
echo "REFERENCE_BRANCH_NAME=${{ github.event.inputs.compiler_tester_reference_branch }}" >> $GITHUB_ENV
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_BASE_REF} | tr / -)" >> $GITHUB_ENV

- name: Preparing workspace. Checkout compiler-tester reference (pull request)
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
path: compiler-tester
submodules: recursive
ref: ${{ env.BRANCH_NAME }}

- name: Preparing workspace. Checkout compiler-tester reference (workflow dispatch)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
path: compiler-tester
submodules: recursive
ref: ${{ env.REFERENCE_BRANCH_NAME }}

- name: Testing. Benchmarking LLVM framework reference.
id: compiler_tester_run
run: |
cd compiler-tester
cargo install compiler-llvm-builder
/usr/local/cargo/bin/zkevm-llvm clone && /usr/local/cargo/bin/zkevm-llvm build
export RUST_BACKTRACE='full'
export LLVM_SYS_150_PREFIX="$(pwd)/target-llvm/target-final/"
cargo build --verbose --release --bin 'compiler-tester'
cargo build --verbose --release --manifest-path /usr/local/cargo/git/checkouts/era-compiler-solidity-*/*/Cargo.toml --target-dir './target-zksolc/'
cargo build --verbose --release --manifest-path /usr/local/cargo/git/checkouts/era-compiler-vyper-*/*/Cargo.toml --target-dir './target-zkvyper/'
./target/release/compiler-tester \
--zksolc './target-zksolc/release/zksolc' \
--zkvyper './target-zkvyper/release/zkvyper' \
--path=${{ env.BENCHMARK_PATH || '' }} \
--mode=${{ env.BENCHMARK_MODE || '' }} \
--benchmark='reference.json'
- uses: actions/upload-artifact@v4
with:
name: reference-benchmark
path: compiler-tester/reference.json

benchmarks_analysis:
runs-on: [matterlabs-ci-runner]
needs: [benchmarks_candidate, benchmarks_reference]
container:
image: matterlabs/llvm_runner:latest
credentials:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
- uses: AutoModality/action-clean@492b2d2e2e77247bfd0b17eaa89a371b2f3430ee # v1
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_BASE_REF} | tr / -)" >> $GITHUB_ENV

- name: Preparing workspace. Checkout compiler-tester candidate (pull request)
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
path: compiler-tester
submodules: recursive

- name: Preparing workspace. Checkout compiler-tester candidate (workflow dispatch)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
path: compiler-tester
ref: ${{ env.CANDIDATE_BRANCH_NAME }}

- uses: actions/download-artifact@v4
with:
name: candidate-benchmark
path: compiler-tester

- uses: actions/download-artifact@v4
with:
name: reference-benchmark
path: compiler-tester

- name: Testing. Comparing LLVM framework results.
id: compiler_tester_run
run: |
cd compiler-tester && \
export RUST_BACKTRACE=full && \
cargo run --release --bin benchmark-analyzer -- --reference reference.json --candidate candidate.json --output-file result.txt && \
chown 1000:1000 result.txt
- name: Testing. Posting LLVM benchmark results to step summary.
run: |
printf "Benchmark results:\n" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat ./compiler-tester/result.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat $GITHUB_STEP_SUMMARY > ./compiler-tester/result.txt
- name: Testing. Posting LLVM benchmark results to PR comment.
if: github.event_name == 'pull_request'
uses: mshick/add-pr-comment@v2
with:
message-path: ./compiler-tester/result.txt

- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,commit,author,action,eventName,ref,workflow,job,took,pullRequest # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.COMPILER_CI_MATTERMOST_WEBHOOK }} # required
if: ${{ failure() || success() }} # Skip canceled jobs

8 changes: 8 additions & 0 deletions .github/workflows/cargo-license.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Cargo license check
on: pull_request
jobs:
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: EmbarkStudios/cargo-deny-action@1e59595bed8fc55c969333d08d7817b36888f0c5 # v1.5.5
17 changes: 17 additions & 0 deletions .github/workflows/secrets_scanner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Leaked Secrets Scan
on: [pull_request]
jobs:
TruffleHog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@11394ea318a12a5bf99c1b0cb7ba5e44b3c7a79c # v3.63.2
with:
path: ./
base: ${{ github.event.repository.default_branch }}
head: HEAD
extra_args: --debug --only-verified
56 changes: 56 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Testing

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
testing:
runs-on: [self-hosted, ci-runner-compiler]
timeout-minutes: 720
container:
image: matterlabs/llvm_runner:latest
credentials:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
options: -m 110g
steps:
# Add safe.directory per https://github.com/actions/checkout/issues/766
- name: Setting all dirs as safe safe.directory
run: |
git config --system --add safe.directory '*'
git config --global --add safe.directory '*'
- name: Preparing workspace. Checkout compiler-tester repository.
uses: actions/checkout@v4
with:
path: compiler-tester
submodules: recursive

- name: Testing. Building and running compiler tester.
id: compiler_tester_run
run: |
cd compiler-tester
cargo install compiler-llvm-builder
/usr/local/cargo/bin/zkevm-llvm clone && /usr/local/cargo/bin/zkevm-llvm build
export RUST_BACKTRACE='full'
export LLVM_SYS_150_PREFIX="$(pwd)/target-llvm/target-final/"
cargo build --verbose --release --bin 'compiler-tester'
cargo build --verbose --release --manifest-path /usr/local/cargo/git/checkouts/era-compiler-solidity-*/*/Cargo.toml --target-dir './target-zksolc/'
cargo build --verbose --release --manifest-path /usr/local/cargo/git/checkouts/era-compiler-vyper-*/*/Cargo.toml --target-dir './target-zkvyper/'
./target/release/compiler-tester \
--zksolc './target-zksolc/release/zksolc' \
--zkvyper './target-zkvyper/release/zkvyper'
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,commit,author,action,eventName,ref,workflow,job,took,pullRequest # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.COMPILER_CI_MATTERMOST_WEBHOOK }} # required
if: ${{ failure() || success() }} # Skip canceled jobs
Loading

0 comments on commit 17ddc9d

Please sign in to comment.