Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
18086f3
feat: simplify bridge configuration by consolidating input parameters…
Le-Caignec Jul 23, 2025
b36940d
feat: update bridge configuration to correctly associate environments…
Le-Caignec Jul 23, 2025
2de0947
feat: add push trigger to configure bridges workflow
Le-Caignec Jul 23, 2025
1d8f733
feat: remove push trigger from configure bridges workflow
Le-Caignec Jul 23, 2025
b19f889
feat: update configure bridges workflow to include environment variab…
Le-Caignec Jul 23, 2025
f010e5c
feat: add checkout step with submodules to configure bridges workflow
Le-Caignec Jul 23, 2025
2342e15
chore: save bridge configuration artifacts for sepolia→arbitrum_sepol…
github-actions[bot] Jul 23, 2025
b0ce175
feat: refactor configure bridges workflow by removing the configure b…
Le-Caignec Jul 23, 2025
f34580d
feat: add network_type matrix to configure bridges job
Le-Caignec Jul 23, 2025
90b25f6
chore: save bridge configuration artifacts for arbitrum_sepolia→sepol…
github-actions[bot] Jul 23, 2025
5b55ae6
feat: update configure bridges workflow to dynamically set matrix bas…
Le-Caignec Jul 23, 2025
5fbe983
Merge branch 'feature/other-way-for-configuration' of https://github.…
Le-Caignec Jul 23, 2025
5d3bde4
feat: simplify matrix definition for bridge configuration in configur…
Le-Caignec Jul 23, 2025
4db4790
feat: update matrix definition for bridge configuration in setup-matr…
Le-Caignec Jul 23, 2025
5bb95ea
chore: save bridge configuration artifacts for arbitrum_sepolia→sepol…
github-actions[bot] Jul 23, 2025
cb3c705
feat: remove artifact saving step from configure bridges workflow
Le-Caignec Jul 23, 2025
93e8bee
feat: remove run-latest.json file from IexecLayerZeroBridge broadcast
Le-Caignec Jul 23, 2025
5c24ec2
Implement code changes to enhance functionality and improve performance
Le-Caignec Jul 23, 2025
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
173 changes: 49 additions & 124 deletions .github/workflows/configure-bridges.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,66 @@
name: Configure Bridges

on:
workflow_dispatch: # Manual trigger
workflow_dispatch:
inputs:
source_chain:
description: 'Source chain network'
network_type:
description: 'Network type to configure'
required: true
type: choice
options:
- sepolia
- ethereum
- arbitrum_sepolia
- arbitrum
default: 'sepolia'
target_chain:
description: 'Target chain network'
required: true
type: choice
options:
- sepolia
- ethereum
- arbitrum_sepolia
- arbitrum
default: 'arbitrum_sepolia'
- testnets
- mainnets
default: 'testnets'

jobs:
validate-inputs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
is_valid: ${{ steps.validate.outputs.is_valid }}
error_message: ${{ steps.validate.outputs.error_message }}
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Validate chain pair
id: validate
- name: Set matrix based on network type
id: set-matrix
run: |
SOURCE="${{ inputs.source_chain }}"
TARGET="${{ inputs.target_chain }}"

# Check if source and target are the same
if [ "$SOURCE" = "$TARGET" ]; then
echo "is_valid=false" >> $GITHUB_OUTPUT
echo "error_message=Source and target chains cannot be the same" >> $GITHUB_OUTPUT
exit 0
if [ "${{ github.event.inputs.network_type }}" == "testnets" ]; then
MATRIX='[
{
"source_chain": "sepolia",
"target_chain": "arbitrum_sepolia"
},
{
"source_chain": "arbitrum_sepolia",
"target_chain": "sepolia"
}
]'
else
MATRIX='[
{
"source_chain": "ethereum",
"target_chain": "arbitrum"
},
{
"source_chain": "arbitrum",
"target_chain": "ethereum"
}
]'
fi

# Check valid chain pairs
case "$SOURCE-$TARGET" in
"sepolia-arbitrum_sepolia"|"arbitrum_sepolia-sepolia")
echo "is_valid=true" >> $GITHUB_OUTPUT
echo "error_message=" >> $GITHUB_OUTPUT
;;
"ethereum-arbitrum"|"arbitrum-ethereum")
echo "is_valid=true" >> $GITHUB_OUTPUT
echo "error_message=" >> $GITHUB_OUTPUT
;;
*)
echo "is_valid=false" >> $GITHUB_OUTPUT
echo "error_message=Invalid chain pair. Valid pairs: sepolia↔arbitrum_sepolia, ethereum↔arbitrum" >> $GITHUB_OUTPUT
;;
esac
# Convertir en une ligne pour GitHub Output
echo "matrix=$(echo "$MATRIX" | jq -c .)" >> $GITHUB_OUTPUT

configure-bridges:
needs: validate-inputs
needs: setup-matrix
runs-on: ubuntu-latest
if: needs.validate-inputs.outputs.is_valid == 'true'
strategy:
matrix:
include: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
fail-fast: false
concurrency:
group: configure-bridges-${{ matrix.source_chain }}-${{ matrix.target_chain }}
cancel-in-progress: true
env:
CI: true
environment: ${{ inputs.source_chain }}
environment: ${{ matrix.source_chain }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -78,79 +72,10 @@ jobs:
version: stable
cache: true

- name: Set environment variables
run: |
case "${{ inputs.source_chain }}" in
"sepolia")
echo "SOURCE_RPC_URL=${{ vars.SEPOLIA_RPC_URL }}" >> $GITHUB_ENV
;;
"ethereum")
echo "SOURCE_RPC_URL=${{ vars.ETHEREUM_RPC_URL }}" >> $GITHUB_ENV
;;
"arbitrum_sepolia")
echo "SOURCE_RPC_URL=${{ vars.ARBITRUM_SEPOLIA_RPC_URL }}" >> $GITHUB_ENV
;;
"arbitrum")
echo "SOURCE_RPC_URL=${{ vars.ARBITRUM_RPC_URL }}" >> $GITHUB_ENV
;;
esac

case "${{ inputs.target_chain }}" in
"sepolia")
echo "TARGET_RPC_URL=${{ vars.SEPOLIA_RPC_URL }}" >> $GITHUB_ENV
;;
"ethereum")
echo "TARGET_RPC_URL=${{ vars.ETHEREUM_RPC_URL }}" >> $GITHUB_ENV
;;
"arbitrum_sepolia")
echo "TARGET_RPC_URL=${{ vars.ARBITRUM_SEPOLIA_RPC_URL }}" >> $GITHUB_ENV
;;
"arbitrum")
echo "TARGET_RPC_URL=${{ vars.ARBITRUM_RPC_URL }}" >> $GITHUB_ENV
;;
esac

- name: Configure bridge from source to target
- name: Configure bridge from ${{ matrix.source_chain }} to ${{ matrix.target_chain }}
env:
DEPLOYER_PRIVATE_KEY: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
ACCOUNT: ${{ vars.ACCOUNT || 'default' }}
SOURCE_CHAIN: ${{ inputs.source_chain }}
TARGET_CHAIN: ${{ inputs.target_chain }}
SOURCE_RPC_URL: ${{ env.SOURCE_RPC_URL }}
TARGET_RPC_URL: ${{ env.TARGET_RPC_URL }}
run: |
make configure-bridge

- name: Configure bridge from target to source
env:
DEPLOYER_PRIVATE_KEY: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
ACCOUNT: ${{ vars.ACCOUNT || 'default' }}
SOURCE_CHAIN: ${{ inputs.target_chain }}
TARGET_CHAIN: ${{ inputs.source_chain }}
SOURCE_RPC_URL: ${{ env.TARGET_RPC_URL }}
TARGET_RPC_URL: ${{ env.SOURCE_RPC_URL }}
run: |
make configure-bridge

- name: Save bridge configuration artifacts
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'chore: save bridge configuration artifacts for ${{ inputs.source_chain }}↔${{ inputs.target_chain }} (Github run_id: ${{ github.run_id }})'
file_pattern: 'config/config.json broadcast/'
commit_user_name: 'GitHub Actions Bot'
commit_user_email: 'github-actions[bot]@users.noreply.github.com'
commit_author: 'GitHub Actions Bot <github-actions[bot]@users.noreply.github.com>'

show-validation-error:
needs: validate-inputs
runs-on: ubuntu-latest
if: needs.validate-inputs.outputs.is_valid == 'false'
steps:
- name: Show validation error
run: |
echo "❌ Validation failed: ${{ needs.validate-inputs.outputs.error_message }}"
echo ""
echo "Valid chain pairs:"
echo " • sepolia ↔ arbitrum_sepolia (testnets)"
echo " • ethereum ↔ arbitrum (mainnets)"
exit 1
ADMIN_PRIVATE_KEY: ${{ secrets.ADMIN_PRIVATE_KEY }}
SOURCE_CHAIN: ${{ matrix.source_chain }}
TARGET_CHAIN: ${{ matrix.target_chain }}
RPC_URL: ${{ secrets.RPC_URL }}
run: make configure-bridge
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ configure-bridge: # SOURCE_CHAIN, TARGET_CHAIN, RPC_URL
SOURCE_CHAIN=$(SOURCE_CHAIN) TARGET_CHAIN=$(TARGET_CHAIN) \
forge script script/bridges/layerZero/IexecLayerZeroBridge.s.sol:Configure \
--rpc-url $(RPC_URL) \
$$(if [ "$(CI)" = "true" ]; then echo "--private-key $(DEPLOYER_PRIVATE_KEY)"; else echo "--account $(ACCOUNT)"; fi) \
$$(if [ "$(CI)" = "true" ]; then echo "--private-key $(ADMIN_PRIVATE_KEY)"; else echo "--account $(ACCOUNT)"; fi) \
--broadcast \
-vvv

Expand Down