-
Notifications
You must be signed in to change notification settings - Fork 931
Add e2e sync tests to CI #7530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+213
−2
Merged
Add e2e sync tests to CI #7530
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0e4e7a2
Add checkpoint sync test to CI.
jimmygchen 1b5daa0
Add missing const.
jimmygchen b9e147f
Handle jq errors.
jimmygchen 9f52e7f
Start and exit the sync test with scripts to make sure we dump the lo…
jimmygchen 6200dad
Add checkpoint sync test for fusaka devnet.
jimmygchen deed0f5
Fail fast if local testnet fails to start.
jimmygchen f59c9f7
Add genesis sync tests.
jimmygchen 6b4189f
Disable PeerDAS devnet checkpoint sync test temporarily.
jimmygchen 5eeff8a
Fix genesis sync test command.
jimmygchen debf891
Fix genesis sync offline duration.
jimmygchen 3594cba
Re-enable peerdas devnet sync test now checkpointz is working again.
jimmygchen be8e1d0
Merge branch 'unstable' into add-ci-sync-tests
jimmygchen 26aa570
Merge branch 'unstable' into add-ci-sync-tests
jimmygchen cfcc0d2
Add `if: always()` to upload artifacts steps to ensure logs are uploa…
jimmygchen c1f0e51
Merge branch 'unstable' into add-ci-sync-tests
jimmygchen ca4dbeb
Remove genesis sync tests.
jimmygchen f8b2ab1
Add `continue-on-error: true` to checkpoint sync tests.
jimmygchen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| participants: | ||
| - cl_type: lighthouse | ||
| cl_image: lighthouse:local | ||
| supernode: true | ||
| - cl_type: lighthouse | ||
| cl_image: lighthouse:local | ||
| supernode: false | ||
|
|
||
| checkpoint_sync_enabled: true | ||
| checkpoint_sync_url: "https://checkpoint-sync.sepolia.ethpandaops.io" | ||
jimmygchen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| network_params: | ||
| network: sepolia | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Checkpoint sync to a live network (Sepolia). | ||
| # | ||
| # Start with checkpoint sync and let the node(s) sync to head and perform backfill for a specified number of slots. | ||
| # This test ensures we cover all sync components (range, lookup, backfill) and measures sync speed | ||
| # to detect any performance regressions. | ||
| SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
| ENCLAVE_NAME=sync-testnet | ||
| CONFIG=$SCRIPT_DIR/checkpoint-sync-config.yaml | ||
| POLL_INTERVAL_SECS=5 | ||
| TARGET_BACKFILL_SLOTS=256 | ||
| TIMEOUT_SECS=$((10 * 60)) | ||
| start_time=$(date +%s) | ||
|
|
||
| # Start the nodes | ||
| kurtosis run github.com/ethpandaops/ethereum-package --enclave "$ENCLAVE_NAME" --args-file "$CONFIG" \ | ||
| --image-download always --non-blocking-tasks | ||
|
|
||
| # Get all beacon API URLs | ||
| supernode_url=$(kurtosis port print $ENCLAVE_NAME cl-1-lighthouse-geth http) | ||
| fullnode_url=$(kurtosis port print $ENCLAVE_NAME cl-2-lighthouse-geth http) | ||
|
|
||
| # Initialize statuses | ||
| declare -A node_completed | ||
| declare -A node_complete_time | ||
| declare -A node_urls | ||
|
|
||
| node_urls["supernode"]="$supernode_url" | ||
| node_urls["fullnode"]="$fullnode_url" | ||
| node_completed["supernode"]=false | ||
| node_completed["fullnode"]=false | ||
|
|
||
| echo "Polling sync status until backfill reaches ${TARGET_BACKFILL_SLOTS} slots or timeout of ${TIMEOUT_MINS} mins" | ||
jimmygchen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # Polls a single node's sync status | ||
| poll_node() { | ||
| local node_type=$1 | ||
| local url=${node_urls[$node_type]} | ||
|
|
||
| response=$(curl -s "${url}/lighthouse/syncing") | ||
| status=$(echo "$response" | jq -r '.data | keys[0] // "Unknown"') | ||
|
|
||
| # Print syncing status | ||
| if [ "$status" != "null" ] && [ "$status" != "Unknown" ]; then | ||
| fields=$(echo "$response" | jq -r ".data.${status} | to_entries | map(\"\(.key): \(.value)\") | join(\", \")") | ||
| echo "${node_type} status: ${status}, ${fields}" | ||
| else | ||
| echo "${node_type} status: Unknown sync state" | ||
| fi | ||
|
|
||
| # Check for completion criteria | ||
| if [ "$status" = "BackFillSyncing" ]; then | ||
| completed=$(echo "$response" | jq -r ".data.${status}.completed") | ||
| if [ "$completed" -ge "$TARGET_BACKFILL_SLOTS" ]; then | ||
| mark_node_complete "$node_type" | ||
| fi | ||
| elif [ "$status" = "Synced" ]; then | ||
| mark_node_complete "$node_type" | ||
| fi | ||
|
|
||
| # For other states (SyncingFinalized, SyncingHead, SyncTransition, Stalled, Unknown), | ||
| # we continue polling | ||
| } | ||
|
|
||
| # Marks a node as complete and record time | ||
| mark_node_complete() { | ||
| local node_type=$1 | ||
| if [ "${node_completed[$node_type]}" = false ]; then | ||
| node_completed[$node_type]=true | ||
| node_complete_time[$node_type]=$(date +%s) | ||
| echo "${node_type} completed backfill in $((node_complete_time[$node_type] - start_time)) seconds" | ||
| fi | ||
| } | ||
|
|
||
| while [ "${node_completed[supernode]}" = false ] || [ "${node_completed[fullnode]}" = false ]; do | ||
| current_time=$(date +%s) | ||
| elapsed=$((current_time - start_time)) | ||
|
|
||
| if [ "$elapsed" -ge "$TIMEOUT_SECS" ]; then | ||
| echo "ERROR: Nodes timed out syncing after ${TIMEOUT_MINS} minutes. Exiting." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Poll each node that hasn't completed yet | ||
| for node in "supernode" "fullnode"; do | ||
| if [ "${node_completed[$node]}" = false ]; then | ||
| poll_node "$node" | ||
| fi | ||
| done | ||
|
|
||
| sleep $POLL_INTERVAL_SECS | ||
| done | ||
|
|
||
| echo "Sync test complete! Both supernode and fullnode have synced to HEAD and backfilled ${TARGET_BACKFILL_SLOTS} slots." | ||
| echo "Supernode time: $((node_complete_time[supernode] - start_time)) seconds" | ||
| echo "Fullnode time: $((node_complete_time[fullnode] - start_time)) seconds" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.