Skip to content

perf: convert U256 <-> Address/Hash a word at a time, not a byte at a time #350

perf: convert U256 <-> Address/Hash a word at a time, not a byte at a time

perf: convert U256 <-> Address/Hash a word at a time, not a byte at a time #350

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
build-and-test:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
zig-version: ['0.16.0']
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Zig
uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1
with:
version: ${{ matrix.zig-version }}
- name: Verify Zig installation
run: zig version
- name: Check formatting
run: zig fmt --check src/ tools/
- name: Install dependencies
run: make install-deps
- name: Verify blst headers (macOS)
if: runner.os == 'macOS'
run: |
if [ -f /tmp/blst/bindings/blst.h ]; then
echo "blst.h found at /tmp/blst/bindings/blst.h"
elif [ -f /opt/homebrew/include/blst/blst.h ]; then
echo "blst.h found at /opt/homebrew/include/blst/blst.h"
elif [ -f /usr/local/include/blst/blst.h ]; then
echo "blst.h found at /usr/local/include/blst/blst.h"
else
find /tmp/blst -name "blst.h" 2>/dev/null || echo "No blst.h in /tmp/blst"
exit 1
fi
- name: Build
run: zig build install
- name: Run unit tests
env:
DYLD_LIBRARY_PATH: /opt/homebrew/lib:/usr/local/lib
run: zig build test
zkevm-tests:
name: zkEVM Tests
runs-on: ubuntu-latest
strategy:
matrix:
zig-version: ['0.16.0']
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Zig
uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1
with:
version: ${{ matrix.zig-version }}
- name: Install dependencies
run: make install-deps
- name: Build
run: zig build install
- name: Cache zkEVM fixtures
id: zkevm-fixtures-cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: spec-tests/fixtures/zkevm
key: zkevm-fixtures-${{ hashFiles('build.zig') }}
- name: Fetch zkEVM fixtures
if: steps.zkevm-fixtures-cache.outputs.cache-hit != 'true'
run: zig build fetch-zkevm-fixtures
- name: Run zkEVM tests
run: ./zig-out/bin/zkevm-blockchain-test-runner
blockchain-tests:
name: Blockchain Tests (${{ matrix.suite }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
suite:
- for_amsterdam
- for_bpo2toamsterdamattime15k
- for_osaka
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Zig
uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1
with:
version: '0.16.0'
- name: Install dependencies
run: make install-deps
- name: Build
run: zig build install
- name: Cache blockchain fixtures
id: fixtures-cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: spec-tests/fixtures/blockchain_tests
key: blockchain-fixtures-${{ hashFiles('build.zig') }}
- name: Fetch blockchain test fixtures
if: steps.fixtures-cache.outputs.cache-hit != 'true'
run: zig build fetch-fixtures
- name: Run blockchain tests (${{ matrix.suite }})
run: |
./zig-out/bin/blockchain-test-runner \
--fixtures spec-tests/fixtures/blockchain_tests/${{ matrix.suite }}
blockchain-tests-result:
name: Blockchain Tests
if: always()
needs: blockchain-tests
runs-on: ubuntu-latest
steps:
- name: Check all suites passed
run: |
if [ "${{ needs.blockchain-tests.result }}" != "success" ]; then
echo "One or more blockchain test suites failed"
exit 1
fi
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Zig
uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1
with:
version: '0.16.0'
- name: Format check
run: zig fmt --check src/ tools/