Skip to content
Open
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
51 changes: 28 additions & 23 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
push:
branches:
- main
- 'release-*'
- "release-*"
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
- 'release-*'
- "release-*"
workflow_call:

env:
Expand All @@ -23,12 +23,11 @@ concurrency:
cancel-in-progress: true

jobs:

code-quality:
name: "Code Quality & Linting"
runs-on: ubuntu-24.04
timeout-minutes: 10

steps:
- name: "Checkout Repository"
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
Expand All @@ -39,7 +38,7 @@ jobs:
run: |
git config --global url.https://x-oauth-basic:${{ secrets.GITHUB_TOKEN }}@github.com/.insteadOf https://github.com/
echo "GOPRIVATE=github.com/symbioticfi/relay" >> $GITHUB_ENV

- name: "Setup Go Environment"
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # pin@v6.4.0
with:
Expand Down Expand Up @@ -71,7 +70,7 @@ jobs:
runs-on: ubuntu-24.04
timeout-minutes: 15
needs: [code-quality]

steps:
- name: "Checkout Repository"
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
Expand All @@ -82,7 +81,7 @@ jobs:
run: |
git config --global url.https://x-oauth-basic:${{ secrets.GITHUB_TOKEN }}@github.com/.insteadOf https://github.com/
echo "GOPRIVATE=github.com/symbioticfi/relay" >> $GITHUB_ENV

- name: "Setup Go Environment"
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # pin@v6.4.0
with:
Expand Down Expand Up @@ -121,13 +120,12 @@ jobs:
files: ./coverage.out
fail_ci_if_error: false


e2e-tests:
name: "E2E Tests - ${{ matrix.config.name }}"
runs-on: ${{ matrix.config.verification_type == 0 && 'relay-16' || 'ubuntu-24.04' }}
timeout-minutes: 35
timeout-minutes: 40
needs: [unit-tests]

strategy:
matrix:
config:
Expand All @@ -153,7 +151,7 @@ jobs:
aggregators: 3
verification_type: 0
epoch_time: 120

env:
# E2E Test Configuration
OPERATORS: ${{ matrix.config.operators }}
Expand Down Expand Up @@ -222,34 +220,33 @@ jobs:
cd e2e/temp-network
echo "Starting Docker Compose network..."
docker compose up -d

echo "Waiting for services to initialize..."
sleep 30

echo "✅ Network startup completed"

- name: "Execute E2E Tests"
run: |
echo "Running End-to-End tests..."
make e2e-test


- name: "Collect Diagnostic Information"
if: failure()
run: |
cd e2e
echo "❌ Test failure detected - collecting diagnostic information..."

# Create organized logs directory structure
mkdir -p logs/{containers,system,summary}

echo "Gathering container information..."
# Get active containers (excluding anvil containers which are noisy)
CONTAINER_IDS=$(docker ps -a --format "table {{.ID}}\t{{.Names}}" | grep -v -E "(anvil|buildx_buildkit|CONTAINER)" | awk '{print $1}' | tr '\n' ' ')

if [ -n "$CONTAINER_IDS" ]; then
echo "Found active containers: $(echo $CONTAINER_IDS | wc -w)"

# Container status overview
{
echo "=== Container Status Overview ==="
Expand All @@ -259,12 +256,12 @@ jobs:
echo ""
docker ps -a --format "table {{.ID}}\t{{.Names}}\t{{.Status}}\t{{.Ports}}" | grep -v -E "(anvil|buildx_buildkit)"
} > logs/containers/status-overview.log

# Individual container logs
for container_id in $CONTAINER_IDS; do
if [ -n "$container_id" ]; then
CONTAINER_NAME=$(docker inspect --format='{{.Name}}' $container_id 2>/dev/null | sed 's/^\/*//' || echo "container-$container_id")

echo "Collecting logs for: $CONTAINER_NAME"
{
echo "=== Container: $CONTAINER_NAME ($container_id) ==="
Expand All @@ -278,7 +275,7 @@ jobs:
else
echo "⚠️ No active containers found (excluding anvil)" > logs/containers/status-overview.log
fi

echo "Gathering system information..."
{
echo "=== System Diagnostics ==="
Expand All @@ -296,7 +293,7 @@ jobs:
echo "=== Docker Images ==="
docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}\t{{.CreatedAt}}"
} > logs/system/diagnostics.log

echo "Creating test summary..."
{
echo "=== E2E Test Failure Summary ==="
Expand All @@ -316,6 +313,14 @@ jobs:
echo " - Block Time: ${{ env.BLOCK_TIME }}s"
echo " - Finality Blocks: ${{ env.FINALITY_BLOCKS }}"
echo " - Storage Type: ${{ env.STORAGE_TYPE || 'default (bbolt)' }}"
if [ -n "${{ env.E2E_PRUNING_TEST }}" ]; then
echo " - Retention Valset Epochs: ${{ env.RETENTION_VALSET_EPOCHS }}"
echo " - Retention Signature Epochs: ${{ env.RETENTION_SIGNATURE_EPOCHS }}"
echo " - Retention Proof Epochs: ${{ env.RETENTION_PROOF_EPOCHS }}"
echo " - Pruner Interval: ${{ env.PRUNER_INTERVAL }}"
echo " - Sync Epochs: ${{ env.SYNC_EPOCHS }}"
echo " - Pruning Test Enabled: ${{ env.E2E_PRUNING_TEST }}"
fi
echo ""
echo "=== Available Log Files ==="
echo "containers/status-overview.log - Container status summary"
Expand All @@ -329,7 +334,7 @@ jobs:
echo "3. Verify test configuration parameters"
echo "4. Consider adjusting timeout values if needed"
} > logs/summary/failure-report.log

echo "✅ Diagnostic collection completed"
echo "Log file summary:"
find logs -type f -name "*.log" -exec echo " - {}" \; | sort
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ unit-test:
e2e-test:
cd e2e/tests && go test -v -timeout 40m

.PHONY: e2e-pruning-test
e2e-pruning-test:
cd e2e/tests && go test -v -timeout 40m -run 'TestPruning'

.PHONY: gen-abi
gen-abi:
go run github.com/ethereum/go-ethereum/cmd/abigen@latest \
Expand Down
10 changes: 7 additions & 3 deletions e2e/scripts/generate_network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ generate_docker_compose() {
local anvil_settlement_port=8546
local relay_start_port=8081
local sum_start_port=9091
local host_uid=${HOST_UID:-$(id -u)}
local host_gid=${HOST_GID:-$(id -g)}

# Calculate timestamp as current unix timestamp + 5 seconds
local timestamp=$(($(date +%s) + 5))
Expand Down Expand Up @@ -313,10 +315,11 @@ EOF
relay-sidecar-$i:
image: relay_sidecar:dev
container_name: symbiotic-relay-$i
user: "$host_uid:$host_gid"
command:
- sh
- -c
- "chmod 777 /app/$storage_dir /deploy-data 2>/dev/null || true && /workspace/scripts/sidecar-start.sh symb/0/15/0x$SYMB_PRIVATE_KEY_HEX,symb/0/11/0x$SYMB_SECONDARY_PRIVATE_KEY_HEX,symb/2/1/0x$SYMB_BLS12381_PRIVATE_KEY_HEX,symb/1/0/0x$SYMB_PRIVATE_KEY_HEX,evm/1/31337/0x$SYMB_PRIVATE_KEY_HEX,evm/1/31338/0x$SYMB_PRIVATE_KEY_HEX,p2p/1/1/$SYMB_PRIVATE_KEY_HEX /app/$storage_dir $circuits_param"
- "/workspace/scripts/sidecar-start.sh symb/0/15/0x$SYMB_PRIVATE_KEY_HEX,symb/0/11/0x$SYMB_SECONDARY_PRIVATE_KEY_HEX,symb/2/1/0x$SYMB_BLS12381_PRIVATE_KEY_HEX,symb/1/0/0x$SYMB_PRIVATE_KEY_HEX,evm/1/31337/0x$SYMB_PRIVATE_KEY_HEX,evm/1/31338/0x$SYMB_PRIVATE_KEY_HEX,p2p/1/1/$SYMB_PRIVATE_KEY_HEX /app/$storage_dir $circuits_param"
ports:
- "$port:8080"
volumes:
Expand Down Expand Up @@ -372,10 +375,11 @@ EOF
relay-sidecar-extra:
image: relay_sidecar:dev
container_name: symbiotic-relay-extra
user: "$host_uid:$host_gid"
command:
- sh
- -c
- "chmod 777 /app/$extra_storage_dir /deploy-data 2>/dev/null || true && /workspace/scripts/sidecar-start.sh symb/0/15/0x$extra_key_hex,symb/0/11/0x$extra_secondary_key_hex,symb/2/1/0x$extra_bls12381_key_hex,symb/1/0/0x$extra_key_hex,evm/1/31337/0x$extra_key_hex,evm/1/31338/0x$extra_key_hex,p2p/1/1/$extra_key_hex /app/$extra_storage_dir $circuits_param"
- "/workspace/scripts/sidecar-start.sh symb/0/15/0x$extra_key_hex,symb/0/11/0x$extra_secondary_key_hex,symb/2/1/0x$extra_bls12381_key_hex,symb/1/0/0x$extra_key_hex,evm/1/31337/0x$extra_key_hex,evm/1/31338/0x$extra_key_hex,p2p/1/1/$extra_key_hex /app/$extra_storage_dir $circuits_param"
ports:
- "$extra_port:8080"
volumes:
Expand Down Expand Up @@ -442,4 +446,4 @@ main() {
generate_docker_compose "$operators" "$commiters" "$aggregators" "$verification_type" "$epoch_size" "$block_time" "$finality_blocks" "$committer_slot_duration"
}

main "$@"
main "$@"
10 changes: 5 additions & 5 deletions e2e/scripts/sidecar-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ evm:

# Retention config
retention:
valset-epochs: 1000
signature-epochs: 1000
proof-epochs: 1000
valset-epochs: 5
signature-epochs: 5
proof-epochs: 5

sync:
enabled: true
period: 5s
timeout: 1m
epochs: 1000
epochs: 5

pruner:
enabled: true
interval: 1m
interval: 10s

tracing:
enabled: false
Expand Down
2 changes: 1 addition & 1 deletion e2e/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ fi



echo "Setup complete! Network configuration generated in temp-network/ directory."
echo "Setup complete! Network configuration generated in temp-network/ directory."
Loading
Loading