Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
72 changes: 72 additions & 0 deletions .github/workflows/polytopelabs-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Polytopelabs Docker Publish

on:
push:
tags:
- "node-ethereum/v[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
isLatest:
description: "Add latest tag"
default: "true"
required: true

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true

jobs:
build_and_publish:
runs-on: release-runner
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 100
token: ${{ secrets.GH_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

## node
- name: Get updated node version
id: get-node-version
run: |
sh .github/workflows/scripts/nodeVersion.sh

- run: yarn
- name: build
run: yarn build

- name: Build and push
if: github.event_name == 'workflow_dispatch' && github.event.inputs.isLatest == 'false'
uses: docker/build-push-action@v2
with:
context: .
push: true
platforms: arm64,amd64
file: ./packages/node/Dockerfile
tags: polytopelabs/subql-node-ethereum:v${{ steps.get-node-version.outputs.NODE_VERSION }}
build-args: RELEASE_VERSION=${{ steps.get-node-version.outputs.NODE_VERSION }}

- name: Build and push
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.isLatest == 'true')
uses: docker/build-push-action@v2
with:
context: .
push: true
platforms: arm64,amd64
file: ./packages/node/Dockerfile
tags: polytopelabs/subql-node-ethereum:v${{ steps.get-node-version.outputs.NODE_VERSION }},polytopelabs/subql-node-ethereum:latest
build-args: RELEASE_VERSION=${{ steps.get-node-version.outputs.NODE_VERSION }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
7 changes: 6 additions & 1 deletion packages/node/src/ethereum/api.ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,12 @@ export class EthereumApi implements ApiWrapper {

const block = formatBlock(rawBlock);

block.stateRoot = this.client.formatter.hash(block.stateRoot);
try {
block.stateRoot = this.client.formatter.hash(block.stateRoot);
} catch (error) {
// Use zero hash if formatting fails
block.stateRoot = '0x0000000000000000000000000000000000000000000000000000000000000000';
}

return block;
}
Expand Down
Loading