Skip to content

Commit

Permalink
Zk EVM Mirror from latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jpnovais committed Aug 22, 2023
0 parents commit c45c5d9
Show file tree
Hide file tree
Showing 1,155 changed files with 275,481 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
max_line_length=120
insert_final_newline = true
trim_trailing_whitespace = true

[*.go]
indent_style = tab
indent_size = tab

# line bellow should be like "[*.{kt,kts}]" if your editor adds spaces, it will break...
# https://github.com/pinterest/ktlint#intellij-idea-editorconfig-autoformat-issue
# [*.{kt,kts}]
# possible values: number (e.g. 2), "unset" (makes ktlint ignore indentation completely)
# indent_size=2
# insert_final_newline=true # true (recommended) / false
# possible values: number (e.g. 120) (package name, imports & comments are ignored), "off"
# it's automatically set to 100 on `ktlint --android ...` (per Android Kotlin Style Guide)
# max_line_length=120
28 changes: 28 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Set the default behavior, in case people don't have core.autocrlf set.
* text eol=lf

/gradlew -text
*.md -text
*.jar -text
*.bat -text
*.pcap binary
*.blocks binary
*.dll binary
*.dylib binary
*.so binary
*.gz binary
*.ssz binary
*.ssz_snappy binary

prover/docker/setup/full/proving_key.bin binary
prover/docker/setup/full/verifying_key.bin binary
prover/docker/setup/full/circuit.bin binary
prover/docker/setup/full/sample-proof.bin binary

prover/docker/setup/light/proving_key.bin binary
prover/docker/setup/light/verifying_key.bin binary
prover/docker/setup/light/circuit.bin binary
prover/docker/setup/light/sample-proof.bin binary
71 changes: 71 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main" ]

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'go', 'java', 'javascript', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
182 changes: 182 additions & 0 deletions .github/workflows/coordinator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
name: Coordinator CI
on:
push:
workflow_dispatch:
inputs:
coverage:
description: To generate test report
required: false
type: boolean
default: false
e2e-tests-with-ssh:
description: Run end to end tests with ability to ssh into environment
required: false
type: boolean
default: false
e2e-tests-logs-dump:
description: Dump logs after running end to end tests
required: false
type: boolean
default: false

jobs:
changes:
runs-on: ubuntu-latest
name: Filter commit changes
outputs:
coordinator: ${{ steps.filter.outputs.coordinator }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Filter commit changes
uses: dorny/paths-filter@v2
id: filter
with:
base: ${{ github.ref }}
list-files: "json"
filters: |
coordinator:
- 'coordinator/**'
- 'testdata/**'
- 'buildSrc/**'
- 'jvm-libs/**'
- 'gradle/**'
- 'build.gradle'
- 'gradle.properties'
- 'settings.gradle'
- '.github/workflows/coordinator.yml'
- '.github/workflows/reuse-*.yml'
- 'config/common/traces-limits-v1.toml'
- 'config/coordinator/**'
- 'e2e/**'
store_image_name_and_tags:
uses: ./.github/workflows/reuse-store-image-name-and-tags.yml
with:
image_name: consensys/linea-coordinator

check_image_tags_exist:
needs: [ changes, store_image_name_and_tags ]
if: ${{ needs.changes.outputs.coordinator == 'false' }}
uses: ./.github/workflows/reuse-check-image-tags-exist.yml
with:
last_commit_tag: ${{ needs.store_image_name_and_tags.outputs.last_commit_tag }}
common_ancestor_tag: ${{ needs.store_image_name_and_tags.outputs.common_ancestor_tag }}
image_name: ${{ needs.store_image_name_and_tags.outputs.image_name }}
secrets: inherit

coordinator-tag-only:
needs: [ changes, store_image_name_and_tags, check_image_tags_exist ]
if: ${{ needs.changes.outputs.coordinator == 'false' }}
uses: ./.github/workflows/reuse-image-tag-push.yml
with:
commit_tag: ${{ needs.store_image_name_and_tags.outputs.commit_tag }}
last_commit_tag: ${{ needs.store_image_name_and_tags.outputs.last_commit_tag }}
common_ancestor_tag: ${{ needs.store_image_name_and_tags.outputs.common_ancestor_tag }}
develop_tag: ${{ needs.store_image_name_and_tags.outputs.develop_tag }}
untested_tag_suffix: ${{ needs.store_image_name_and_tags.outputs.untested_tag_suffix }}
image_name: ${{ needs.store_image_name_and_tags.outputs.image_name }}
last_commit_tag_exists: ${{ needs.check_image_tags_exist.outputs.last_commit_tag_exists }}
common_ancestor_commit_tag_exists: ${{ needs.check_image_tags_exist.outputs.common_ancestor_commit_tag_exists }}
secrets: inherit

run-tests:
needs: [ changes, store_image_name_and_tags, coordinator-tag-only ]
if: ${{ always() && (needs.changes.outputs.coordinator == 'true' || needs.coordinator-tag-only.result != 'success' || needs.coordinator-tag-only.outputs.image_tagged != 'true') }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- uses: actions/setup-node@v3
with:
node-version: 18.15.0
cache-dependency-path: contracts/package-lock.json
- name: Npm install
working-directory: contracts
run: npm ci --no-audit
- name: Install gradle
uses: gradle/gradle-build-action@v2
- name: Run tests
uses: nick-fields/retry@v2
with:
max_attempts: 3
retry_on: error
timeout_minutes: 20
command: |
./gradlew coordinator:app:buildNeeded ${{ inputs.coverage && 'check jacocoRootReport' || '' }} --no-daemon
build-and-publish:
needs: [ changes, store_image_name_and_tags, coordinator-tag-only ]
if: ${{ always() && (needs.changes.outputs.coordinator == 'true' || needs.coordinator-tag-only.result != 'success' || needs.coordinator-tag-only.outputs.image_tagged != 'true') }}
runs-on: ubuntu-22.04
env:
COMMIT_TAG: ${{ needs.store_image_name_and_tags.outputs.commit_tag }}
DEVELOP_TAG: ${{ needs.store_image_name_and_tags.outputs.develop_tag }}
UNTESTED_TAG_SUFFIX: ${{ needs.store_image_name_and_tags.outputs.untested_tag_suffix }}
IMAGE_NAME: ${{ needs.store_image_name_and_tags.outputs.image_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- uses: actions/setup-node@v3
with:
node-version: 18.15.0
cache-dependency-path: contracts/package-lock.json
- name: Install gradle
uses: gradle/gradle-build-action@v2
- name: Build dist
run: |
./gradlew coordinator:app:shadowJar --no-daemon
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: coordinator
uses: docker/metadata-action@v3
with:
images: ${{ env.IMAGE_NAME }}
- name: Build & push
uses: docker/build-push-action@v4
with:
context: .
build-contexts: jar=./coordinator/app/build/libs/
file: ./coordinator/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ env.COMMIT_TAG }}-${{ env.UNTESTED_TAG_SUFFIX }}
run-e2e-tests:
needs: [ changes, store_image_name_and_tags, build-and-publish ]
if: ${{ always() && (needs.changes.outputs.coordinator == 'true' || needs.build-and-publish.result == 'success') }}
uses: ./.github/workflows/reuse-run-e2e-tests.yml
with:
commit_tag: ${{ needs.store_image_name_and_tags.outputs.commit_tag }}
untested_tag_suffix: ${{ needs.store_image_name_and_tags.outputs.untested_tag_suffix }}
e2e-tests-with-ssh: ${{ false && inputs.e2e-tests-with-ssh }}
e2e-tests-logs-dump: ${{ false && inputs.e2e-tests-logs-dump }}
secrets: inherit

tag-after-run-tests-success:
needs: [ store_image_name_and_tags, run-tests, run-e2e-tests ]
if: ${{ always() && needs.run-tests.result == 'success' && needs.run-e2e-tests.outputs.tests_outcome == 'success' }}
uses: ./.github/workflows/reuse-tag-without-untested-suffix.yml
with:
commit_tag: ${{ needs.store_image_name_and_tags.outputs.commit_tag }}
develop_tag: ${{ needs.store_image_name_and_tags.outputs.develop_tag }}
untested_tag_suffix: ${{ needs.store_image_name_and_tags.outputs.untested_tag_suffix }}
image_name: ${{ needs.store_image_name_and_tags.outputs.image_name }}
secrets: inherit
Loading

0 comments on commit c45c5d9

Please sign in to comment.