Skip to content

Commit

Permalink
feat(checkpoint-sync): add beacon_node_url input to action
Browse files Browse the repository at this point in the history
This allows the user to specify the beacon node URL to use for
checkpoint sync, and removes the need for the action to have
knowledge of the different networks and their corresponding URLs.
This makes the action more generic and reusable.
  • Loading branch information
samcm committed Feb 21, 2025
1 parent c7cf8df commit 6379fae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
21 changes: 4 additions & 17 deletions .github/actions/checkpoint-sync/action.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Run a checkpoint sync test
description: Runs a consensus client and checkpoint syncs from the running checkpointz instance.

Expand All @@ -9,7 +8,9 @@ inputs:
network:
description: "The name of the network to run the test against (one of ropsten, sepolia, prater/goerli)."
required: true

beacon_node_url:
description: "The beacon node API URL to use"
required: true

runs:
using: composite
Expand All @@ -27,21 +28,7 @@ runs:
docker build . -t ethpandaops/checkpointz:local;
- name: Configure checkpointz
shell: bash
env:
MAINNET_BEACON_API_URL: "${{ secrets.MAINNET_BEACON_API_URL }}"
HOLESKY_BEACON_API_URL: "${{ secrets.HOLESKY_BEACON_API_URL }}"

run: |
beacon_node=""
if [[ ${{ inputs.network }} == "mainnet" ]]; then
beacon_node="${{ env.MAINNET_BEACON_API_URL }}"
elif [[ ${{ inputs.network }} == "holesky" ]]; then
beacon_node="${{ env.HOLESKY_BEACON_API_URL }}"
else
echo "Unsupported network: ${{ inputs.network }}"
exit 1
fi
cat <<EOF > checkpointz.yaml
global:
listenAddr: ":5555"
Expand All @@ -50,7 +37,7 @@ runs:
beacon:
upstreams:
- name: state-provider
address: $beacon_node
address: ${{ inputs.beacon_node_url }}
timeoutSeconds: 30
dataProvider: true
checkpointz:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
id: run-test
uses: ./.github/actions/checkpoint-sync
with:
## Variables
consensus: ${{ matrix.consensus }}
network: ${{ matrix.network }}
network: ${{ matrix.network }}
beacon_node_url: ${{ matrix.network == 'mainnet' && secrets.MAINNET_BEACON_API_URL || secrets.HOLESKY_BEACON_API_URL }}

0 comments on commit 6379fae

Please sign in to comment.