Add xdc chain to sedge#547
Draft
ak88 wants to merge 155 commits into
Draft
Conversation
Co-authored-by: Miguel Tenorio <46824157+AntiD2ta@users.noreply.github.com>
Co-authored-by: Miguel Tenorio <46824157+AntiD2ta@users.noreply.github.com>
Co-authored-by: Miguel Tenorio <46824157+AntiD2ta@users.noreply.github.com>
Release v1.3.0
Fix golang version for release
- Add op support in sedge
Remove obsolete version field (#373)
Splits XDC into mainnet (xdc) and testnet (xdc-testnet) variants following the joc-mainnet/joc-testnet convention, so the EL container is launched with --config=xdc-testnet matching Nethermind's xdc-testnet.json chainspec (vs the previous NETWORK=xdc which silently booted the mainnet chain). Flips SupportsMEVBoost on NetworkXdc to true to mirror the other POA entries (validatePOANetwork strips MEV anyway). End-to-end sync verified against nethermindeth/nethermind:master for both variants.
Approved internal-branch design for adding an `arb-full-node` generator that wires Offchain Labs' nitro-node with Nethermind's nethermind-arbitrum fork as a sibling to op-full-node. Bundles L1+L2 by default, supports external-L1 mode via four URL flags. Mirrors Nimbus's split-service init pattern for snapshot extraction. Reuses sedge's existing L2 port constants.
The Nimbus-inspired split-init pattern broke nitro sync: after the arbitrum-init container exited, the main arbitrum container started without --init.empty=true and entered a confused state where it polled message results without sending new messages. Reference nethermind-arbitrum/docker-compose.yml runs a single nitro service with --init.empty=true on first boot, then nitro reuses existing state on restart. Collapsing the split matches that. Also fixes the healthcheck: nethermind container has no nc/curl but does have bash, so use bash /dev/tcp form instead of 'nc -z'. Verified end-to-end against L1 mainnet: nitro reads sequencer batches from the parent chain and feeds messages to nethermind-arbitrum via engine API; L2 chain head advances each time a new batch arrives.
Comment on lines
+33
to
+61
| name: Publish to Docker Hub | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v3 | ||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Log in to Docker Hub | ||
| if: success() | ||
| run: echo "${{ secrets.DOCKER_ACCESS_TOKEN }}" | docker login --username "${{ secrets.DOCKER_USERNAME }}" --password-stdin | ||
| - name: Build and push image to Docker Hub (staging) | ||
| run: | | ||
| branch=$(echo "${{ github.ref }}" | sed -e "s/refs\/heads\///g") | ||
| original_tag=${{ github.event.inputs.tag || '$branch' }} | ||
| tag=$(echo "$original_tag" | sed 's/\//-/g') # replace '/' with '-' in tag name | ||
| build_timestamp=$(date '+%s') | ||
| echo "Building image with tag $tag" | ||
|
|
||
| docker buildx build --platform=linux/amd64,linux/arm64 \ | ||
| -f ${{ github.event.inputs.dockerfile || 'Dockerfile' }} \ | ||
| -t "sedge/${{ github.event.inputs.image-name || 'sedge' }}:$tag" \ | ||
| --build-arg BUILD_CONFIG=${{ github.event.inputs.build-config || 'release' }} \ | ||
| --build-arg BUILD_TIMESTAMP=$build_timestamp \ | ||
| --build-arg COMMIT_HASH=$GITHUB_SHA . --push | ||
| - name: Clear Docker cache | ||
| if: always() | ||
| run: rm -f $HOME/.docker/config.json No newline at end of file |
| - name: Check out repository | ||
| uses: actions/checkout@v3 | ||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 |
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 |
Comment on lines
+66
to
+148
| runs-on: ubuntu-latest | ||
| outputs: | ||
| base_tag: ${{ steps.set-base-tag.outputs.base_tag }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: feat/networks | ||
|
|
||
| - name: Prepare docker tag | ||
| id: prepare_ref | ||
| run: | | ||
| REF_NAME=${{ github.ref }} | ||
| CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') | ||
| echo "CLEAN_REF=$CLEAN_REF" >> $GITHUB_ENV | ||
|
|
||
| - name: Set BASE_TAG | ||
| id: set-base-tag | ||
| env: | ||
| GITHUB_USERNAME: ${{ github.actor }} | ||
| run: | | ||
| BASE_TAG="${GITHUB_USERNAME:0:1}$(shuf -i 1000-9999 -n 1)" | ||
| echo "BASE_TAG=$BASE_TAG" >> $GITHUB_ENV | ||
| echo "base_tag=$BASE_TAG" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Creating a node with NodeName="DevNode-${{ github.actor }}-${{ env.BASE_TAG }}-${{ env.CLEAN_REF }}-${{ inputs.network }}-${{ inputs.cl_client }}" | ||
| run: echo "NodeName='DevNode-${{ github.actor }}-${{ env.BASE_TAG }}-${{ env.CLEAN_REF }}-${{ inputs.network }}-${{ inputs.cl_client }}'" | ||
|
|
||
| - name: Extract dockerfile from additional_options | ||
| id: extract_dockerfile | ||
| run: | | ||
| echo "dockerfile=$(echo '${{ inputs.additional_options }}' | jq -r .default_dockerfile)" >> $GITHUB_OUTPUT | ||
| echo "build-config=$(echo '${{ inputs.additional_options }}' | jq -r .default_dockerfile_build_type | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Set Repo and Org Variables | ||
| run: | | ||
| echo "ORG_NAME=${{ github.repository_owner }}" >> $GITHUB_ENV | ||
| echo "REPO_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV | ||
|
|
||
| - name: Check if master branch and default additional_options | ||
| id: check_conditions | ||
| run: | | ||
| if | ||
| [[ "${{ github.ref }}" == "refs/heads/master" ]] && | ||
| [[ "${{ steps.extract_dockerfile.outputs.dockerfile }}" == "Dockerfile" ]] && | ||
| [[ "${{ steps.extract_dockerfile.outputs.build-config }}" == "release" ]]; then | ||
| echo "skip_docker_build=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "skip_docker_build=false" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Trigger Docker Build Action with Cleaned Ref | ||
| if: steps.check_conditions.outputs.skip_docker_build != 'true' | ||
| uses: benc-uk/workflow-dispatch@v1 | ||
| env: | ||
| ADDITIONAL_OPTIONS: ${{ inputs.additional_options }} | ||
| with: | ||
| workflow: publish-docker.yml | ||
| ref: "${{ github.ref }}" | ||
| token: "${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" | ||
| inputs: '{ | ||
| "tag": "${{ env.CLEAN_REF }}", | ||
| "dockerfile": "${{ steps.extract_dockerfile.outputs.dockerfile }}", | ||
| "build-config": "${{ steps.extract_dockerfile.outputs.build-config }}" | ||
| }' | ||
|
|
||
| - name: Wait for Docker Build Action to complete | ||
| if: steps.check_conditions.outputs.skip_docker_build != 'true' | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} | ||
| WORKFLOW_ID: 'publish-docker.yml' | ||
| MAX_WAIT_MINUTES: '5' | ||
| INTERVAL: '5' | ||
| TIMEOUT: '10' | ||
| ORG_NAME: ${{ env.ORG_NAME }} | ||
| REPO_NAME: ${{ env.REPO_NAME }} | ||
| REF: ${{ github.ref }} | ||
| run: | | ||
| chmod +x scripts/wait-for-workflow-completed.sh | ||
| ./scripts/wait-for-workflow-completed.sh | ||
| working-directory: ${{ github.workspace }} | ||
|
|
||
| trigger_node_and_vm_creation: |
|
|
||
| - name: Trigger Docker Build Action with Cleaned Ref | ||
| if: steps.check_conditions.outputs.skip_docker_build != 'true' | ||
| uses: benc-uk/workflow-dispatch@v1 |
Comment on lines
+149
to
+217
| needs: create_docker_image | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: feat/networks | ||
|
|
||
| - name: Prepare docker tag | ||
| id: prepare_ref | ||
| run: | | ||
| REF_NAME=${{ github.ref }} | ||
| CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') | ||
|
|
||
| echo "CLEAN_REF=$CLEAN_REF" >> $GITHUB_ENV | ||
|
|
||
| - name: Extract Variables | ||
| id: extract_variables | ||
| run: | | ||
| echo "BASE_TAG=${{ needs.create_docker_image.outputs.base_tag }}" >> $GITHUB_ENV | ||
| echo "timeout=$(echo '${{ inputs.additional_options }}' | jq -r .timeout)" >> $GITHUB_OUTPUT | ||
| echo "ssh_keys=$(echo '${{ inputs.additional_options }}' | jq -r .ssh_keys)" >> $GITHUB_OUTPUT | ||
| echo "allowed_ips=$(echo '${{ inputs.additional_options }}' | jq -r .allowed_ips)" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Trigger Node creation Repo Action | ||
| uses: benc-uk/workflow-dispatch@v1 | ||
| with: | ||
| workflow: run-single-node.yml | ||
| repo: NethermindEth/post-merge-smoke-tests | ||
| ref: "main" | ||
| token: "${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" | ||
| inputs: '{ | ||
| "github_username": "${{ github.actor }}", | ||
| "base_tag": "${{ env.BASE_TAG }}", | ||
| "config_file": "${{ inputs.config }}", | ||
| "nethermind_branch": "${{ env.CLEAN_REF }}", | ||
| "network": "${{ inputs.network }}", | ||
| "cl_client": "${{ inputs.cl_client }}", | ||
| "additional_options": "{\"cl_custom_image\":\"${{ inputs.cl_custom_image }}\", \"timeout\":\"${{ steps.extract_variables.outputs.timeout }}\", \"non_validator_mode\":${{ inputs.non_validator_mode }}, \"additional_nethermind_flags\":\"${{ inputs.additional_nethermind_flags }}\", \"additional_cl_flags\":\"${{ inputs.additional_cl_flags }}\", \"ssh_keys\":\"${{ steps.extract_variables.outputs.ssh_keys }}\", \"allowed_ips\":\"${{ steps.extract_variables.outputs.allowed_ips }}\"}" | ||
| }' | ||
|
|
||
| - name: Wait for creation of node | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} | ||
| WORKFLOW_ID: 'run-single-node.yml' | ||
| MAX_WAIT_MINUTES: '5' | ||
| INTERVAL: '5' | ||
| TIMEOUT: '20' | ||
| ORG_NAME: 'NethermindEth' | ||
| REPO_NAME: 'post-merge-smoke-tests' | ||
| REF: 'main' | ||
| run: | | ||
| chmod +x scripts/wait-for-workflow-completed.sh | ||
| ./scripts/wait-for-workflow-completed.sh | tee script-output.txt | ||
| run_id=$(grep -oP 'Run ID: \K\d+' script-output.txt) | ||
| echo "Run ID extracted is: $run_id" | ||
| echo "RUN_ID=$run_id" >> $GITHUB_ENV | ||
| working-directory: ${{ github.workspace }} | ||
|
|
||
| - name: Download machine specs artifact | ||
| run: | | ||
| ARTIFACT_ID=$(curl -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" https://api.github.com/repos/NethermindEth/post-merge-smoke-tests/actions/runs/${{ env.RUN_ID }}/artifacts | jq '.artifacts[0].id') | ||
| curl -L -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" -o artifact.zip https://api.github.com/repos/NethermindEth/post-merge-smoke-tests/actions/artifacts/$ARTIFACT_ID/zip | ||
| unzip artifact.zip -d ./downloaded-artifacts/ | ||
|
|
||
| - name: Display machine specs content | ||
| run: | | ||
| FILE=$(ls downloaded-artifacts/machine-details | head -n 1) | ||
| cat "downloaded-artifacts/machine-details/$FILE" No newline at end of file |
| echo "allowed_ips=$(echo '${{ inputs.additional_options }}' | jq -r .allowed_ips)" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Trigger Node creation Repo Action | ||
| uses: benc-uk/workflow-dispatch@v1 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes:
-added xdc to sedge generator
Types of changes