Skip to content

perf(params): validate ConsensusParams once per change set (CON-312) #8553

perf(params): validate ConsensusParams once per change set (CON-312)

perf(params): validate ConsensusParams once per change set (CON-312) #8553

name: Cross-Architecture Build Test
on:
pull_request:
merge_group:
push:
branches:
- main
- release/**
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
env:
LEDGER_ENABLED: false
jobs:
linux-amd64:
name: "Linux AMD64"
runs-on: ubuntu-latest
steps:
- name: Checkout code
# See: https://github.com/actions/checkout/releases/tag/v7.0.0
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.25.6'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential
- name: Verify Go installation
run: |
go version
echo "GOARCH: $(go env GOARCH)"
echo "GOOS: $(go env GOOS)"
- name: Download Go dependencies
run: go mod download
- name: Run make install
run: make install
- name: Verify install binary
run: seid version --long
- name: Run make build
run: make build
- name: Verify build binary
run: ./build/seid version --long
# Detect PRs that change the static-build inputs so they run the full static
# job below even when targeting main; otherwise a change to the static build
# only gets exercised once it reaches a release branch.
static-paths:
name: "Static build inputs changed?"
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
outputs:
changed: ${{ steps.diff.outputs.changed }}
steps:
- id: diff
env:
GH_TOKEN: ${{ github.token }}
run: |
PATTERN='^(scripts/(build-static|boot-smoke|check-libwasmvm-static)\.sh|Makefile|third_party/alpine-gcc10-libgcc/|\.goreleaser\.yaml|\.github/workflows/cross-arch-build\.yml)'
FILES=$(gh api "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" --paginate -q '.[].filename')
if echo "$FILES" | grep -qE "$PATTERN"; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi
echo "static-relevant files: $(echo "$FILES" | grep -cE "$PATTERN" || true)"
linux-amd64-static:
name: "Linux AMD64 (static)"
runs-on: ubuntu-latest
needs: [static-paths]
# The static seid is a release artefact: build it for release work (PRs into
# release/**, pushes to release/**, merge-queue entries targeting release/**)
# and for any PR that changes the static-build inputs themselves. The
# !cancelled() keeps this job eligible when static-paths is skipped (push and
# merge_group events).
if: >-
!cancelled() && (
startsWith(github.base_ref, 'release/') ||
startsWith(github.ref, 'refs/heads/release/') ||
startsWith(github.event.merge_group.base_ref, 'refs/heads/release/') ||
needs.static-paths.outputs.changed == 'true' )
steps:
- name: Checkout code
# See: https://github.com/actions/checkout/releases/tag/v7.0.0
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
# Build inside Alpine (musl-native): Ubuntu's musl-gcc can't fully static-link
# on 24.04 (glibc libgcc -> _dl_find_object, absent in musl), and zig cc rejects
# the -z muldefs flag needed to link the libwasmvm v152/v155 archives. Alpine's
# gcc is GNU ld + musl, so it links cleanly. Same script the goreleaser release
# build runs (scripts/build-static.sh); goreleaser then packages it via the tool shim.
- name: Build statically (Alpine / musl)
run: bash scripts/build-static.sh
- name: Assert binary is statically linked
run: |
info=$(file ./build/seid)
echo "$info"
echo "$info" | grep -q "statically linked" \
|| { echo "ERROR: seid is not statically linked"; exit 1; }
- name: Assert no dynamic dependencies
run: |
# On a true static binary, ldd reports "not a dynamic executable".
ldd ./build/seid 2>&1 | grep -qE "not a dynamic|statically linked" \
|| { echo "ERROR: seid has dynamic dependencies:"; ldd ./build/seid; exit 1; }
- name: Smoke test
run: ./build/seid version --long
# Repeated boots: the gcc>=12 unwind b-tree crash killed ~70% of boots at the
# genesis wasm store, so a single boot (let alone `seid version`, which never
# touches the wasm VM) can pass on luck. See scripts/boot-smoke.sh.
- name: Boot smoke (repeated)
run: bash scripts/boot-smoke.sh ./build/seid 8
- name: Upload artifact for inspection
uses: actions/upload-artifact@v5
with:
name: seid-linux-amd64-static
path: ./build/seid
retention-days: 14
macos-arm64:
name: "macOS ARM64"
runs-on: macos-latest
steps:
- name: Checkout code
# See: https://github.com/actions/checkout/releases/tag/v7.0.0
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
submodules: true
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.25.6'
- name: Install system dependencies
run: |
xcode-select --version || xcode-select --install
- name: Verify Go installation
run: |
go version
echo "GOARCH: $(go env GOARCH)"
echo "GOOS: $(go env GOOS)"
- name: Download Go dependencies
run: go mod download
- name: Run make install
run: make install
- name: Verify install binary
run: seid version --long
- name: Run make build
run: make build
- name: Verify build binary
run: ./build/seid version --long