Skip to content

Commit 6379fae

Browse files
committed
feat(checkpoint-sync): add beacon_node_url input to action
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.
1 parent c7cf8df commit 6379fae

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

.github/actions/checkpoint-sync/action.yaml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: Run a checkpoint sync test
32
description: Runs a consensus client and checkpoint syncs from the running checkpointz instance.
43

@@ -9,7 +8,9 @@ inputs:
98
network:
109
description: "The name of the network to run the test against (one of ropsten, sepolia, prater/goerli)."
1110
required: true
12-
11+
beacon_node_url:
12+
description: "The beacon node API URL to use"
13+
required: true
1314

1415
runs:
1516
using: composite
@@ -27,21 +28,7 @@ runs:
2728
docker build . -t ethpandaops/checkpointz:local;
2829
- name: Configure checkpointz
2930
shell: bash
30-
env:
31-
MAINNET_BEACON_API_URL: "${{ secrets.MAINNET_BEACON_API_URL }}"
32-
HOLESKY_BEACON_API_URL: "${{ secrets.HOLESKY_BEACON_API_URL }}"
33-
3431
run: |
35-
beacon_node=""
36-
if [[ ${{ inputs.network }} == "mainnet" ]]; then
37-
beacon_node="${{ env.MAINNET_BEACON_API_URL }}"
38-
elif [[ ${{ inputs.network }} == "holesky" ]]; then
39-
beacon_node="${{ env.HOLESKY_BEACON_API_URL }}"
40-
else
41-
echo "Unsupported network: ${{ inputs.network }}"
42-
exit 1
43-
fi
44-
4532
cat <<EOF > checkpointz.yaml
4633
global:
4734
listenAddr: ":5555"
@@ -50,7 +37,7 @@ runs:
5037
beacon:
5138
upstreams:
5239
- name: state-provider
53-
address: $beacon_node
40+
address: ${{ inputs.beacon_node_url }}
5441
timeoutSeconds: 30
5542
dataProvider: true
5643
checkpointz:

.github/workflows/integration.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
id: run-test
2727
uses: ./.github/actions/checkpoint-sync
2828
with:
29-
## Variables
3029
consensus: ${{ matrix.consensus }}
31-
network: ${{ matrix.network }}
30+
network: ${{ matrix.network }}
31+
beacon_node_url: ${{ matrix.network == 'mainnet' && secrets.MAINNET_BEACON_API_URL || secrets.HOLESKY_BEACON_API_URL }}
32+

0 commit comments

Comments
 (0)