Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
89 changes: 89 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,92 @@ jobs:
path: e2e/logs/
retention-days: 7
if-no-files-found: warn

e2e-pruning-tests:
name: "E2E Pruning Tests - ${{ matrix.config.name }}"
runs-on: ubuntu-24.04
timeout-minutes: 35
needs: [unit-tests]

strategy:
matrix:
config:
- name: "Pruning Setup (bbolt)"
storage_type: ""
- name: "Pruning Setup (badger)"
storage_type: "badger"

env:
OPERATORS: 4
COMMITERS: 1
AGGREGATORS: 1
VERIFICATION_TYPE: 1
EPOCH_TIME: 60
BLOCK_TIME: 1
FINALITY_BLOCKS: 2
STORAGE_TYPE: ${{ matrix.config.storage_type }}
RETENTION_VALSET_EPOCHS: 2
RETENTION_SIGNATURE_EPOCHS: 2
RETENTION_PROOF_EPOCHS: 2
PRUNER_INTERVAL: 5s
SYNC_EPOCHS: 2
E2E_PRUNING_TEST: 1

steps:
- name: "Checkout Repository"
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
with:
fetch-depth: 0

- name: "Configure Private Repository Access"
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@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ env.GO_VERSION }}
cache: true
cache-dependency-path: "go.sum"

- name: "Setup Node.js Environment"
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ env.NODE_VERSION }}

- name: "Setup Foundry Toolchain"
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0
with:
version: ${{ env.FOUNDRY_VERSION }}

- name: "Setup Docker Buildx"
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1

- name: "Install Go Dependencies"
run: go mod download

- name: "Initialize Pruning E2E Test Environment"
run: |
echo "Configuring pruning E2E test environment..."
echo " - Storage Type: ${{ env.STORAGE_TYPE || 'default (bbolt)' }}"
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 }}"

cd e2e
chmod +x setup.sh
./setup.sh
cd ../
chmod -R 777 e2e/

- name: "Start Pruning Test Network"
run: |
cd e2e/temp-network
docker compose up -d
sleep 30

- name: "Execute Pruning E2E Tests"
run: |
make e2e-pruning-test
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
17 changes: 16 additions & 1 deletion e2e/scripts/generate_network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ get_config_from_env() {
print_status " Finality blocks: $finality_blocks (FINALITY_BLOCKS=${FINALITY_BLOCKS:-default})"
print_status " Committer slot duration: $committer_slot_duration seconds (COMMITTER_SLOT_DURATION=${COMMITTER_SLOT_DURATION:-default})"
print_status " Storage type: ${STORAGE_TYPE:-default (bbolt)} (STORAGE_TYPE=${STORAGE_TYPE:-default})"
print_status " Retention valset epochs: ${RETENTION_VALSET_EPOCHS:-1000}"
print_status " Retention signature epochs: ${RETENTION_SIGNATURE_EPOCHS:-1000}"
print_status " Retention proof epochs: ${RETENTION_PROOF_EPOCHS:-1000}"
print_status " Pruner interval: ${PRUNER_INTERVAL:-1m}"
print_status " Sync epochs: ${SYNC_EPOCHS:-1000}"
}

# Function to generate Docker Compose file
Expand Down Expand Up @@ -342,6 +347,11 @@ EOF
environment:
- MAX_VALIDATORS=10
- STORAGE_TYPE=${STORAGE_TYPE:-}
- RETENTION_VALSET_EPOCHS=${RETENTION_VALSET_EPOCHS:-}
- RETENTION_SIGNATURE_EPOCHS=${RETENTION_SIGNATURE_EPOCHS:-}
- RETENTION_PROOF_EPOCHS=${RETENTION_PROOF_EPOCHS:-}
- PRUNER_INTERVAL=${PRUNER_INTERVAL:-}
- SYNC_EPOCHS=${SYNC_EPOCHS:-}
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/healthz"]
interval: 30s
Expand Down Expand Up @@ -398,6 +408,11 @@ EOF
environment:
- MAX_VALIDATORS=10
- STORAGE_TYPE=${STORAGE_TYPE:-}
- RETENTION_VALSET_EPOCHS=${RETENTION_VALSET_EPOCHS:-}
- RETENTION_SIGNATURE_EPOCHS=${RETENTION_SIGNATURE_EPOCHS:-}
- RETENTION_PROOF_EPOCHS=${RETENTION_PROOF_EPOCHS:-}
- PRUNER_INTERVAL=${PRUNER_INTERVAL:-}
- SYNC_EPOCHS=${SYNC_EPOCHS:-}
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/healthz"]
interval: 30s
Expand Down Expand Up @@ -440,4 +455,4 @@ main() {
generate_docker_compose "$operators" "$commiters" "$aggregators" "$verification_type" "$epoch_size" "$block_time" "$finality_blocks" "$committer_slot_duration"
}

main "$@"
main "$@"
15 changes: 10 additions & 5 deletions e2e/scripts/sidecar-start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/sh

DRIVER_ADDRESS=0x43C27243F96591892976FFf886511807B65a33d5
RETENTION_VALSET_EPOCHS=${RETENTION_VALSET_EPOCHS:-1000}
RETENTION_SIGNATURE_EPOCHS=${RETENTION_SIGNATURE_EPOCHS:-1000}
RETENTION_PROOF_EPOCHS=${RETENTION_PROOF_EPOCHS:-1000}
PRUNER_INTERVAL=${PRUNER_INTERVAL:-1m}
SYNC_EPOCHS=${SYNC_EPOCHS:-1000}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Derive sync epochs from retention defaults

SYNC_EPOCHS defaults to 1000 even when retention is overridden to a much smaller value. With this change, users can now set RETENTION_VALSET_EPOCHS via env, but if they forget to also set SYNC_EPOCHS, the generated config becomes invalid (sync.epochs > retention.valset-epochs) and relay startup fails due to config validation. The default should be capped/derived from retention to avoid this regression when enabling pruning settings.

Useful? React with 👍 / 👎.


cat > /tmp/sidecar.yaml << EOFCONFIG
# Logging
Expand Down Expand Up @@ -39,19 +44,19 @@ evm:

# Retention config
retention:
valset-epochs: 1000
signature-epochs: 1000
proof-epochs: 1000
valset-epochs: ${RETENTION_VALSET_EPOCHS}
signature-epochs: ${RETENTION_SIGNATURE_EPOCHS}
proof-epochs: ${RETENTION_PROOF_EPOCHS}

sync:
enabled: true
period: 5s
timeout: 1m
epochs: 1000
epochs: ${SYNC_EPOCHS}

pruner:
enabled: true
interval: 1m
interval: ${PRUNER_INTERVAL}

tracing:
enabled: false
Expand Down
7 changes: 6 additions & 1 deletion e2e/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ export BLOCK_TIME=${BLOCK_TIME}
export FINALITY_BLOCKS=${FINALITY_BLOCKS}
export COMMITTER_SLOT_DURATION=${COMMITTER_SLOT_DURATION}
export STORAGE_TYPE=${STORAGE_TYPE}
export RETENTION_VALSET_EPOCHS=${RETENTION_VALSET_EPOCHS}
export RETENTION_SIGNATURE_EPOCHS=${RETENTION_SIGNATURE_EPOCHS}
export RETENTION_PROOF_EPOCHS=${RETENTION_PROOF_EPOCHS}
export PRUNER_INTERVAL=${PRUNER_INTERVAL}
export SYNC_EPOCHS=${SYNC_EPOCHS}

# Call the generate network script
./scripts/generate_network.sh
Expand Down Expand Up @@ -102,4 +107,4 @@ fi



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