Skip to content
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
57 changes: 57 additions & 0 deletions .github/custom/local-testnet/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
network:
participants:
- el_type: geth
el_image: ethereum/client-go:v1.16.8
cl_type: lighthouse
cl_image: sigp/lighthouse:v8.0.1
validator_count: 10
count: 2
supernode: true

additional_services:
- assertoor

network_params:
# this is 'kurtosis' network ID, which is a default network. With this configuration CL /spec endpoint will return CONFIG_NAME=testnet
network_id: "3151908"
deneb_fork_epoch: 0
electra_fork_epoch: 0
fulu_fork_epoch: 0
perfect_peerdas_enabled: false

# 40 = 10 validators * 2(number of el/cl nodes) + 20 (running on SSV/Anchor nodes)
# aligns with validator_count configuration under participants section
preregistered_validator_count: 40
# NOTE: changes the number of slots in the epoch and potentially some other network settings.
# docs: https://github.com/ethpandaops/ethereum-package/blob/main/README.md#configuration
# Supported by Anchor.
#preset: minimal
seconds_per_slot: 6

port_publisher:
cl:
enabled: true

assertoor_params:
tests:
- https://gist.githubusercontent.com/lmnzx/13c4135052bc0f13f3f785010b3197e7/raw/e3ee98c97c54bfaa692640c917d8c6f362d03a4b/check_anchor_proposal.yaml


monitor:
enabled: false

nodes:
ssv:
count: 0
anchor:
count: 4

# Docker images configuration
images:
ssv: "ssv-node:v2.3.9"
anchor: "node/anchor:latest"
monitor: "monitor"
redis: "redis:7.4.2"
postgres: "postgres:15"
foundry: "localssv/ssv-network"

29 changes: 29 additions & 0 deletions .github/custom/local-testnet/test_anchor_proposal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
id: test_anchor_proposal
name: "Check for Anchor Proposal"
timeout: 30m
tasks:
- name: sleep
config:
duration: 5m # wait for the anchor nodes to startup
- name: run_tasks_concurrent
config:
tasks:
- name: check_consensus_block_proposals
config:
blockCount: 50
graffitiPattern: "Anchor.*"
minAttestationCount: 1
- name: check_consensus_attestation_stats
config:
minTargetPercent: 100
minHeadPercent: 100
minTotalPercent: 100
failOnCheckMiss: true
minCheckedEpochs: 2
- name: check_consensus_finality
config:
minFinalizedEpochs: 2
failOnCheckMiss: true
schedule:
startup: true

35 changes: 6 additions & 29 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ pull_request_rules:
- -closed
- label=ready-for-review
- check-pending!=test-suite-success
- check-pending!=local-testnet-success
- check-pending!=run-local-testnet
- check-stale!=test-suite-success
- check-stale!=local-testnet-success
- check-stale!=run-local-testnet
- or:
- check-skipped=test-suite-success
- check-skipped=local-testnet-success
- check-skipped=run-local-testnet
- check-failure=test-suite-success
- check-failure=local-testnet-success
- check-failure=run-local-testnet
actions:
comment:
message: Some required checks have failed. Could you please take a look @{{author}}? 🙏
Expand All @@ -51,6 +51,7 @@ pull_request_rules:
# Unfortunately, it doesn't look like there's an easy way to check for PRs pending
# CI workflows approvals.
- check-success=test-suite-success
- check-success=run-local-testnet
# Update the label only if there are no more change requests from any reviewers and no unresolved threads.
# This rule ensures that a PR with passing CI can be marked as `waiting-on-author`.
- "#changes-requested-reviews-by = 0"
Expand Down Expand Up @@ -92,34 +93,9 @@ pull_request_rules:
- base!=stable
- label=ready-for-merge
- label!=do-not-merge
- "#commits-behind > 0"
actions:
queue:

- name: Merge up to date, ready-to-merge PRs
conditions:
# All branch protection rules are implicit: https://docs.mergify.com/conditions/#about-branch-protection
- base!=stable
- label=ready-for-merge
- label!=do-not-merge
- check-success=test-suite-success
- "#approved-reviews-by >= 1"
- "#commits-behind == 0"
actions:
merge:
method: squash
commit_message_template: |
{{ title }} (#{{ number }})

{{ body | get_section("## Issue Addressed", "") }}


{{ body | get_section("## Proposed Changes", "") }}

{% for commit in commits | unique(attribute='email_author') %}
Co-Authored-By: {{ commit.author }} <{{ commit.email_author }}>
{% endfor %}

queue_rules:
- name: default
batch_size: 8
Expand All @@ -144,3 +120,4 @@ queue_rules:
- "label!=do-not-merge"
merge_conditions:
- "check-success=test-suite-success"
- "check-success=run-local-testnet"
107 changes: 107 additions & 0 deletions .github/workflows/local-testnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: local testnet

on:
push:
branches:
- stable
- 'pr/*'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:

jobs:
build-docker-image:
runs-on: warp-ubuntu-latest-x64-16x
steps:
- uses: actions/checkout@v5

- name: Build Docker Image
# has to be Dockerfile.devnet as spec-minimal is necessary
run: |
docker build -f Dockerfile.devnet -t node/anchor:latest .
docker save node/anchor:latest -o anchor-docker.tar

- name: Upload Docker Image Artifact
uses: actions/upload-artifact@v4
with:
name: anchor-docker
path: anchor-docker.tar
retention-days: 1

run-local-testnet:
runs-on: warp-ubuntu-latest-x64-16x
needs: build-docker-image
steps:
- uses: actions/checkout@v5
with:
repository: ssvlabs/ssv-mini
ref: 6ec110091a5ae7cccb0729b4b2541fe880dd8adb
path: ssv-mini

- uses: actions/checkout@v5
with:
path: anchor

- name: Install Kurtosis
run: |
KURTOSIS_VERSION=$(curl -s https://api.github.com/repos/kurtosis-tech/kurtosis-cli-release-artifacts/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
echo "Installing Kurtosis version: ${KURTOSIS_VERSION}"
curl -L "https://github.com/kurtosis-tech/kurtosis-cli-release-artifacts/releases/download/${KURTOSIS_VERSION}/kurtosis-cli_${KURTOSIS_VERSION}_linux_amd64.tar.gz" -o kurtosis.tar.gz
tar -xzf kurtosis.tar.gz
sudo mv kurtosis /usr/local/bin/
sudo chmod +x /usr/local/bin/kurtosis
kurtosis analytics disable

- name: Download Docker Image Artifact
uses: actions/download-artifact@v5
with:
name: anchor-docker
path: .

- name: Load Docker Image
run: docker load -i anchor-docker.tar

- name: Start Local Testnet with Assertoor
timeout-minutes: 30
run: kurtosis run --verbosity DETAILED --enclave localnet ssv-mini --args-file anchor/.github/custom/local-testnet/params.yaml

- name: Await Assertoor Test Result
id: assertoor_test_result
uses: ethpandaops/assertoor-github-action@v1
with:
kurtosis_enclave_name: localnet

- name: Return Assertoor Test Result
shell: bash
run: |
test_result="${{ steps.assertoor_test_result.outputs.result }}"
test_status=$(
cat <<"EOF"
${{ steps.assertoor_test_result.outputs.test_overview }}
EOF
)
failed_test_status=$(
cat <<"EOF"
${{ steps.assertoor_test_result.outputs.failed_test_details }}
EOF
)

echo "Test Result: $test_result"
echo "$test_status"
if ! [ "$test_result" == "success" ]; then
echo "Failed Test Task Status:"
echo "$failed_test_status"
exit 1
fi

- name: Kurtosis Dump
if: always()
run: kurtosis enclave dump localnet anchor-localnet-test-logs

- name: Upload Logs Artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: anchor-localnet-test-logs
path: anchor-localnet-test-logs/
retention-days: 3
Loading