Skip to content

Commit

Permalink
Merge pull request #1 from worldcoin/devnet
Browse files Browse the repository at this point in the history
Devnet
  • Loading branch information
0xKitsune authored Sep 5, 2024
2 parents 7ab8b9a + 949dc24 commit f422e29
Show file tree
Hide file tree
Showing 48 changed files with 3,922 additions and 0 deletions.
37 changes: 37 additions & 0 deletions devnet/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

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

# This is the top-most .editorconfig file (do not search in parent directories)
root = true

# 4 space indentation for all starlark files
[*.star]
indent_style = space
indent_size = 4

# 4 space indentation for all python files
[*.py]

# 2 space indentation for all yaml files
[*.yml, *.yaml]
indent_style = space
indent_size = 2

# 2 space indentation for all json files
[*.json]
indent_style = space
indent_size = 2

[*.yaml]
indent_style = space
indent_size = 2
7 changes: 7 additions & 0 deletions devnet/.github/tests/blockscout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
optimism_package:
- participants:
- el_type: op-geth
network_params:
name: op-rollup-one
additional_services:
- blockscout
15 changes: 15 additions & 0 deletions devnet/.github/tests/helder-op.yaml_norun
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
optimism_package:
participants:
- el_type: op-geth
additional_services:
- blockscout
ethereum_package:
participants:
- el_type: nethermind
network_params:
network: helder-devnet-0
devnet_repo: commit-boost
checkpoint_sync_enabled: true
checkpoint_sync_url: https://bn.bootnode.helder-devnets.xyz
additional_services:
- dora
10 changes: 10 additions & 0 deletions devnet/.github/tests/hildr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
optimism_package:
participants:
- el_type: op-geth
cl_type: op-node
- el_type: op-geth
cl_type: hildr
- el_type: op-reth
cl_type: hildr
- el_type: op-erigon
cl_type: hildr
7 changes: 7 additions & 0 deletions devnet/.github/tests/multiple_l2s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
optimism_package:
- network_params:
name: op-rollup-one
network_id: '3151909'
- network_params:
name: op-rollup-two
network_id: '3151910'
4 changes: 4 additions & 0 deletions devnet/.github/tests/op-besu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
optimism_package:
participants:
- el_type: op-besu
cl_type: op-node
4 changes: 4 additions & 0 deletions devnet/.github/tests/op-erigon.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
optimism_package:
participants:
- el_type: op-erigon
cl_type: op-node
4 changes: 4 additions & 0 deletions devnet/.github/tests/op-geth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
optimism_package:
participants:
- el_type: op-geth
cl_type: op-node
5 changes: 5 additions & 0 deletions devnet/.github/tests/op-nethermind.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
optimism_package:
participants:
- el_type: op-geth
- el_type: op-nethermind
cl_type: op-node
10 changes: 10 additions & 0 deletions devnet/.github/tests/op-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
optimism_package:
participants:
- el_type: op-geth
cl_type: op-node
- el_type: op-reth
cl_type: op-node
- el_type: op-erigon
cl_type: op-node
- el_type: op-nethermind
cl_type: op-node
4 changes: 4 additions & 0 deletions devnet/.github/tests/op-reth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
optimism_package:
participants:
- el_type: op-reth
cl_type: op-node
3 changes: 3 additions & 0 deletions devnet/.github/tests/single_l2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
optimism_package:
participants:
- count: 2
22 changes: 22 additions & 0 deletions devnet/.github/workflows/conventional-pr-title-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Check PR title for conventional commits
name: Check PR title
on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize

# cancel redundant builds
concurrency:
group: "title-checker-${{ github.head_ref }}"
cancel-in-progress: true

jobs:
title_check:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61 changes: 61 additions & 0 deletions devnet/.github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Nightly test Workflow

on:
schedule:
- cron: "0 2 * * *" # This schedules the workflow to run at 02:00 UTC every day
workflow_dispatch:

jobs:
list-yamls:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
# List all yaml files in the .github/tests directory, except for the k8s.yaml file
run: echo "matrix=$(ls ./.github/tests/*.yaml | grep -vE 'k8s.yaml$' | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
run_with_args:
needs: list-yamls
strategy:
matrix:
file_name: ${{ fromJson(needs.list-yamls.outputs.matrix) }}
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli
kurtosis analytics disable
- name: Run Starlark
run: |
if [ "${{ matrix.file_name }}" != "./.github/tests/mix-with-tools-mev.yaml" ]; then
kurtosis run ${{ github.workspace }} --verbosity detailed --args-file ${{ matrix.file_name }}
else
echo "Skipping ./.github/tests/mix-with-tools-mev.yaml"
fi
- name: Check if Discord Webhook is Set
id: check_discord_webhook
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
run: |
if [ -z "$DISCORD_WEBHOOK" ]; then
echo "discord_webhook_set=false" >> $GITHUB_ENV
else
echo "discord_webhook_set=true" >> $GITHUB_ENV
fi
- name: Notify
if: (cancelled() || failure()) && env.discord_webhook_set == 'true'
uses: Ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: "The nightly test for ${{matrix.file_name}} on optimism-package has failed find it here ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
48 changes: 48 additions & 0 deletions devnet/.github/workflows/per-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
pull_request:

concurrency:
group: "tests-${{ github.head_ref }}"
cancel-in-progress: true

jobs:
run_with_args:
strategy:
matrix:
file_name:
[
"./network_params.yaml"
]
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli
kurtosis analytics disable
- name: Run Starlark
run: kurtosis run ${{ github.workspace }} --args-file ${{ matrix.file_name }} --verbosity detailed

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli
kurtosis analytics disable
- name: Kurtosis Lint
run: kurtosis lint ${{ github.workspace }}

21 changes: 21 additions & 0 deletions devnet/.github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: release-please

on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Run Release Please
uses: googleapis/release-please-action@v3
with:
token: ${{ secrets.PAT }}
release-type: simple
include-v-in-tag: false
package-name: optimism-package
67 changes: 67 additions & 0 deletions devnet/.github/workflows/run-k8s.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Run k8s test

on:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 2 * * *'

concurrency:
group: "scheduled-test"
cancel-in-progress: false

jobs:
run_k8s_test:
strategy:
matrix:
payload:
- { name: "single", file: "./.github/tests/single_l2.yaml" }
- { name: "network-params", file: "./network_params.yaml" }
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup minikube
id: minikube
uses: medyagh/setup-minikube@latest
- name: Get kubeconfig
id: kubeconfig
shell: bash
run: |
cat ~/.kube/config > kubeconfig
echo "kubeconfig=$(cat kubeconfig | base64 -w 0)" >> $GITHUB_OUTPUT
# run kurtosis test and assertoor
- name: Run kurtosis testnet
id: testnet
uses: ethpandaops/kurtosis-assertoor-github-action@v1
with:
kurtosis_extra_args: "--image-download always --non-blocking-tasks --verbosity DETAILED"
kurtosis_backend: "kubernetes"
kubernetes_config: "${{ steps.kubeconfig.outputs.kubeconfig }}"
kubernetes_cluster: "minikube"
kubernetes_storage_class: "standard"
ethereum_package_branch: ""
ethereum_package_args: "${{ matrix.payload.file }}"
ethereum_package_url: "$GITHUB_WORKSPACE"
enclave_name: "optimism-package-${{ matrix.payload.name }}-${{ github.run_id }}"
persistent_logs: "true"

- name: Check if Discord Webhook is Set
id: check_discord_webhook
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
run: |
if [ -z "$DISCORD_WEBHOOK" ]; then
echo "discord_webhook_set=false" >> $GITHUB_ENV
else
echo "discord_webhook_set=true" >> $GITHUB_ENV
fi
- name: Notify
if: (cancelled() || failure()) && env.discord_webhook_set == 'true'
uses: Ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: "The k8s nightly/per PR test for ${{matrix.payload.name}} on optimism-package has failed. Find it here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
Loading

0 comments on commit f422e29

Please sign in to comment.