sync: mirror deployed github repo (chains + sanitized bridge), keep GitLab CI

Make this monorepo's tracked tree identical to the deployed github repo
(github.com/pezkuwichain/pezkuwi-DKS): all RC/AH/People runtimes and framework
carry the mainnet fixes (incl. U128CurrencyToVote everywhere, so the staking
election stall cannot recur), and tools/usdt-bridge matches the current,
public-safe custody tooling (real config/deploy units gitignored, secret-file
locations and server IPs stripped, sanitized *.example templates committed).

Only exception to the mirror: GitLab-native CI is preserved (.gitlab-ci.yml and
.gitlab/), to be rebuilt to match the github CI pipeline in a follow-up.
This commit is contained in:
Satoshi Qazi Muhammed committed 2026-07-24 11:42:50 -07:00
1 parent 82543bdfab
commit d285d59108
736 files changed
+15082 -16359

No files matched your search

+7
View File
@@ -10,6 +10,13 @@ CC_x86_64_unknown_linux_musl = { value = ".cargo/musl-gcc", force = true, relati
CXX_x86_64_unknown_linux_musl = { value = ".cargo/musl-g++", force = true, relative = true }
CARGO_WORKSPACE_ROOT_DIR = { value = "", relative = true }
SQLX_OFFLINE = "true"
# Rust 1.96 removed the implicit `--allow-undefined` from wasm linking
# (https://blog.rust-lang.org/2026/04/04/changes-to-webassembly-targets-and-handling-undefined-symbols/).
# Bizinikiwi/Substrate runtimes import their host functions (`ext_*`) as undefined
# wasm symbols resolved by the executor at runtime, so we restore that behavior for
# the runtime wasm build. wasm-builder appends WASM_BUILD_RUSTFLAGS to the runtime's
# wasm RUSTFLAGS; the resulting WASM is import-identical to the previous toolchain.
WASM_BUILD_RUSTFLAGS = "-Clink-arg=--allow-undefined"
[net]
retry = 5
+18
View File
@@ -123,3 +123,21 @@ serial-integration = { max-threads = 1 }
[[profile.default.overrides]]
filter = 'test(/(^ui$|_ui|ui_)/)'
test-group = 'serial-integration'
# The snowbridge ethereum-client tests load large beacon-chain fixtures and run BLS over a
# 512-key sync committee. They pass in isolation but aborted under full-suite concurrency on
# the capped self-hosted runners (memory pressure). Reserve all threads so each runs alone,
# without concurrent contention.
[[profile.default.overrides]]
filter = 'package(pezsnowbridge-pezpallet-ethereum-client)'
threads-required = 'num-cpus'
# benchmark_extrinsic_works spins up a full dev node (BABE + block-import workers) for every
# runtime/extrinsic pair to smoke-test the `benchmark extrinsic` command. Under full-suite
# concurrency on the capped self-hosted runners its node's essential consensus tasks get
# starved and the service shuts down ("Essential task failed"). Give it the whole runner so
# the node has the resources to run — it is a heavy end-to-end node test, not a unit test.
[[profile.default.overrides]]
filter = 'test(benchmark_extrinsic_works)'
threads-required = 'num-cpus'
slow-timeout = { period = "120s", terminate-after = 10 }
-1
View File
@@ -1 +0,0 @@
# CI Clean Run - 2025-12-26T04:55:41Z
-73
View File
@@ -1,73 +0,0 @@
# PezkuwiChain Code Owners
#
# A codeowner oversees part of the codebase. If an owned file is changed,
# the corresponding codeowner receives a review request.
#
# For details about syntax, see:
# https://help.github.com/en/articles/about-code-owners
# Global - Core Team
* @pezkuwichain/core
# Custom Pallets - Pallet Team
/pezkuwi/pallets/ @pezkuwichain/pallets
# Presale Pallet - Critical financial code
/pezkuwi/pallets/presale/ @pezkuwichain/core @pezkuwichain/pallets
# Treasury & Rewards - Financial critical
/pezkuwi/pallets/pez-treasury/ @pezkuwichain/core
/pezkuwi/pallets/pez-rewards/ @pezkuwichain/core
# Identity & KYC - Privacy sensitive
/pezkuwi/pallets/identity-kyc/ @pezkuwichain/core
/pezkuwi/pallets/tiki/ @pezkuwichain/core
# Governance - Critical
/pezkuwi/pallets/welati/ @pezkuwichain/core
# Runtime configurations
/pezkuwi/runtime/ @pezkuwichain/core
# TeyrChain Parachain Runtime
/pezkuwi/runtime/parachain/ @pezkuwichain/core
# PezkuwiChain Relay Runtime
/pezkuwi/runtime/pezkuwichain/ @pezkuwichain/core
# XCM Configuration - Cross-chain critical
/pezkuwi/runtime/parachain/src/configs/xcm_config.rs @pezkuwichain/core
# Chain specifications
/chain-specs/ @pezkuwichain/core
# CI/CD
/.github/ @pezkuwichain/devops
/.gitlab-ci.yml @pezkuwichain/devops
/.gitlab/ @pezkuwichain/devops
# Documentation
/docs/ @pezkuwichain/docs
README.md @pezkuwichain/core
# Scripts
/scripts/ @pezkuwichain/devops
# Substrate Core (inherited from upstream)
/substrate/frame/ @pezkuwichain/core
/substrate/client/ @pezkuwichain/core
/substrate/primitives/ @pezkuwichain/core
# Cumulus (parachain framework)
/cumulus/ @pezkuwichain/core
# Polkadot (relay chain framework)
/polkadot/ @pezkuwichain/core
# XCM
/polkadot/xcm/ @pezkuwichain/core
# Security-sensitive files
Cargo.toml @pezkuwichain/core
Cargo.lock @pezkuwichain/core
rust-toolchain.toml @pezkuwichain/core
-4
View File
@@ -1,4 +0,0 @@
---
name: New blank issue
about: New blank issue
---
+33
View File
@@ -0,0 +1,33 @@
---
name: Bug report
about: Report a problem in a runtime or pallet
title: "[bug] "
labels: ["bug"]
---
## Summary
<!-- A clear description of the bug. -->
## Affected component
<!-- e.g. pezkuwichain-runtime, asset-hub, pezpallet-tiki, zagros testnet -->
## Network
- [ ] Mainnet (PezkuwiChain)
- [ ] Zagros testnet
- [ ] Local / dev
## Steps to reproduce
1.
2.
## Expected vs actual
## Severity
- [ ] Funds at risk / consensus / security ← report privately via SECURITY.md instead
- [ ] Functional bug
- [ ] Minor / cosmetic
-35
View File
@@ -1,35 +0,0 @@
name: Bug Report
description: Let us know about an issue you experienced with this software
labels: [ I2-bug, I10-unconfirmed ]
body:
- type: checkboxes
attributes:
label: Is there an existing issue?
description: Please search to see if an issue already exists and leave a comment that you also experienced this issue or add your specifics that are related to an existing issue.
options:
- label: I have searched the existing issues
required: true
- type: checkboxes
attributes:
label: Experiencing problems? Have you tried our Stack Exchange first?
description: Please search <https://exchange.pezkuwichain.app> to see if an post already exists, and ask if not. Please do not file support issues here.
options:
- label: This is not a support question.
required: true
- type: textarea
id: bug
attributes:
label: Description of bug
description: What seems to be the problem?
# placeholder: Describe the problem.
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to reproduce
description: Provide the steps that led to the discovery of the issue.
# placeholder: Describe what you were doing so we can reproduce the problem.
validations:
required: false
+7 -6
View File
@@ -1,7 +1,8 @@
blank_issues_enabled: true
blank_issues_enabled: false
contact_links:
- name: Support & Troubleshooting with the Bizinikiwi Stack Exchange Community
url: https://exchange.pezkuwichain.io
about: |
For general problems with Bizinikiwi or related technologies, please search here first
for solutions, by keyword and tags. If you discover no solution, please then ask and questions in our community! We highly encourage everyone also share their understanding by answering questions for others.
- name: Security vulnerability
url: https://github.com/pezkuwichain/pezkuwi-DKS/security/policy
about: Do NOT open a public issue. Report security/fund-risk issues privately (see SECURITY.md).
- name: Documentation & developer portal
url: https://docs.pezkuwichain.io
about: Guides and API documentation.
-55
View File
@@ -1,55 +0,0 @@
name: Feature Request
description: Submit your requests and suggestions to improve!
labels: [ I5-enhancement ]
body:
- type: checkboxes
id: existing
attributes:
label: Is there an existing issue?
description: Please search to see if an issue already exists and leave a comment that you also experienced this issue or add your specifics that are related to an existing issue.
options:
- label: I have searched the existing issues
required: true
- type: checkboxes
id: stackexchange
attributes:
label: Experiencing problems? Have you tried our Stack Exchange first?
description: Please search <https://exchange.pezkuwichain.app> to see if an post already exists, and ask if not. Please do not file support issues here.
options:
- label: This is not a support question.
required: true
- type: textarea
id: motivation
attributes:
label: Motivation
description: Please give precedence as to what lead you to file this issue.
# placeholder: Describe ...
validations:
required: false
- type: textarea
id: request
attributes:
label: Request
description: Please describe what is needed.
# placeholder: Describe what you would like to see added or changed.
validations:
required: true
- type: textarea
id: solution
attributes:
label: Solution
description: If possible, please describe what a solution could be.
# placeholder: Describe what you would like to see added or changed.
validations:
required: false
- type: dropdown
id: help
attributes:
label: Are you willing to help with this request?
multiple: true
options:
- Yes!
- No.
- Maybe (please elaborate above)
validations:
required: true
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature / change request
about: Propose a new feature, pallet, or runtime change
title: "[feat] "
labels: ["enhancement"]
---
## Motivation
<!-- What problem does this solve? Who benefits? -->
## Proposed change
## Component
<!-- relay runtime, system parachain, new/existing pezpallet, framework -->
## Runtime / migration impact
<!-- Does this need a runtime upgrade, storage migration, or new weights? -->
+27
View File
@@ -0,0 +1,27 @@
# Description
<!-- What does this PR change, and why? Link any related issue. -->
## Type of change
- [ ] Runtime logic (relay / system parachain)
- [ ] Original pallet (`pezpallet-*`)
- [ ] Framework / dependency
- [ ] Docs / tooling / CI
## Runtime impact
- [ ] This changes on-chain logic / storage / weights
- [ ] `spec_version` bumped (if a runtime upgrade)
- [ ] Storage migration included and tested (if needed)
- [ ] No runtime impact
## Checklist
- [ ] `cargo fmt --all` is clean
- [ ] The affected runtime(s) build (`cargo check -p <runtime>`)
- [ ] Tests added / updated where relevant
- [ ] For fund-affecting changes: reviewed for overflow, weight, and access-control correctness
> ⚠️ This repository powers a live, fund-holding network. Changes to balances, XCM,
> bridges, or weights require extra scrutiny.
-83
View File
@@ -1,83 +0,0 @@
# Zombienet Flaky Tests
This document explains how to manage flaky or temporarily disabled zombienet tests in the Pezkuwi SDK repository.
## Overview
The `.github/zombienet-flaky-tests` file contains a list of zombienet tests that are currently disabled due to flakiness or known issues. These tests are automatically skipped during CI runs but are tracked for future re-enabling.
## File Format
Each line in the `zombienet-flaky-tests` file follows this format:
```
<test-job-name>:<issue-number>
```
**Example:**
```
zombienet-pezkuwi-functional-0014-chunk-fetching-network-compatibility:9980
zombienet-pezcumulus-0009-elastic_scaling_pov_recovery:8986
```
- **test-job-name**: The exact job name as defined in the zombienet test YAML files
- **issue-number**: GitHub issue number tracking the flaky test (for reference and follow-up)
## How It Works
1. **Test Discovery**: The zombienet workflows read the test definitions from:
- `.github/zombienet-tests/zombienet_pezkuwi_tests.yml`
- `.github/zombienet-tests/zombienet_cumulus_tests.yml`
- `.github/zombienet-tests/zombienet_substrate_tests.yml`
- `.github/zombienet-tests/zombienet_teyrchain-template_tests.yml`
2. **Filtering**: During the preflight job, tests listed in `zombienet-flaky-tests` are filtered out from the test matrix.
3. **Execution**: Only non-flaky tests are executed in the CI pipeline.
## Adding a Flaky Test
If you encounter a flaky test that needs to be temporarily disabled:
1. **Create or find a GitHub issue** tracking the flaky behavior
2. **Add an entry** to `.github/zombienet-flaky-tests`:
```
zombienet-<suite>-<test-name>:<issue-number>
```
3. **Commit and push** the change
4. The CI will automatically validate that:
- The entry follows the correct format
- The referenced GitHub issue exists
- (Warning if the issue is closed)
5. The test will be automatically skipped in subsequent CI runs
## Re-enabling a Test
Once a flaky test has been fixed:
1. **Verify the fix** by running the test locally or in a test branch
2. **Remove the entry** from `.github/zombienet-flaky-tests`
3. **Close the associated GitHub issue** (or update it with the fix)
4. **Commit and push** the change
5. The test will be automatically included in subsequent CI runs
## Validation
The `.github/zombienet-flaky-tests` file is automatically validated in CI whenever it's modified. The validation checks:
- **Format**: Each entry must follow the `<test-name>:<issue-number>` format
- **Issue vs PR**: The referenced number must be a GitHub Issue, not a Pull Request
- **Issue existence**: The referenced GitHub issue must exist in the repository
- **Issue state**: A warning is shown if the referenced issue is closed (suggesting the entry might be outdated)
The validation workflow runs on pull requests that modify:
- `.github/zombienet-flaky-tests`
- `.github/scripts/check-zombienet-flaky-tests.sh`
- `.github/workflows/check-zombienet-flaky-tests.yml`
## Monitoring
- The number of currently disabled tests is displayed in the CI logs during zombienet test runs
- You can view the current list at: [`.github/zombienet-flaky-tests`](./zombienet-flaky-tests)
- Each disabled test should have an associated GitHub issue for tracking
- The validation script can be run locally: `.github/scripts/check-zombienet-flaky-tests.sh .github/zombienet-flaky-tests`
@@ -1,43 +0,0 @@
name: "build and push image"
inputs:
dockerfile:
description: "dockerfile to build"
required: true
image-name:
description: "image name (without registry)"
required: true
username:
required: false
default: ""
password:
required: false
default: ""
runs:
using: "composite"
steps:
- name: login to dockerhub
id: login
if: ${{ inputs.username != '' && inputs.password != '' }}
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
username: ${{ inputs.username }}
password: ${{ inputs.password }}
- name: build
shell: bash
env:
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.105"
IMAGE_TAG: docker.io/pezkuwi/${{ inputs.image-name }}
run: |
export DOCKER_IMAGES_VERSION=${{ github.event.pull_request.head.sha || 'main' }}
if [[ ${{ github.event_name }} == "merge_group" ]]; then export DOCKER_IMAGES_VERSION="${GITHUB_SHA::8}"; fi
docker build \
--build-arg VCS_REF="${GITHUB_SHA}" \
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \
--build-arg IMAGE_NAME="${{ inputs.image-name }}" \
--build-arg ZOMBIENET_IMAGE="${ZOMBIENET_IMAGE}" \
-t "${{ env.IMAGE_TAG }}:$DOCKER_IMAGES_VERSION" \
-f ${{ inputs.dockerfile }} \
.
docker push "${{ env.IMAGE_TAG }}:$DOCKER_IMAGES_VERSION"
@@ -1,20 +0,0 @@
name: 'cargo check runtimes'
description: 'Runs `cargo check` for every directory in provided root.'
inputs:
root:
description: "Root directory. Expected to contain several cargo packages inside."
required: true
runs:
using: "composite"
steps:
- name: Check
shell: bash
run: |
cd ${{ inputs.root }}
for directory in $(echo */); do
echo "_____Running cargo check for ${directory} ______";
cd ${directory};
pwd;
SKIP_WASM_BUILD=1 cargo check --locked;
cd ..;
done
@@ -1,98 +0,0 @@
name: "Download and extract artifact"
description: "Downloads an artifact, extracts it, and optionally copies files to a destination"
inputs:
artifact-name:
description: "Name of the artifact to download"
required: true
gh-token:
description: "GITHUB_TOKEN to use for downloading artifacts"
required: true
run-id:
description: "Run ID from which to download the artifact"
required: true
extract-path:
description: "Path where to extract the artifact"
default: "."
required: false
files-to-copy:
description: "Comma-separated (or newline-separated, remember about |) list of files to copy from the extracted artifact"
required: false
destination-path:
description: "Destination path for copied files"
required: false
cleanup:
description: "Whether to remove downloaded artifacts after copying (true/false)"
required: false
default: "false"
runs:
using: "composite"
steps:
- name: Download artifact
shell: bash
run: |
echo "::group::📦 Downloading ${{ inputs.artifact-name }}"
echo "Artifact: ${{ inputs.artifact-name }}"
echo "Run ID: ${{ inputs.run-id }}"
echo "::endgroup::"
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: ${{ inputs.artifact-name }}
github-token: ${{ inputs.gh-token }}
run-id: ${{ inputs.run-id }}
path: ${{ inputs.extract-path }}
- name: Extract artifact
shell: bash
working-directory: ${{ inputs.extract-path }}
run: |
echo "::group::📂 Extracting ${{ inputs.artifact-name }}"
if [[ -f artifacts.tar ]]; then
tar -xvf artifacts.tar
elif [[ -f *.tar ]]; then
tar -xvf *.tar
elif [[ -f *.tar.gz ]]; then
tar -xzvf *.tar.gz
elif [[ -f *.tgz ]]; then
tar -xzvf *.tgz
elif [[ -f *.zip ]]; then
unzip *.zip
else
echo "⚠️ No archive file found to extract"
ls -la
fi
echo "::endgroup::"
- name: Copy files if specified
if: inputs.files-to-copy != ''
env:
FILES_TO_COPY: ${{ inputs.files-to-copy }}
DESTINATION_PATH: ${{ inputs.destination-path }}
EXTRACT_PATH: ${{ inputs.extract-path }}
CLEANUP: ${{ inputs.cleanup }}
shell: bash
run: |
echo "::group::📋 Copying files from ${{ inputs.artifact-name }}"
# Create destination directory
mkdir -p "$DESTINATION_PATH"
FILE_COUNT=0
echo "$FILES_TO_COPY" | tr ',' '\n' | while read -r file; do
# trim leading and trailing whitespaces
file="$(echo "$file" | xargs)"
if [[ -n "$file" ]]; then
echo "✓ Copying $(basename "$file") to $DESTINATION_PATH"
cp -r "$EXTRACT_PATH/$file" "$DESTINATION_PATH/"
FILE_COUNT=$((FILE_COUNT + 1))
fi
done
# Cleanup if requested
if [[ "$CLEANUP" == "true" ]]; then
echo "🧹 Cleaning up temporary files in $EXTRACT_PATH"
rm -rf "$EXTRACT_PATH"
fi
echo "::endgroup::"
@@ -1,49 +0,0 @@
name: 'Free Disk Space'
description: 'Frees up disk space on GitHub Actions runners by removing unnecessary software'
runs:
using: 'composite'
steps:
- name: Free Disk Space (Ubuntu)
shell: bash
run: |
echo "=== Disk space before cleanup ==="
df -h /
echo "=== Removing unnecessary packages ==="
# Remove Android SDK (12GB+)
sudo rm -rf /usr/local/lib/android || true
# Remove .NET SDK (2GB+)
sudo rm -rf /usr/share/dotnet || true
# Remove Haskell/GHC (5GB+)
sudo rm -rf /opt/ghc || true
sudo rm -rf /usr/local/.ghcup || true
# Remove Swift (1.5GB+)
sudo rm -rf /usr/share/swift || true
# Remove CodeQL (1GB+)
sudo rm -rf /opt/hostedtoolcache/CodeQL || true
# Remove unused tool caches
sudo rm -rf /opt/hostedtoolcache/Python || true
sudo rm -rf /opt/hostedtoolcache/Ruby || true
sudo rm -rf /opt/hostedtoolcache/go || true
sudo rm -rf /opt/hostedtoolcache/node || true
# Remove large packages
sudo apt-get remove -y '^dotnet-.*' '^llvm-.*' 'php.*' '^mongodb-.*' '^mysql-.*' azure-cli google-cloud-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing 2>/dev/null || true
sudo apt-get autoremove -y 2>/dev/null || true
sudo apt-get clean 2>/dev/null || true
# Remove Docker images
docker system prune -af 2>/dev/null || true
# Remove swap (1GB+)
sudo swapoff -a || true
sudo rm -f /swapfile || true
echo "=== Disk space after cleanup ==="
df -h /
-23
View File
@@ -1,23 +0,0 @@
name: "Rust Cache"
description: "Setup Rust caching for CI jobs"
inputs:
cache-key:
description: "Additional cache key"
required: false
default: ""
workspaces:
description: "Workspace paths to cache"
required: false
default: ". -> target"
runs:
using: "composite"
steps:
- name: Setup Rust cache
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
with:
shared-key: pezkuwi-${{ inputs.cache-key }}
workspaces: ${{ inputs.workspaces }}
cache-on-failure: true
cache-all-crates: true
-28
View File
@@ -1,28 +0,0 @@
name: "install gh"
description: "Install the gh cli in a debian based distro and switches to the PR branch."
inputs:
pr-number:
description: "Number of the PR"
required: true
GH_TOKEN:
description: "GitHub token"
required: true
outputs:
branch:
description: "Branch name for the PR"
value: ${{ steps.branch.outputs.branch }}
runs:
using: "composite"
steps:
- name: Set up git
shell: bash
# Here it would get the script from previous step
run: git config --global --add safe.directory '*'
- run: gh pr checkout ${{ inputs.pr-number }}
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.GH_TOKEN }}
- name: Export branch name
shell: bash
run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_OUTPUT"
id: branch
@@ -1,28 +0,0 @@
name: "stop all workflows"
description: "Action stops all workflows in a PR to save compute resources."
inputs:
app-id:
description: "App id"
required: true
app-key:
description: "App token"
required: true
runs:
using: "composite"
steps:
- name: Worfklow stopper - Generate token
uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0
id: app-token
with:
app-id: ${{ inputs.app-id }}
private-key: ${{ inputs.app-key }}
owner: "pezkuwichain"
repositories: "workflow-stopper"
- name: Workflow stopper - Stop all workflows
uses: octokit/request-action@v2.x
with:
route: POST /repos/pezkuwichain/workflow-stopper/actions/workflows/stopper.yml/dispatches
ref: main
inputs: '${{ format(''{{ "github_sha": "{0}", "github_repository": "{1}", "github_ref_name": "{2}", "github_workflow_id": "{3}", "github_job_name": "{4}" }}'', github.event.pull_request.head.sha, github.repository, github.ref_name, github.run_id, github.job) }}'
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
-15
View File
@@ -1,15 +0,0 @@
coverage:
precision: 2
round: down
range: "1...100"
status:
project:
default:
target: 1.0
threshold: 2.0
comment:
behavior: new
fixes:
- "/__w/pezkuwi-sdk/pezkuwi-sdk/::"
-1
View File
@@ -1 +0,0 @@
IMAGE="ghcr.io/pezkuwichain/ci-unified:bullseye-1.88.0-2025-06-27-v202511141243"
-1
View File
@@ -1 +0,0 @@
../docs/contributor/PULL_REQUEST_TEMPLATE.md
-17
View File
@@ -1,17 +0,0 @@
{
"pallets": {
"1": {
"constants": {
"EpochDuration": {
"value": [ 88, 2, 0, 0, 0, 0, 0, 0 ]}
}
},
"2": {
"constants": {
"MinimumPeriod": {
"value": [ 184, 11, 0, 0, 0, 0, 0, 0 ]}
}
}
}
}
-17
View File
@@ -1,17 +0,0 @@
{
"pallets": {
"1": {
"constants": {
"EpochDuration": {
"value": [ 88, 2, 0, 0, 0, 0, 0, 0 ]}
}
},
"2": {
"constants": {
"MinimumPeriod": {
"value": [ 184, 11, 0, 0, 0, 0, 0, 0 ]}
}
}
}
}
-214
View File
@@ -1,214 +0,0 @@
name: Bench all runtimes
on:
# schedule:
# - cron: '0 1 * * 0' # weekly on Sunday night 01:00 UTC
workflow_dispatch:
inputs:
draft:
type: boolean
default: false
description: "Whether to create a draft PR"
permissions: # allow the action to create a PR
contents: write
issues: write
pull-requests: write
actions: read
jobs:
preflight:
uses: ./.github/workflows/reusable-preflight.yml
runtime-matrix:
runs-on: ubuntu-latest
needs: [preflight]
timeout-minutes: 30
outputs:
runtime: ${{ steps.runtime.outputs.runtime }}
branch: ${{ steps.branch.outputs.branch }}
date: ${{ steps.branch.outputs.date }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
name: Extract runtimes from matrix
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: master
- name: Extract runtimes
id: runtime
run: |
RUNTIMES=$(jq '[.[] | select(.package != null)]' .github/workflows/runtimes-matrix.json)
RUNTIMES=$(echo $RUNTIMES | jq -c .)
echo "runtime=$RUNTIMES"
echo "runtime=$RUNTIMES" >> $GITHUB_OUTPUT
- name: Create branch
id: branch
run: |
DATE=$(date +'%Y-%m-%d-%s')
BRANCH="update-weights-weekly-$DATE"
# Fixes "detected dubious ownership" error in the ci
git config --global --add safe.directory $GITHUB_WORKSPACE
git checkout -b $BRANCH
git push --set-upstream origin $BRANCH
echo "date=$DATE" >> $GITHUB_OUTPUT
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
run-pezframe-omni-bencher:
needs: [preflight, runtime-matrix]
runs-on: ${{ needs.preflight.outputs.RUNNER_WEIGHTS }}
# 24 hours per runtime.
# Max it takes 14hr for zagros to recalculate, but due to limited runners,
# sometimes it can take longer.
timeout-minutes: 1440
strategy:
fail-fast: false # keep running other workflows even if one fails, to see the logs of all possible failures
matrix:
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
PACKAGE_NAME: ${{ matrix.runtime.package }}
FLAGS: ${{ matrix.runtime.bench_flags }}
RUST_LOG: "frame_omni_bencher=info,pezkuwi_sdk_frame=info"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
ref: ${{ needs.runtime-matrix.outputs.branch }} # checkout always from the initially created branch to avoid conflicts
- name: script
id: required
run: |
git --version
# Fixes "detected dubious ownership" error in the ci
git config --global --add safe.directory $GITHUB_WORKSPACE
git remote -v
python3 -m pip install -r .github/scripts/generate-prdoc.requirements.txt
python3 .github/scripts/cmd/cmd.py bench --runtime ${{ matrix.runtime.name }}
git add .
git status
if [ -f /tmp/cmd/command_output.log ]; then
CMD_OUTPUT=$(cat /tmp/cmd/command_output.log)
# export to summary to display in the PR
echo "$CMD_OUTPUT" >> $GITHUB_STEP_SUMMARY
# should be multiline, otherwise it captures the first line only
echo 'cmd_output<<EOF' >> $GITHUB_OUTPUT
echo "$CMD_OUTPUT" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
fi
# Create patch that includes both modifications and new files
git add -A
git diff --staged > diff-${{ matrix.runtime.name }}.patch -U0
git reset
- name: Upload diff
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: diff-${{ matrix.runtime.name }}
path: diff-${{ matrix.runtime.name }}.patch
apply-diff-commit:
runs-on: ubuntu-latest
needs: [runtime-matrix, run-pezframe-omni-bencher]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
ref: ${{ needs.runtime-matrix.outputs.branch }}
- name: Download all artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
path: patches
# needs to be able to trigger CI
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
id: generate_token
with:
app-id: ${{ secrets.CMD_BOT_APP_ID }}
private-key: ${{ secrets.CMD_BOT_APP_KEY }}
- name: Apply diff and create PR
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
BRANCH: ${{ needs.runtime-matrix.outputs.branch }}
DATE: ${{ needs.runtime-matrix.outputs.date }}
run: |
git --version
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git status
# Apply all patches
for file in patches/diff-*/diff-*.patch; do
if [ -f "$file" ] && [ -s "$file" ]; then
echo "Applying $file"
# using --3way and --ours for conflicts resolution. Requires git 2.47+
git apply "$file" --unidiff-zero --allow-empty --3way --ours || echo "Failed to apply $file"
else
echo "Skipping empty or non-existent patch file: $file"
fi
done
rm -rf patches
# Get release tags from 1 and 3 months ago
ONE_MONTH_AGO=$(date -d "1 month ago" +%Y-%m-%d)
THREE_MONTHS_AGO=$(date -d "3 months ago" +%Y-%m-%d)
# Get tags with their dates
ONE_MONTH_INFO=$(git for-each-ref --sort=-creatordate --format '%(refname:short)|%(creatordate:iso-strict-local)' 'refs/tags/pezkuwi-v*' | awk -v date="$ONE_MONTH_AGO" -F'|' '$2 <= date {print $0; exit}')
THREE_MONTHS_INFO=$(git for-each-ref --sort=-creatordate --format '%(refname:short)|%(creatordate:iso-strict-local)' 'refs/tags/pezkuwi-v*' | awk -v date="$THREE_MONTHS_AGO" -F'|' '$2 <= date {print $0; exit}')
# Split into tag and date
ONE_MONTH_TAG=$(echo "$ONE_MONTH_INFO" | cut -d'|' -f1)
ONE_MONTH_DATE=$(echo "$ONE_MONTH_INFO" | cut -d'|' -f2 | cut -d'T' -f1)
THREE_MONTHS_TAG=$(echo "$THREE_MONTHS_INFO" | cut -d'|' -f1)
THREE_MONTHS_DATE=$(echo "$THREE_MONTHS_INFO" | cut -d'|' -f2 | cut -d'T' -f1)
# Base URL for Subweight comparisons
BASE_URL="https://weights.tasty.limo/compare?repo=pezkuwi-sdk&threshold=5&path_pattern=.%2F**%2Fweights%2F**%2F*.rs%2C.%2F**%2Fweights.rs&method=asymptotic&ignore_errors=true&unit=time"
# Generate comparison links
MASTER_LINK="${BASE_URL}&old=master&new=${BRANCH}"
ONE_MONTH_LINK="${BASE_URL}&old=${ONE_MONTH_TAG}&new=${BRANCH}"
THREE_MONTHS_LINK="${BASE_URL}&old=${THREE_MONTHS_TAG}&new=${BRANCH}"
# Create PR body with all links in a temporary file
cat > /tmp/pr_body.md << EOF
Auto-update of all weights for ${DATE}.
Subweight results:
- [now vs master](${MASTER_LINK})
- [now vs ${ONE_MONTH_TAG} (${ONE_MONTH_DATE})](${ONE_MONTH_LINK})
- [now vs ${THREE_MONTHS_TAG} (${THREE_MONTHS_DATE})](${THREE_MONTHS_LINK})
EOF
git add .
git commit -m "Update all weights weekly for $DATE"
git push --set-upstream origin "$BRANCH"
MAYBE_DRAFT=${{ inputs.draft && '--draft' || '' }}
PR_TITLE="Auto-update of all weights for $DATE"
gh pr create \
--title "$PR_TITLE" \
--head "$BRANCH" \
--base "master" \
--reviewer pezkuwichain/ci \
--reviewer pezkuwichain/release-engineering \
$MAYBE_DRAFT \
--label "R0-no-crate-publish-required" \
--body "$(cat /tmp/pr_body.md)"
-109
View File
@@ -1,109 +0,0 @@
name: Networking Benchmarks
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
preflight:
uses: ./.github/workflows/reusable-preflight.yml
build:
timeout-minutes: 50
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER_BENCHMARK }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
strategy:
fail-fast: false
matrix:
features:
[
{ bench: "notifications_protocol" },
{ bench: "request_response_protocol" },
]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run Benchmarks
id: run-benchmarks
run: |
mkdir -p ./charts
cargo bench -p pezsc-network --bench ${{ matrix.features.bench }} -- --output-format bencher | grep "^test" | tee ./charts/${{ matrix.features.bench }}.txt || echo "Benchmarks failed"
ls -lsa ./charts
- name: Upload artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ matrix.features.bench }}-${{ github.sha }}
path: ./charts
publish-benchmarks:
timeout-minutes: 60
needs: [build]
if: github.ref == 'refs/heads/master'
environment: subsystem-benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: gh-pages
fetch-depth: 0
- run: git checkout master --
- name: Download artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: notifications_protocol-${{ github.sha }}
path: ./charts
- name: Download artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: request_response_protocol-${{ github.sha }}
path: ./charts
- name: Setup git
run: |
# Fixes "detected dubious ownership" error in the ci
git config --global --add safe.directory '*'
ls -lsR ./charts
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
id: app-token
with:
app-id: ${{ secrets.PEZKUWI_GHPAGES_APP_ID }}
private-key: ${{ secrets.PEZKUWI_GHPAGES_APP_KEY }}
- name: Generate ${{ env.BENCH }}
env:
BENCH: notifications_protocol
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0
with:
tool: "cargo"
name: ${{ env.BENCH }}
output-file-path: ./charts/${{ env.BENCH }}.txt
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
github-token: ${{ steps.app-token.outputs.token }}
auto-push: true
- name: Generate ${{ env.BENCH }}
env:
BENCH: request_response_protocol
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0
with:
tool: "cargo"
name: ${{ env.BENCH }}
output-file-path: ./charts/${{ env.BENCH }}.txt
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
github-token: ${{ steps.app-token.outputs.token }}
auto-push: true
-167
View File
@@ -1,167 +0,0 @@
name: Subsystem Benchmarks
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
build:
timeout-minutes: 80
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
strategy:
fail-fast: false
matrix:
features:
[
{
name: "pezkuwi-availability-recovery",
bench: "availability-recovery-regression-bench",
},
{
name: "pezkuwi-availability-distribution",
bench: "availability-distribution-regression-bench",
},
{
name: "pezkuwi-node-core-approval-voting",
bench: "approval-voting-regression-bench",
},
{
name: "pezkuwi-statement-distribution",
bench: "statement-distribution-regression-bench",
},
{
name: "pezkuwi-node-core-dispute-coordinator",
bench: "dispute-coordinator-regression-bench",
},
]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check Rust
run: |
rustup show
rustup +nightly show
- name: Run Benchmarks
id: run-benchmarks
run: |
cargo bench -p ${{ matrix.features.name }} --bench ${{ matrix.features.bench }} --features subsystem-benchmarks
ls -lsa ./charts
- name: Upload artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{matrix.features.bench}}
path: ./charts
publish-benchmarks:
timeout-minutes: 60
needs: [build]
if: github.ref == 'refs/heads/master'
environment: subsystem-benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: gh-pages
fetch-depth: 0
- run: git checkout master --
- name: Download artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
path: ./charts
- name: Setup git
run: |
# Fixes "detected dubious ownership" error in the ci
git config --global --add safe.directory '*'
ls -lsR ./charts
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
id: app-token
with:
app-id: ${{ secrets.PEZKUWI_GHPAGES_APP_ID }}
private-key: ${{ secrets.PEZKUWI_GHPAGES_APP_KEY }}
- name: Generate ${{ env.BENCH }}
env:
BENCH: availability-recovery-regression-bench
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0
with:
tool: "customSmallerIsBetter"
name: ${{ env.BENCH }}
output-file-path: ./charts/${{ env.BENCH }}/${{ env.BENCH }}.json
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
github-token: ${{ steps.app-token.outputs.token }}
auto-push: true
max-items-in-chart: 500
- name: Generate ${{ env.BENCH }}
env:
BENCH: availability-distribution-regression-bench
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0
with:
tool: "customSmallerIsBetter"
name: ${{ env.BENCH }}
output-file-path: ./charts/${{ env.BENCH }}/${{ env.BENCH }}.json
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
github-token: ${{ steps.app-token.outputs.token }}
auto-push: true
max-items-in-chart: 500
- name: Generate ${{ env.BENCH }}
env:
BENCH: approval-voting-regression-bench
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0
with:
tool: "customSmallerIsBetter"
name: ${{ env.BENCH }}
output-file-path: ./charts/${{ env.BENCH }}/${{ env.BENCH }}.json
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
github-token: ${{ steps.app-token.outputs.token }}
auto-push: true
max-items-in-chart: 500
- name: Generate ${{ env.BENCH }}
env:
BENCH: statement-distribution-regression-bench
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0
with:
tool: "customSmallerIsBetter"
name: ${{ env.BENCH }}
output-file-path: ./charts/${{ env.BENCH }}/${{ env.BENCH }}.json
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
github-token: ${{ steps.app-token.outputs.token }}
auto-push: true
max-items-in-chart: 500
- name: Generate ${{ env.BENCH }}
env:
BENCH: dispute-coordinator-regression-bench
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0
with:
tool: "customSmallerIsBetter"
name: ${{ env.BENCH }}
output-file-path: ./charts/${{ env.BENCH }}/${{ env.BENCH }}.json
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
github-token: ${{ steps.app-token.outputs.token }}
auto-push: true
max-items-in-chart: 500
-139
View File
@@ -1,139 +0,0 @@
name: Build Misc
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
build-runtimes-polkavm:
timeout-minutes: 75
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Clean cargo cache to free disk space
run: |
cargo clean 2>/dev/null || true
rm -rf ~/.cargo/registry/cache 2>/dev/null || true
rm -rf ~/.cargo/git/db 2>/dev/null || true
- name: Check Rust
run: |
rustup show
rustup +nightly show
- name: Build
env:
BIZINIKIWI_RUNTIME_TARGET: riscv
# Skip WASM build - this job tests PolkaVM (RISC-V) target only
# Tracking: https://github.com/pezkuwichain/pezkuwi-sdk/issues/358
SKIP_WASM_BUILD: 1
id: required
run: cargo check -p pez-minimal-template-runtime -p zagros-runtime -p pezkuwichain-runtime -p pezkuwi-test-runtime
- name: Stop all workflows if failed
if: ${{ failure() && steps.required.conclusion == 'failure' && !github.event.pull_request.head.repo.fork }}
uses: ./.github/actions/workflow-stopper
with:
app-id: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_ID }}
app-key: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_KEY }}
# As part of our test fixtures we build the revive-uapi crate always with the `unstable-hostfn` feature.
# To make sure that it won't break for users downstream which are not setting this feature
# It doesn't need to produce working code so we just use a similar enough RISC-V target
check-revive-stable-uapi-polkavm:
timeout-minutes: 30
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Check Rust
run: |
rustup show
rustup +nightly show
- name: Build
id: required
run: cargo +nightly check -p pezpallet-revive-uapi --no-default-features --target riscv64imac-unknown-none-elf -Zbuild-std=core
- name: Stop all workflows if failed
if: ${{ failure() && steps.required.conclusion == 'failure' && !github.event.pull_request.head.repo.fork }}
uses: ./.github/actions/workflow-stopper
with:
app-id: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_ID }}
app-key: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_KEY }}
build-pez-subkey:
timeout-minutes: 45
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Check Rust
run: |
rustup show
rustup +nightly show
- name: Build
env:
SKIP_WASM_BUILD: 1
id: required
run: |
cd ./bizinikiwi/bin/utils/pez-subkey
cargo build --locked --release
- name: Stop all workflows if failed
if: ${{ failure() && steps.required.conclusion == 'failure' && !github.event.pull_request.head.repo.fork }}
uses: ./.github/actions/workflow-stopper
with:
app-id: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_ID }}
app-key: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_KEY }}
confirm-required-build-mipezsc-jobs-passed:
runs-on: ubuntu-latest
name: All build misc jobs passed
# If any new job gets added, be sure to add it to this array
needs: [build-runtimes-polkavm, build-pez-subkey]
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
@@ -1,82 +0,0 @@
name: Build and push ETH-RPC image
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
ETH_RPC_IMAGE_NAME: "docker.io/pezkuwi/eth-rpc"
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
set-variables:
# This workaround sets the container image for each job using 'set-variables' job output.
# env variables don't work for PR from forks, so we need to use outputs.
runs-on: ubuntu-latest
needs: isdraft
outputs:
VERSION: ${{ steps.version.outputs.VERSION }}
steps:
- name: Define version
id: version
run: |
export COMMIT_SHA=${{ github.sha }}
export COMMIT_SHA_SHORT=${COMMIT_SHA:0:8}
export REF_NAME=${{ github.ref_name }}
export REF_SLUG=${REF_NAME//\//_}
VERSION=${REF_SLUG}-${COMMIT_SHA_SHORT}
echo "VERSION=${REF_SLUG}-${COMMIT_SHA_SHORT}" >> $GITHUB_OUTPUT
echo "set VERSION=${VERSION}"
build_docker:
name: Build docker images
runs-on: ubuntu-latest
needs: [set-variables]
env:
VERSION: ${{ needs.set-variables.outputs.VERSION }}
steps:
- name: Check out the repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Build eth-rpc Docker image
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
context: .
file: ./bizinikiwi/pezframe/revive/rpc/dockerfiles/eth-rpc/Dockerfile
push: false
tags: |
${{ env.ETH_RPC_IMAGE_NAME }}:${{ env.VERSION }}
build_push_docker:
name: Build and push docker images
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs: [set-variables]
env:
VERSION: ${{ needs.set-variables.outputs.VERSION }}
steps:
- name: Check out the repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Log in to Docker Hub
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: ${{ secrets.PEZKUWI_DOCKERHUB_USERNAME }}
password: ${{ secrets.PEZKUWI_DOCKERHUB_PASSWORD }}
- name: Build eth-rpc Docker image
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
context: .
file: ./bizinikiwi/pezframe/revive/rpc/dockerfiles/eth-rpc/Dockerfile
push: true
tags: |
${{ env.ETH_RPC_IMAGE_NAME }}:${{ env.VERSION }}
-576
View File
@@ -1,576 +0,0 @@
# GHA for build-*
name: Build and push images
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions: read-all
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
# Disable Parity's forklift GCS cache wrapper - we don't have GCP credentials on our VPS runners
RUSTC_WRAPPER: ""
jobs:
#
#
#
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
### Build ########################
#
#
#
build-linux-stable:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 180
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
RUST_TOOLCHAIN: stable
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Configure git safe.directory
run: git config --global --add safe.directory '*'
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: build
id: required
run: |
cargo build --locked --profile testnet --features pyroscope,fast-runtime --bin pezkuwi --bin pezkuwi-prepare-worker --bin pezkuwi-execute-worker
PEZKUWICHAIN_EPOCH_DURATION=10 ./pezkuwi/scripts/build-only-wasm.sh pezkuwichain-runtime $(pwd)/runtimes/pezkuwichain-runtime-10/
PEZKUWICHAIN_EPOCH_DURATION=100 ./pezkuwi/scripts/build-only-wasm.sh pezkuwichain-runtime $(pwd)/runtimes/pezkuwichain-runtime-100/
PEZKUWICHAIN_EPOCH_DURATION=600 ./pezkuwi/scripts/build-only-wasm.sh pezkuwichain-runtime $(pwd)/runtimes/pezkuwichain-runtime-600/
pwd
ls -alR runtimes
- name: pack artifacts
run: |
mkdir -p ./artifacts
VERSION="${{ needs.preflight.outputs.SOURCE_REF_SLUG }}" # will be tag or branch name
mv ./target/testnet/pezkuwi ./artifacts/.
mv ./target/testnet/pezkuwi-prepare-worker ./artifacts/.
mv ./target/testnet/pezkuwi-execute-worker ./artifacts/.
mv ./runtimes/ ./artifacts/.
cd artifacts/
sha256sum pezkuwi | tee pezkuwi.sha256
shasum -c pezkuwi.sha256
cd ../
EXTRATAG="${{ needs.preflight.outputs.SOURCE_REF_SLUG }}-${COMMIT_SHA}"
echo "Pezkuwi version = ${VERSION} (EXTRATAG = ${EXTRATAG})"
echo -n ${VERSION} > ./artifacts/VERSION
echo -n ${EXTRATAG} > ./artifacts/EXTRATAG
echo -n ${GITHUB_RUN_ID} > ./artifacts/BUILD_LINUX_JOB_ID
RELEASE_VERSION=$(./artifacts/pezkuwi -V | awk '{print $2}'| awk -F "-" '{print $1}')
echo -n "v${RELEASE_VERSION}" > ./artifacts/BUILD_RELEASE_VERSION
cp -r docker/* ./artifacts
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
#
#
#
build-linux-stable-pezcumulus:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 180
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: build
id: required
run: |
echo "___Building a binary, please refrain from using it in production since it goes with the debug assertions.___"
cargo build --release --locked -p pezkuwi-teyrchain-bin --bin pezkuwi-teyrchain
echo "___Packing the artifacts___"
mkdir -p ./artifacts
mv ./target/release/pezkuwi-teyrchain ./artifacts/.
echo "___The VERSION is either a tag name or the curent branch if triggered not by a tag___"
echo ${{ needs.preflight.outputs.SOURCE_REF_SLUG }} | tee ./artifacts/VERSION
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
#
#
#
build-test-teyrchain:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 180
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: build
id: required
run: |
echo "___Building a binary, please refrain from using it in production since it goes with the debug assertions.___"
cargo build --release --locked -p pezcumulus-test-service --bin test-teyrchain
- name: pack artifacts
run: |
echo "___Packing the artifacts___"
mkdir -p ./artifacts
mv ./target/release/test-teyrchain ./artifacts/.
mkdir -p ./artifacts/zombienet
mv ./target/release/wbuild/pezcumulus-test-runtime/wasm_binary_spec_version_incremented.rs.compact.compressed.wasm ./artifacts/zombienet/.
mv ./target/release/wbuild/pezcumulus-test-runtime/wasm_binary_elastic_scaling.rs.compact.compressed.wasm ./artifacts/zombienet/.
mv ./target/release/wbuild/pezcumulus-test-runtime/wasm_binary_elastic_scaling_12s_slot.rs.compact.compressed.wasm ./artifacts/zombienet/.
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
#
#
#
build-test-collators:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 180
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: build
id: required
run: |
cargo build --locked --profile testnet -p test-teyrchain-adder-collator
cargo build --locked --profile testnet -p test-teyrchain-undying-collator
- name: pack artifacts
run: |
mkdir -p ./artifacts
mv ./target/testnet/adder-collator ./artifacts/.
mv ./target/testnet/undying-collator ./artifacts/.
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}" > ./artifacts/VERSION
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}-${COMMIT_SHA}" > ./artifacts/EXTRATAG
echo "adder-collator version = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
echo "undying-collator version = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
cp -r ./docker/* ./artifacts
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
#
#
#
build-malus:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 180
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: build
id: required
run: |
cargo build --locked --profile testnet -p pezkuwi-test-malus --bin malus --bin pezkuwi-prepare-worker --bin pezkuwi-execute-worker
- name: pack artifacts
run: |
mkdir -p ./artifacts
mv ./target/testnet/malus ./artifacts/.
mv ./target/testnet/pezkuwi-execute-worker ./artifacts/.
mv ./target/testnet/pezkuwi-prepare-worker ./artifacts/.
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}" > ./artifacts/VERSION
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}-${COMMIT_SHA}" > ./artifacts/EXTRATAG
echo "pezkuwi-test-malus = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
cp -r ./docker/* ./artifacts
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
#
#
#
build-linux-bizinikiwi:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 180
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Configure git safe.directory
run: git config --global --add safe.directory '*'
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: build
id: required
run: |
mkdir -p ./artifacts/bizinikiwi/
WASM_BUILD_NO_COLOR=1 cargo build --locked --release -p pezstaging-node-cli
ls -la target/release/
- name: pack artifacts
shell: bash
run: |
mv target/release/bizinikiwi-node ./artifacts/bizinikiwi/bizinikiwi
echo -n "Bizinikiwi version = "
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
echo "${{ github.ref_name }}" | tee ./artifacts/bizinikiwi/VERSION;
else
./artifacts/bizinikiwi/bizinikiwi --version |
cut -d ' ' -f 2 | tee ./artifacts/bizinikiwi/VERSION;
fi
sha256sum ./artifacts/bizinikiwi/bizinikiwi | tee ./artifacts/bizinikiwi/bizinikiwi.sha256
cp -r ./docker/dockerfiles/bizinikiwi_injected.Dockerfile ./artifacts/bizinikiwi/
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
#
#
#
build-templates-node:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 180
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: build
id: required
run: |
cargo build --locked --package teyrchain-template-node --release
cargo build --locked --package pez-minimal-template-node --release
cargo build --locked --package pez-solochain-template-node --release
- name: pack artifacts
run: |
mkdir -p ./artifacts
mv ./target/release/teyrchain-template-node ./artifacts/.
mv ./target/release/pez-minimal-template-node ./artifacts/.
mv ./target/release/pez-solochain-template-node ./artifacts/.
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}" > ./artifacts/VERSION
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}-${COMMIT_SHA}" > ./artifacts/EXTRATAG
echo "pezkuwi-test-malus = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
### Publish ########################
#
#
#
build-push-image-test-teyrchain:
needs: [preflight, build-test-teyrchain]
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
timeout-minutes: 180
steps:
- name: Fix workspace permissions
run: |
sudo chown -R "$(whoami)" "$GITHUB_WORKSPACE" || {
echo "::warning::sudo chown failed - attempting cleanup"
rm -rf "${GITHUB_WORKSPACE:?}"/* 2>/dev/null || true
rm -rf "${GITHUB_WORKSPACE:?}"/.[!.]* 2>/dev/null || true
}
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: build-test-teyrchain-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
- name: tar
run: tar -xvf artifacts.tar
- name: build and push image
uses: ./.github/actions/build-push-image
with:
image-name: "test-teyrchain"
dockerfile: "docker/dockerfiles/test-teyrchain_injected.Dockerfile"
username: ${{ secrets.PEZKUWI_DOCKERHUB_USERNAME }}
password: ${{ secrets.PEZKUWI_DOCKERHUB_PASSWORD }}
#
#
#
build-push-image-pezkuwi-debug:
needs: [preflight, build-linux-stable]
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
timeout-minutes: 180
steps:
- name: Fix workspace permissions
run: |
sudo chown -R "$(whoami)" "$GITHUB_WORKSPACE" || {
echo "::warning::sudo chown failed - attempting cleanup"
rm -rf "${GITHUB_WORKSPACE:?}"/* 2>/dev/null || true
rm -rf "${GITHUB_WORKSPACE:?}"/.[!.]* 2>/dev/null || true
}
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: build-linux-stable-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
- name: tar
run: tar -xvf artifacts.tar
- name: build and push image
uses: ./.github/actions/build-push-image
with:
image-name: "pezkuwi-debug"
dockerfile: "docker/dockerfiles/pezkuwi/pezkuwi_injected_debug.Dockerfile"
username: ${{ secrets.PEZKUWI_DOCKERHUB_USERNAME }}
password: ${{ secrets.PEZKUWI_DOCKERHUB_PASSWORD }}
#
#
#
build-push-image-colander:
needs: [preflight, build-test-collators]
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
timeout-minutes: 180
steps:
- name: Fix workspace permissions
run: |
sudo chown -R "$(whoami)" "$GITHUB_WORKSPACE" || {
echo "::warning::sudo chown failed - attempting cleanup"
rm -rf "${GITHUB_WORKSPACE:?}"/* 2>/dev/null || true
rm -rf "${GITHUB_WORKSPACE:?}"/.[!.]* 2>/dev/null || true
}
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: build-test-collators-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
- name: tar
run: tar -xvf artifacts.tar
- name: build and push image
uses: ./.github/actions/build-push-image
with:
image-name: "colander"
dockerfile: "docker/dockerfiles/collator_injected.Dockerfile"
username: ${{ secrets.PEZKUWI_DOCKERHUB_USERNAME }}
password: ${{ secrets.PEZKUWI_DOCKERHUB_PASSWORD }}
#
#
#
build-push-image-malus:
needs: [preflight, build-malus]
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
timeout-minutes: 180
steps:
- name: Fix workspace permissions
run: |
sudo chown -R "$(whoami)" "$GITHUB_WORKSPACE" || {
echo "::warning::sudo chown failed - attempting cleanup"
rm -rf "${GITHUB_WORKSPACE:?}"/* 2>/dev/null || true
rm -rf "${GITHUB_WORKSPACE:?}"/.[!.]* 2>/dev/null || true
}
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: build-malus-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
- name: tar
run: tar -xvf artifacts.tar
- name: build and push image
uses: ./.github/actions/build-push-image
with:
image-name: "malus"
dockerfile: "docker/dockerfiles/malus_injected.Dockerfile"
username: ${{ secrets.PEZKUWI_DOCKERHUB_USERNAME }}
password: ${{ secrets.PEZKUWI_DOCKERHUB_PASSWORD }}
#
#
#
build-push-image-bizinikiwi-pr:
needs: [preflight, build-linux-bizinikiwi]
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
timeout-minutes: 180
steps:
- name: Fix workspace permissions
run: |
sudo chown -R "$(whoami)" "$GITHUB_WORKSPACE" || {
echo "::warning::sudo chown failed - attempting cleanup"
rm -rf "${GITHUB_WORKSPACE:?}"/* 2>/dev/null || true
rm -rf "${GITHUB_WORKSPACE:?}"/.[!.]* 2>/dev/null || true
}
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: build-linux-bizinikiwi-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
- name: tar
run: tar -xvf artifacts.tar
- name: build and push image
uses: ./.github/actions/build-push-image
with:
image-name: "bizinikiwi"
dockerfile: "docker/dockerfiles/bizinikiwi_injected.Dockerfile"
username: ${{ secrets.PEZKUWI_DOCKERHUB_USERNAME }}
password: ${{ secrets.PEZKUWI_DOCKERHUB_PASSWORD }}
#
#
#
build-push-image-pezkuwi-teyrchain-debug:
needs: [preflight, build-linux-stable-pezcumulus]
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
timeout-minutes: 180
steps:
- name: Fix workspace permissions
run: |
sudo chown -R "$(whoami)" "$GITHUB_WORKSPACE" || {
echo "::warning::sudo chown failed - attempting cleanup"
rm -rf "${GITHUB_WORKSPACE:?}"/* 2>/dev/null || true
rm -rf "${GITHUB_WORKSPACE:?}"/.[!.]* 2>/dev/null || true
}
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: build-linux-stable-pezcumulus-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
- name: tar
run: tar -xvf artifacts.tar
- name: build and push image
uses: ./.github/actions/build-push-image
with:
image-name: "pezkuwi-teyrchain-debug"
dockerfile: "docker/dockerfiles/pezkuwi-teyrchain/pezkuwi-teyrchain-debug_unsigned_injected.Dockerfile"
username: ${{ secrets.PEZKUWI_DOCKERHUB_USERNAME }}
password: ${{ secrets.PEZKUWI_DOCKERHUB_PASSWORD }}
confirm-required-build-jobs-passed:
runs-on: ubuntu-latest
name: All builds passed
# If any new job gets added, be sure to add it to this array
needs:
- build-linux-stable
- build-linux-stable-pezcumulus
- build-test-teyrchain
- build-test-collators
- build-malus
- build-linux-bizinikiwi
- build-templates-node
if: always() && !cancelled()
outputs:
build_success: ${{ steps.check_success.outputs.build_success }}
steps:
- name: Check build success
id: check_success
run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
echo "build_success=false" >> $GITHUB_OUTPUT
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
echo "build_success=true" >> $GITHUB_OUTPUT
fi
@@ -1,127 +0,0 @@
name: Check Cargo Check Runtimes
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "pezcumulus/teyrchains/runtimes/*"
# Jobs in this workflow depend on each other, only for limiting peak amount of spawned workers
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
check-runtime-assets:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
needs: [preflight]
timeout-minutes: 20
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: pezcumulus/teyrchains/runtimes/assets
check-runtime-collectives:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
needs: [check-runtime-assets, preflight]
timeout-minutes: 20
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: pezcumulus/teyrchains/runtimes/collectives
check-runtime-coretime:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
needs: [check-runtime-assets, preflight]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: pezcumulus/teyrchains/runtimes/coretime
check-runtime-bridge-hubs:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
needs: [preflight]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: pezcumulus/teyrchains/runtimes/bridge-hubs
check-runtime-contracts:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
needs: [check-runtime-collectives, preflight]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: pezcumulus/teyrchains/runtimes/contracts
check-runtime-testing:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
needs: [preflight]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run cargo check
uses: ./.github/actions/cargo-check-runtimes
with:
root: pezcumulus/teyrchains/runtimes/testing
confirm-required-jobs-passed:
runs-on: ubuntu-latest
name: All check-runtime-* tests passed
# If any new job gets added, be sure to add it to this array
needs:
- check-runtime-assets
- check-runtime-collectives
- check-runtime-coretime
- check-runtime-bridge-hubs
- check-runtime-contracts
- check-runtime-testing
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
-327
View File
@@ -1,327 +0,0 @@
name: Check the getting-started.sh script
# This workflow aims to make sure that the `getting-started.sh` script
# is functional and allows to build the templates
# on different operating systems.
#
# There are two jobs inside.
# One for systems that can run in a docker container, and one for macOS.
#
# Each job consists of:
# 1. Some necessary prerequisites for the workflow itself.
# 2. A first pass of the script, which will install dependencies and clone a template.
# 3. A second pass of the script, to make sure the behaviour is as expected.
# 4. Building the template - making sure it's buildable and runnable.
#
# The script is interacted with using the `expect` tool, which is available on all relevant systems.
# The steps are not re-used between macOS and other systems,
# because they are very similar but a little different.
# Additionally, macOS does NOT start from scratch here - for example, we have homebrew already installed.
#
# There are many combinations of systems, shells and templates.
# We test a selected handful of combinations here.
on:
pull_request:
paths:
- ".github/workflows/check-getting-started.yml"
- "scripts/getting-started.sh"
types: [opened, synchronize, reopened, ready_for_review]
schedule:
- cron: "0 5 * * *"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
check-getting-started:
needs: isdraft
strategy:
fail-fast: true
matrix:
include:
- name: ubuntu
container: ubuntu
template: minimal
package: pez-minimal-template-node
shell: bash
- name: debian
container: debian
template: teyrchain
package: teyrchain-template-node
shell: sh
- name: arch
container: archlinux
template: solochain
package: pez-solochain-template-node
shell: sh
- name: fedora
container: fedora
template: teyrchain
package: teyrchain-template-node
shell: sh
- name: opensuse
container: opensuse/tumbleweed
template: solochain
package: pez-solochain-template-node
shell: sh
runs-on: ubuntu-latest
container: ${{ matrix.container }}:latest
env:
# Use local templates from the repo instead of cloning from external repos
PEZKUWI_TEMPLATE_SOURCE: ${{ github.workspace }}/templates
# Fix HOME directory mismatch in containers (rustup requires this)
HOME: /root
steps:
# A minimal amount of prerequisites required before we can run the actual getting-started script,
# which will install the rest of requirements.
- name: Install ubuntu/debian prerequisites
run: apt update && apt install -y expect sudo git
if: contains(matrix.name, 'ubuntu') || contains(matrix.name, 'debian')
- name: Install arch prerequisites
run: pacman -Syu --needed --noconfirm expect sudo git
if: contains(matrix.name, 'arch')
- name: Install fedora prerequisites
run: dnf --assumeyes install expect sudo git
if: contains(matrix.name, 'fedora')
- name: Install opensuse prerequisites
run: zypper install --no-confirm expect sudo git
if: contains(matrix.name, 'opensuse')
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set additional expect flags if necessary
run: |
# Add a debug flag to expect, if github is re-run with debug logging enabled.
[ "${{ runner.debug }}" = "1" ] && EXPECT_FLAGS="-d" || EXPECT_FLAGS=""
echo "EXPECT_FLAGS=${EXPECT_FLAGS}" >> $GITHUB_ENV
- name: Check the first run of the script
run: |
expect $EXPECT_FLAGS -c '
set timeout 240
spawn ${{ matrix.shell }} scripts/getting-started.sh
expect_after {
timeout { puts stderr "Timed out on an expect"; exit 1 }
eof { puts stderr "EOF received on an expect"; exit 1 }
}
expect -nocase "Detected ${{ matrix.name }}"
expect "*Rust is not installed. Install it?*" {
send "y\r"
# rustup runs with -y flag (non-interactive), so no "Proceed" prompt
expect "Rust is installed now"
}
expect "*Setup the Rust environment*" {
send "y\r"
}
expect "start with one of the templates" {
send "y\r"
}
expect -re "(.)\\) ${{ matrix.template }} template" {
send "$expect_out(1,string)\r"
}
expect "*compile the node?*" {
send "n\r"
}
expect eof
'
timeout-minutes: 15
- name: Check the second run of the script
run: |
expect $EXPECT_FLAGS -c '
set timeout 120
spawn ${{ matrix.shell }} scripts/getting-started.sh
expect_after {
timeout { puts stderr "Timed out on an expect"; exit 1 }
eof { puts stderr "EOF received on an expect"; exit 1 }
}
expect "Rust already installed" {}
expect "*Setup the Rust environment*" {
send "n\r"
}
expect "start with one of the templates" {
send "y\r"
}
expect -re "(.)\\) ${{ matrix.template }} template" {
send "$expect_out(1,string)\r"
expect "directory already exists" {}
}
expect "*compile the node?*" {
send "n\r"
}
expect eof
'
timeout-minutes: 15
# Build the template from within the SDK workspace context
# Templates use workspace inheritance and can't be built standalone
# Note: Use $GITHUB_WORKSPACE env var, not ${{ github.workspace }} template
# because inside containers the template expands to host path which doesn't exist
- name: Compile the template node
run: |
. "$HOME/.cargo/env"
cd "$GITHUB_WORKSPACE"
cargo build --release -p ${{ matrix.package }}
timeout-minutes: 120
- name: Check that the binary is executable
run: |
. "$HOME/.cargo/env"
cd "$GITHUB_WORKSPACE"
cargo run --release -p ${{ matrix.package }} -- --help
timeout-minutes: 5
check-getting-started-macos:
needs: isdraft
strategy:
fail-fast: true
matrix:
include:
- template: teyrchain
package: teyrchain-template-node
shell: sh
- template: solochain
package: pez-solochain-template-node
shell: bash
runs-on: macos-latest
env:
# Use local templates from the repo instead of cloning from external repos
PEZKUWI_TEMPLATE_SOURCE: ${{ github.workspace }}/templates
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install LLVM (provides libclang for rocksdb)
run: |
brew install llvm
echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" >> $GITHUB_ENV
- name: Set additional expect flags if necessary
run: |
# Add a debug flag to expect, if github is re-run with debug logging enabled.
[ "${{ runner.debug }}" = "1" ] && EXPECT_FLAGS="-d" || EXPECT_FLAGS=""
echo "EXPECT_FLAGS=${EXPECT_FLAGS}" >> $GITHUB_ENV
- name: Check the first run of the script
run: |
expect $EXPECT_FLAGS -c '
set timeout 120
spawn ${{ matrix.shell }} scripts/getting-started.sh
expect_after {
timeout { puts stderr "Timed out on an expect"; exit 1 }
eof { puts stderr "EOF received on an expect"; exit 1 }
}
expect -nocase "Detected macOS"
expect "Homebrew already installed"
expect "Install cmake" {
send "y\r"
}
expect "Rust already installed" {}
expect "*Setup the Rust environment*" {
send "y\r"
}
expect "start with one of the templates" {
send "y\r"
}
expect -re "(.)\\) ${{ matrix.template }} template" {
send "$expect_out(1,string)\r"
}
expect "*compile the node?*" {
send "n\r"
}
expect eof
'
timeout-minutes: 15
- name: Check the second run of the script
run: |
expect $EXPECT_FLAGS -c '
set timeout 120
spawn ${{ matrix.shell }} scripts/getting-started.sh
expect_after {
timeout { puts stderr "Timed out on an expect"; exit 1 }
eof { puts stderr "EOF received on an expect"; exit 1 }
}
expect "Homebrew already installed"
expect "Install cmake" {
send "y\r"
}
expect "Rust already installed" {}
expect "*Setup the Rust environment*" {
send "n\r"
}
expect "start with one of the templates" {
send "y\r"
}
expect -re "(.)\\) ${{ matrix.template }} template" {
send "$expect_out(1,string)\r"
expect "directory already exists" {}
}
expect "*compile the node?*" {
send "n\r"
}
expect eof
'
timeout-minutes: 15
# Build the template from within the SDK workspace context
# Templates use workspace inheritance and can't be built standalone
# Note: Use $GITHUB_WORKSPACE env var, not ${{ github.workspace }} template
# because inside containers the template expands to host path which doesn't exist
- name: Compile the template node
run: |
. "$HOME/.cargo/env"
cd "$GITHUB_WORKSPACE"
cargo build --release -p ${{ matrix.package }}
timeout-minutes: 120
- name: Check that the binary is executable
run: |
. "$HOME/.cargo/env"
cd "$GITHUB_WORKSPACE"
cargo run --release -p ${{ matrix.package }} -- --help
timeout-minutes: 5
-55
View File
@@ -1,55 +0,0 @@
name: Check labels
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
pull_request:
types: [labeled, opened, synchronize, unlabeled]
merge_group:
jobs:
check-labels:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check labels
env:
GITHUB_PR: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
API_BASE: https://api.github.com/repos
REPO: ${{ github.repository }}
run: |
if [ ${{ github.ref }} == "refs/heads/master" ] || [ ${{ github.ref }} == "refs/heads/main" ]; then
echo "Skipping main/master"
exit 0
fi
if [ $(echo ${{ github.ref }} | grep -c "gh-readonly-queue") -eq 1 ]; then
echo "Skipping merge queue"
exit 0
fi
echo "REPO: ${REPO}"
echo "GITHUB_PR: ${GITHUB_PR}"
# Fetch the labels for the PR under test
echo "Fetch the labels for $API_BASE/${REPO}/pulls/${GITHUB_PR}"
labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" "," )
echo "Labels: ${labels}"
# Basic label checks for Pezkuwi SDK
# Check for required labels (customize as needed)
if [ -z "${labels}" ]; then
echo "::warning::No labels found on PR. Consider adding appropriate labels."
else
echo "Labels found: ${labels}"
# Check for T- (type) labels
if echo "${labels}" | grep -q '"T-'; then
echo "Type label found"
else
echo "::notice::Consider adding a type label (T-*)"
fi
fi
echo "Label check completed"
-98
View File
@@ -1,98 +0,0 @@
name: Check licenses
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
packages: read
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
check-licenses:
runs-on: ubuntu-latest
needs: isdraft
timeout-minutes: 10
env:
LICENSES: "'Apache-2.0' 'GPL-3.0-only' 'GPL-3.0-or-later WITH Classpath-exception-2.0' 'MIT-0' 'Unlicense'"
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "18.x"
# License check using grep-based approach (pezkuwichain license-scanner not available)
- name: Check the licenses in Pezkuwi
run: |
echo "Checking license headers in ./pezkuwi..."
# Check for Apache-2.0 or GPL-3.0 license headers
MISSING=$(find ./pezkuwi -name "*.rs" -type f | head -100 | while read f; do
if ! head -20 "$f" | grep -qiE "(apache|gpl|mit|unlicense)"; then
echo "$f"
fi
done)
if [ -n "$MISSING" ]; then
echo "::warning::Some files may be missing license headers (sample check)"
fi
echo "License check completed for pezkuwi"
- name: Check the licenses in Pezcumulus
run: |
echo "Checking license headers in ./pezcumulus..."
MISSING=$(find ./pezcumulus -name "*.rs" -type f | head -100 | while read f; do
if ! head -20 "$f" | grep -qiE "(apache|gpl|mit|unlicense)"; then
echo "$f"
fi
done)
if [ -n "$MISSING" ]; then
echo "::warning::Some files may be missing license headers (sample check)"
fi
echo "License check completed for pezcumulus"
- name: Check the licenses in Bizinikiwi
run: |
echo "Checking license headers in ./bizinikiwi..."
MISSING=$(find ./bizinikiwi -name "*.rs" -type f | head -100 | while read f; do
if ! head -20 "$f" | grep -qiE "(apache|gpl|mit|unlicense)"; then
echo "$f"
fi
done)
if [ -n "$MISSING" ]; then
echo "::warning::Some files may be missing license headers (sample check)"
fi
echo "License check completed for bizinikiwi"
check-product-references:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
# Product reference check using grep (pezkuwichain license-scanner not available)
- name: Check the product references in Pezkuwi
run: |
echo "Checking product references in ./pezkuwi..."
# Sample check for Pezkuwi product name in license headers
COUNT=$(find ./pezkuwi -name "*.rs" -type f | head -50 | xargs grep -l "Pezkuwi\|PEZKUWI" 2>/dev/null | wc -l || echo 0)
echo "Found $COUNT files with Pezkuwi product reference"
- name: Check the product references in Pezcumulus
run: |
echo "Checking product references in ./pezcumulus..."
COUNT=$(find ./pezcumulus -name "*.rs" -type f | head -50 | xargs grep -l "Pezcumulus\|PEZCUMULUS" 2>/dev/null | wc -l || echo 0)
echo "Found $COUNT files with Pezcumulus product reference"
- name: Check the product references in Bizinikiwi
run: |
echo "Checking product references in ./bizinikiwi..."
COUNT=$(find ./bizinikiwi -name "*.rs" -type f | head -50 | xargs grep -l "Bizinikiwi\|BIZINIKIWI" 2>/dev/null | wc -l || echo 0)
echo "Found $COUNT files with Bizinikiwi product reference"
-43
View File
@@ -1,43 +0,0 @@
# DISABLED: External link issues (GitHub rate limiting, third-party sites down)
# Re-enable after mainnet launch
name: Check links
on:
workflow_dispatch: # Manual trigger only
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
packages: read
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
link-checker:
runs-on: ubuntu-latest
needs: isdraft
timeout-minutes: 10
steps:
- name: Restore lychee cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
# This should restore from the most recent one:
restore-keys: cache-lychee-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.0 (22. Sep 2023)
- name: Lychee link checker
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # for v1.9.1 (10. Jan 2024)
with:
args: >-
--config .config/lychee.toml
--no-progress
'./**/*.rs'
fail: true
env:
# To bypass GitHub rate-limit:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
@@ -1,132 +0,0 @@
name: Short benchmarks (pezframe-omni-bencher)
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
ARTIFACTS_NAME: pezframe-omni-bencher-artifacts
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
quick-benchmarks-omni:
runs-on: ${{ needs.preflight.outputs.RUNNER_BENCHMARK }}
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_rust }}
env:
RUSTFLAGS: "-C debug-assertions"
RUST_BACKTRACE: "full"
WASM_BUILD_NO_COLOR: 1
WASM_BUILD_RUSTFLAGS: "-C debug-assertions"
RUST_LOG: "frame_omni_bencher=info,pezkuwi_sdk_frame=info"
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: Clean cargo cache to free disk space
run: |
cargo clean 2>/dev/null || true
rm -rf ~/.cargo/registry/cache 2>/dev/null || true
rm -rf ~/.cargo/git/db 2>/dev/null || true
- name: script
id: required
run: |
cargo build --locked --quiet --release -p asset-hub-zagros-runtime --features runtime-benchmarks
cargo run --locked --release -p pezframe-omni-bencher --quiet -- v1 benchmark pezpallet --runtime target/release/wbuild/asset-hub-zagros-runtime/asset_hub_zagros_runtime.compact.compressed.wasm --all --steps 2 --repeat 1 --quiet
runtime-matrix:
runs-on: ubuntu-latest
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_rust }}
timeout-minutes: 30
outputs:
runtime: ${{ steps.runtime.outputs.runtime }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
name: Extract runtimes from matrix
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- id: runtime
run: |
RUNTIMES=$(jq '[.[] | select(.package != null)]' .github/workflows/runtimes-matrix.json)
RUNTIMES=$(echo $RUNTIMES | jq -c .)
echo "runtime=$RUNTIMES"
echo "runtime=$RUNTIMES" >> $GITHUB_OUTPUT
run-pezframe-omni-bencher:
runs-on: ${{ needs.preflight.outputs.RUNNER_BENCHMARK }}
needs: [preflight, runtime-matrix]
if: ${{ needs.preflight.outputs.changes_rust }}
timeout-minutes: 60
strategy:
fail-fast: false # keep running other workflows even if one fails, to see the logs of all possible failures
matrix:
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }}
bench_cmd: ["pallet", "overhead"]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
PACKAGE_NAME: ${{ matrix.runtime.package }}
FLAGS: ${{ matrix.runtime.bench_flags }}
RUST_LOG: "frame_omni_bencher=info,pezkuwi_sdk_frame=info"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: script (benchmark ${{ matrix.bench_cmd }})
id: required
shell: bash
run: |
RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm
RUNTIME_BLOB_PATH=./target/release/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME
BENCH_CMD=${{ matrix.bench_cmd }}
cargo build --release --locked -p $PACKAGE_NAME -p pezframe-omni-bencher --features=${{ matrix.runtime.bench_features }} --quiet
echo "Running short $BENCH_CMD benchmarking for PACKAGE_NAME=$PACKAGE_NAME and RUNTIME_BLOB_PATH=$RUNTIME_BLOB_PATH"
ls -lrt $RUNTIME_BLOB_PATH
if [[ "$BENCH_CMD" == "pallet" ]]; then
cmd="./target/release/pezframe-omni-bencher v1 benchmark pezpallet --runtime $RUNTIME_BLOB_PATH --all --steps 2 --repeat 1 $FLAGS"
elif [[ "$BENCH_CMD" == "overhead" ]]; then
cmd="./target/release/pezframe-omni-bencher v1 benchmark overhead --runtime $RUNTIME_BLOB_PATH"
else
echo "Error: Unknown BENCH_CMD value: $BENCH_CMD"
exit 1
fi
echo "Running command: $cmd"
eval "$cmd"
confirm-pezframe-omni-benchers-passed:
runs-on: ubuntu-latest
name: All benchmarks passed
needs: [quick-benchmarks-omni, run-pezframe-omni-bencher]
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
@@ -1,108 +0,0 @@
name: check-runtime-compatibility
# DISABLED: Pezkuwi does not have public RPC endpoints yet.
# Re-enable when public nodes are available at pezkuwichain.io
# To enable: remove 'if: false' from the job below
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
check-runtime-compatibility:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
# DISABLED until Pezkuwi public RPC endpoints are available
if: false # ${{ needs.preflight.outputs.changes_rust }}
timeout-minutes: 30
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
strategy:
fail-fast: false
matrix:
network:
[
zagros,
asset-hub-zagros,
bridge-hub-zagros,
collectives-zagros,
coretime-zagros,
]
include:
- network: zagros
package: zagros-runtime
wasm: zagros_runtime.compact.compressed.wasm
uri: "wss://try-runtime-zagros.pezkuwichain.io:443"
- network: asset-hub-zagros
package: asset-hub-zagros-runtime
wasm: asset_hub_zagros_runtime.compact.compressed.wasm
uri: "wss://zagros-asset-hub-rpc.pezkuwichain.io:443"
- network: bridge-hub-zagros
package: bridge-hub-zagros-runtime
wasm: bridge_hub_zagros_runtime.compact.compressed.wasm
uri: "wss://zagros-bridge-hub-rpc.pezkuwichain.io:443"
- network: collectives-zagros
package: collectives-zagros-runtime
wasm: collectives_zagros_runtime.compact.compressed.wasm
uri: "wss://zagros-collectives-rpc.pezkuwichain.io:443"
- network: coretime-zagros
package: coretime-zagros-runtime
wasm: coretime_zagros_runtime.compact.compressed.wasm
uri: "wss://zagros-coretime-rpc.pezkuwichain.io:443"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Build Runtime
id: build-runtime
run: |
echo "---------- Building ${{ matrix.package }} runtime with on-chain-release-build ----------"
cargo build --release --locked -p ${{ matrix.package }} --features on-chain-release-build -q
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "24.x"
registry-url: "https://npm.pkg.github.com"
- name: Check Runtime Compatibility
id: check-compatibility
run: |
echo "---------- Checking runtime compatibility for ${{ matrix.network }} ----------"
npx @pezkuwi-api/check-runtime@latest problems ${{ matrix.uri }} --wasm ./target/release/wbuild/${{ matrix.package }}/${{ matrix.wasm }}
# name of this job must be unique across all workflows
# otherwise GitHub will mark all these jobs as required
confirm-runtime-compatibility-checks-passed:
runs-on: ubuntu-latest
name: All runtime compatibility checks passed
needs: [check-runtime-compatibility]
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
@@ -1,150 +0,0 @@
name: check-runtime-migration
# DISABLED: Pezkuwi does not have public RPC endpoints yet.
# Re-enable when public nodes are available at pezkuwichain.io
# To enable: remove 'if: false' from the job below
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
# Take a snapshot at 5am when most SDK devs are not working.
schedule:
- cron: "0 5 * * *"
merge_group:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
# More info can be found here: https://github.com/pezkuwichain/pezkuwi-sdk/pull/5865
check-runtime-migration:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
# DISABLED until Pezkuwi public RPC endpoints are available
if: false # ${{ needs.preflight.outputs.changes_rust }}
# We need to set this to rather long to allow the snapshot to be created, but the average time
# should be much lower.
timeout-minutes: 60
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
strategy:
fail-fast: false
matrix:
network:
[
zagros,
asset-hub-zagros,
bridge-hub-zagros,
collectives-zagros,
coretime-zagros,
]
include:
- network: zagros
package: zagros-runtime
wasm: zagros_runtime.compact.compressed.wasm
uri: "wss://try-runtime-zagros.pezkuwichain.io:443"
subcommand_extra_args: "--no-weight-warnings --blocktime 6000"
command_extra_args: ""
- network: asset-hub-zagros
package: asset-hub-zagros-runtime
wasm: asset_hub_zagros_runtime.compact.compressed.wasm
uri: "wss://zagros-asset-hub-rpc.pezkuwichain.io:443"
subcommand_extra_args: " --blocktime 6000"
command_extra_args: ""
- network: bridge-hub-zagros
package: bridge-hub-zagros-runtime
wasm: bridge_hub_zagros_runtime.compact.compressed.wasm
uri: "wss://zagros-bridge-hub-rpc.pezkuwichain.io:443"
subcommand_extra_args: " --blocktime 6000"
- network: collectives-zagros
package: collectives-zagros-runtime
wasm: collectives_zagros_runtime.compact.compressed.wasm
uri: "wss://zagros-collectives-rpc.pezkuwichain.io:443"
command_extra_args: "--disable-spec-name-check"
subcommand_extra_args: " --blocktime 6000"
- network: coretime-zagros
package: coretime-zagros-runtime
wasm: coretime_zagros_runtime.compact.compressed.wasm
uri: "wss://zagros-coretime-rpc.pezkuwichain.io:443"
subcommand_extra_args: " --blocktime 6000"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Download CLI
# NOTE: try-runtime-cli is an upstream shared tool from paritytech/try-runtime-cli
run: |
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.8.0/try-runtime-x86_64-unknown-linux-musl -o try-runtime
chmod +x ./try-runtime
echo "Using try-runtime-cli version:"
./try-runtime --version
- name: Get Date
id: get-date
run: |
echo "today=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
shell: bash
- name: Download Snapshot
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: snapshot.raw
key: try-runtime-snapshot-${{ matrix.network }}-${{ steps.get-date.outputs.today }}
save-always: true
- name: Create Snapshot If Stale
if: ${{ hashFiles('snapshot.raw') == '' }}
run: |
echo "Creating new snapshot for today (${{ steps.get-date.outputs.today }})"
./try-runtime create-snapshot --uri ${{ matrix.uri }} snapshot.raw
- name: Build Runtime
id: required1
run: |
echo "---------- Building ${{ matrix.package }} runtime ----------"
cargo build --release --locked -p ${{ matrix.package }} --features try-runtime -q
- name: Run Check
id: required2
run: |
echo "Running ${{ matrix.network }} runtime migration check"
export RUST_LOG=remote-ext=debug,runtime=debug
echo "---------- Executing on-runtime-upgrade for ${{ matrix.network }} ----------"
./try-runtime ${{ matrix.command_extra_args }} \
--runtime ./target/release/wbuild/${{ matrix.package }}/${{ matrix.wasm }} \
on-runtime-upgrade --disable-spec-version-check --checks=all ${{ matrix.subcommand_extra_args }} snap -p snapshot.raw
sleep 5
# name of this job must be unique across all workflows
# otherwise GitHub will mark all these jobs as required
confirm-required-checks-passed:
runs-on: ubuntu-latest
name: All runtime migrations passed
# If any new job gets added, be sure to add it to this array
needs: [check-runtime-migration]
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
+84
View File
@@ -0,0 +1,84 @@
name: check
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: "0"
jobs:
# Compliance is cheap and must always hold.
compliance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Ensure license & attribution files present
run: |
set -e
test -f NOTICE
test -f LICENSE-APACHE
test -f LICENSE-GPL3
echo "compliance files present"
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: rustfmt
run: |
rustup component add rustfmt
cargo fmt --all --check
# Build the runtimes (the on-chain deliverable). This is the gating job.
# Heavy zombienet / emulated integration suites are intentionally NOT run here;
# they are available in-tree and run on demand, not on every push.
runtimes:
# Self-hosted runner (dedicated, isolated box). For security on a public repo,
# this heavy job runs ONLY on push to a branch in this repo or on PRs that
# originate from this repo — never on pull requests from forks, so untrusted
# code cannot execute on the runner.
if: >-
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
runs-on: [self-hosted, substrate-build]
steps:
- uses: actions/checkout@v7
- name: Toolchain & targets
run: |
rustup show
rustup component add rust-src
rustup target add wasm32v1-none wasm32-unknown-unknown
- name: Build runtime WASM (check)
run: |
cargo check --locked \
-p pezkuwichain-runtime \
-p zagros-runtime \
-p asset-hub-pezkuwichain-runtime \
-p asset-hub-zagros-runtime \
-p people-pezkuwichain-runtime \
-p people-zagros-runtime
# The runtimes must also build with the try-runtime feature — this is what makes
# safe storage migrations possible, a fund-critical gate before any upgrade. It is
# light (-p runtimes only), so it stays on the every-push fast path. The heavy
# full-workspace suites (tests, clippy, benches, doc-tests) run nightly in test.yml.
check-try-runtime:
if: >-
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
runs-on: [self-hosted, substrate-build]
steps:
- uses: actions/checkout@v7
- run: |
cargo check --locked --features try-runtime \
-p pezkuwichain-runtime -p zagros-runtime \
-p asset-hub-pezkuwichain-runtime -p asset-hub-zagros-runtime \
-p people-pezkuwichain-runtime -p people-zagros-runtime
-252
View File
@@ -1,252 +0,0 @@
# Checks that doesn't require heavy lifting, like formatting, linting, etc.
name: quick-checks
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
fmt:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- name: Cargo fmt
id: required
run: cargo fmt --all -- --check
check-dependency-rules:
runs-on: ubuntu-latest
needs: isdraft
timeout-minutes: 20
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- name: check dependency rules
run: |
cd bizinikiwi/
../.gitlab/ensure-deps.sh
check-zepter:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- name: fetch deps
run: |
# Pull all dependencies eagerly:
time cargo metadata --format-version=1 --locked > /dev/null
- name: Install newer Zepter
run: |
cargo install zepter@1.82.1 --locked -q
- name: run zepter
run: |
zepter --version
time zepter run check
test-rust-features:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- name: run rust features
run: bash .gitlab/rust-features.sh .
check-toml-format:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- name: check toml format
run: |
taplo format --check --config .config/taplo.toml
echo "Please run `taplo format --config .config/taplo.toml` to fix any toml formatting issues"
check-workspace:
runs-on: ubuntu-latest
needs: isdraft
timeout-minutes: 20
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.0 (22. Sep 2023)
- name: install python deps
run: |
sudo apt-get update && sudo apt-get install -y python3-pip python3
pip3 install toml "cargo-workspace>=1.2.6"
- name: check integrity
run: >
python3 .github/scripts/check-workspace.py .
--exclude
"bizinikiwi/pezframe/contracts/fixtures/build"
"bizinikiwi/pezframe/contracts/fixtures/contracts/common"
- name: deny git deps
run: python3 .github/scripts/deny-git-deps.py .
check-markdown:
runs-on: ubuntu-latest
needs: isdraft
timeout-minutes: 20
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "18.x"
- name: Install tooling
run: |
npm install -g markdownlint-cli
markdownlint --version
- name: Check Markdown
env:
CONFIG: .github/.markdownlint.yaml
run: |
echo "Checking markdown formatting. More info: docs/contributor/markdown_linting.md"
echo "To fix potential errors, you can run 'markdownlint --config .github/.markdownlint.yaml -f --ignore target --ignore vendor .' locally."
markdownlint --config "$CONFIG" --ignore target --ignore vendor .
check-umbrella:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.0 (22. Sep 2023)
- name: install python deps
run: pip3 install "cargo-workspace>=1.2.4" toml
- name: Install newer Zepter
run: |
cargo install zepter@1.82.1 --locked -q && zepter --version
- name: check umbrella correctness
run: |
# Fixes "detected dubious ownership" error in the ci
git config --global --add safe.directory '*'
# Ensure jq is installed
if ! command -v jq &> /dev/null; then
echo "Installing jq..."
apt-get update && apt-get install -y jq
fi
# Extract the umbrella crate version dynamically from cargo metadata
UMBRELLA_VERSION=$(cargo metadata --format-version=1 | jq -r '.packages[] | select(.manifest_path | endswith("umbrella/Cargo.toml")) | .version')
if [ -z "$UMBRELLA_VERSION" ]; then
echo "Warning: Could not determine umbrella version from cargo metadata, using fallback version 0.1.0"
UMBRELLA_VERSION="0.1.0"
fi
echo "Using umbrella crate version: $UMBRELLA_VERSION"
python3 scripts/generate-umbrella.py --sdk . --version "$UMBRELLA_VERSION"
cargo +nightly fmt -p pezkuwi-sdk
if [ -n "$(git status --porcelain)" ]; then
cat <<EOF
👋 Hello developer! Apparently you added a new crate that is not part of the umbrella crate?
You can just apply the patch (git apply PATCH_NAME) that was printed to make this CI check succeed.
Otherwise feel free to ask in the Merge Request or in Matrix chat.
EOF
git diff
exit 1
fi
check-fail-ci:
runs-on: ubuntu-latest
needs: isdraft
steps:
- name: Fetch latest code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install ripgrep
run: |
sudo apt-get update && sudo apt-get install -y ripgrep
- name: Check
run: |
set +e
rg --line-number --hidden --type rust --glob '!{.git,target}' "$ASSERT_REGEX" .; exit_status=$?
if [ $exit_status -eq 0 ]; then
echo "$ASSERT_REGEX was found, exiting with 1";
exit 1;
else
echo "No $ASSERT_REGEX was found, exiting with 0";
exit 0;
fi
env:
ASSERT_REGEX: "FAIL-CI"
GIT_DEPTH: 1
check-readme:
runs-on: ubuntu-latest
needs: isdraft
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Set rust version from env file
run: |
RUST_VERSION=$(cat .github/env | sed -E 's/.*ci-unified:([^-]+)-([^-]+).*/\2/')
echo $RUST_VERSION
echo "RUST_VERSION=${RUST_VERSION}" >> $GITHUB_ENV
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@a0b538fa0b742a6aa35d6e2c169b4bd06d225a98 # v1.15.3
with:
cache: false
toolchain: ${{ env.RUST_VERSION }}
components: cargo, clippy, rust-docs, rust-src, rustfmt, rustc, rust-std
- name: Find README.docify.md files and check generated READMEs
run: .github/scripts/check-missing-readme-generation.sh
confirm-required-checks-quick-jobs-passed:
runs-on: ubuntu-latest
name: All quick checks passed
# If any new job gets added, be sure to add it to this array
needs:
- fmt
- check-dependency-rules
- check-zepter
- test-rust-features
- check-toml-format
- check-workspace
- check-markdown
- check-umbrella
- check-fail-ci
- check-readme
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
-136
View File
@@ -1,136 +0,0 @@
name: Checks
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
cargo-clippy:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_rust }}
timeout-minutes: 90
container:
image: ${{ needs.preflight.outputs.IMAGE }}
volumes:
- /cache/cargo-target/pezkuwi-sdk:/cache/target
env:
RUSTFLAGS: "-D warnings"
SKIP_WASM_BUILD: 1
CARGO_INCREMENTAL: 0
CARGO_TARGET_DIR: /cache/target
WASM_BUILD_WORKSPACE_HINT: ${{ github.workspace }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Rust Cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
shared-key: clippy
cache-on-failure: true
- name: script
id: required
run: |
git config --global --add safe.directory '*'
cargo clippy --all-targets --all-features --locked --workspace --quiet \
--exclude pezpallet-revive-eth-rpc \
--exclude pezkuwi-zombienet-sdk-tests
check-try-runtime:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
needs: [preflight, cargo-clippy]
if: ${{ always() && !cancelled() && needs.preflight.outputs.changes_rust }}
timeout-minutes: 90
container:
image: ${{ needs.preflight.outputs.IMAGE }}
volumes:
- /cache/cargo-target/pezkuwi-sdk:/cache/target
env:
SKIP_WASM_BUILD: 1
CARGO_INCREMENTAL: 0
CARGO_TARGET_DIR: /cache/target
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Rust Cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
shared-key: try-runtime
cache-on-failure: true
- name: script
id: required
run: |
git config --global --add safe.directory '*'
cargo check --locked --all --features try-runtime --quiet
# Check that teyrchain-template will compile with `try-runtime` feature flag.
cargo check --locked -p teyrchain-template-node --features try-runtime
# experimental code may rely on try-runtime and vice-versa
cargo check --locked --all --features try-runtime,experimental --quiet
check-core-crypto-features:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_rust }}
timeout-minutes: 30
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: script
id: required
run: |
cd bizinikiwi/primitives/core
./check-features-variants.sh
cd -
cd bizinikiwi/primitives/application-crypto
./check-features-variants.sh
cd -
cd bizinikiwi/primitives/keyring
./check-features-variants.sh
cd -
# name of this job must be unique across all workflows
# otherwise GitHub will mark all these jobs as required
confirm-required-checks-passed:
runs-on: ubuntu-latest
name: All checks passed
# If any new job gets added, be sure to add it to this array
needs: [cargo-clippy, check-try-runtime, check-core-crypto-features]
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
-507
View File
@@ -1,507 +0,0 @@
name: Command - Run
on:
workflow_dispatch:
inputs:
cmd:
description: "Command to run"
required: true
pr_num:
description: "PR number"
required: true
pr_branch:
description: "PR branch"
required: true
runner:
description: "Runner to use"
required: true
image:
description: "Image to use"
required: true
is_org_member:
description: "Is the user an org member"
required: true
is_pr_author:
description: "Is the user the PR author"
required: true
repo:
description: "Repository to use"
required: true
comment_id:
description: "Comment ID"
required: true
is_quiet:
description: "Quiet mode"
required: false
default: "false"
permissions: # allow the action to comment on the PR
contents: read
issues: write
pull-requests: write
actions: read
jobs:
before-cmd:
runs-on: ubuntu-latest
env:
JOB_NAME: "cmd"
CMD: ${{ github.event.inputs.cmd }}
PR_BRANCH: ${{ github.event.inputs.pr_branch }}
PR_NUM: ${{ github.event.inputs.pr_num }}
outputs:
job_url: ${{ steps.build-link.outputs.job_url }}
run_url: ${{ steps.build-link.outputs.run_url }}
steps:
- name: Build workflow link
if: ${{ github.event.inputs.is_quiet == 'false' }}
id: build-link
run: |
# Get exactly the CMD job link, filtering out the other jobs
jobLink=$(curl -s \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | jq '.jobs[] | select(.name | contains("${{ env.JOB_NAME }}")) | .html_url')
runLink=$(curl -s \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }} | jq '.html_url')
echo "job_url=${jobLink}"
echo "run_url=${runLink}"
echo "job_url=$jobLink" >> $GITHUB_OUTPUT
echo "run_url=$runLink" >> $GITHUB_OUTPUT
- name: Comment PR (Start)
# No need to comment on prdoc start or if --quiet
if: ${{ github.event.inputs.is_quiet == 'false' && !startsWith(github.event.inputs.cmd, 'prdoc') && !startsWith(github.event.inputs.cmd, 'fmt') && !startsWith(github.event.inputs.cmd, 'label')}}
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
let job_url = ${{ steps.build-link.outputs.job_url }}
let cmd = process.env.CMD;
github.rest.issues.createComment({
issue_number: ${{ env.PR_NUM }},
owner: context.repo.owner,
repo: context.repo.repo,
body: `Command "${cmd}" has started 🚀 [See logs here](${job_url})`
})
- name: Debug info
env:
CMD: ${{ github.event.inputs.cmd }}
PR_BRANCH: ${{ github.event.inputs.pr_branch }}
PR_NUM: ${{ github.event.inputs.pr_num }}
RUNNER: ${{ github.event.inputs.runner }}
IMAGE: ${{ github.event.inputs.image }}
IS_ORG_MEMBER: ${{ github.event.inputs.is_org_member }}
REPO: ${{ github.event.inputs.repo }}
COMMENT_ID: ${{ github.event.inputs.comment_id }}
IS_QUIET: ${{ github.event.inputs.is_quiet }}
run: |
echo "Running command: $CMD"
echo "PR number: $PR_NUM"
echo "PR branch: $PR_BRANCH"
echo "Runner: $RUNNER"
echo "Image: $IMAGE"
echo "Is org member: $IS_ORG_MEMBER"
echo "Repository: $REPO"
echo "Comment ID: $COMMENT_ID"
echo "Is quiet: $IS_QUIET"
cmd:
needs: [before-cmd]
env:
CMD: ${{ github.event.inputs.cmd }}
PR_BRANCH: ${{ github.event.inputs.pr_branch }}
PR_NUM: ${{ github.event.inputs.pr_num }}
REPO: ${{ github.event.inputs.repo }}
runs-on: ${{ github.event.inputs.runner }}
container:
image: ${{ github.event.inputs.image }}
timeout-minutes: 1440 # 24 hours per runtime
# lowerdown permissions to separate permissions context for executable parts by contributors
permissions:
contents: read
pull-requests: none
actions: none
issues: none
outputs:
cmd_output: ${{ steps.cmd.outputs.cmd_output }}
subweight: ${{ steps.subweight.outputs.result }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: ${{ env.REPO }}
ref: ${{ env.PR_BRANCH }}
# In order to run prdoc without specifying the PR number, we need to add the PR number as an argument automatically
- name: Prepare PR Number argument
id: pr-arg
run: |
CMD="${CMD}"
if echo "$CMD" | grep -q "prdoc" && ! echo "$CMD" | grep -qE "\-\-pr[[:space:]=][0-9]+"; then
echo "arg=--pr ${PR_NUM}" >> $GITHUB_OUTPUT
else
echo "arg=" >> $GITHUB_OUTPUT
fi
- name: Run cmd
id: cmd
env:
PR_ARG: ${{ steps.pr-arg.outputs.arg }}
IS_ORG_MEMBER: ${{ github.event.inputs.is_org_member }}
IS_PR_AUTHOR: ${{ github.event.inputs.is_pr_author }}
RUNNER: ${{ github.event.inputs.runner }}
IMAGE: ${{ github.event.inputs.image }}
run: |
echo "Running command: '${CMD} ${PR_ARG}' on '${RUNNER}' runner, container: '${IMAGE}'"
echo "RUST_NIGHTLY_VERSION: ${RUST_NIGHTLY_VERSION}"
echo "IS_ORG_MEMBER: ${IS_ORG_MEMBER}"
git config --global --add safe.directory $GITHUB_WORKSPACE
git config user.name "cmd[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
# if the user is not an org member, we need to use the bot's path from master to avoid unwanted modifications
if [ "${IS_ORG_MEMBER}" = "true" ]; then
# safe to run commands from current branch
BOT_PATH=.github
else
# going to run commands from master
TMP_DIR=/tmp/pezkuwi-sdk
git clone --depth 1 --branch master https://github.com/pezkuwichain/pezkuwi-sdk $TMP_DIR
BOT_PATH=$TMP_DIR/.github
fi
# install deps and run a command from master
python3 -m pip install -r $BOT_PATH/scripts/generate-prdoc.requirements.txt
python3 $BOT_PATH/scripts/cmd/cmd.py $CMD $PR_ARG
git status > /tmp/cmd/git_status.log
git diff > /tmp/cmd/git_diff.log
if [ -f /tmp/cmd/command_output.log ]; then
CMD_OUTPUT=$(cat /tmp/cmd/command_output.log)
# export to summary to display in the PR
echo "$CMD_OUTPUT" >> $GITHUB_STEP_SUMMARY
# should be multiline, otherwise it captures the first line only
echo 'cmd_output<<EOF' >> $GITHUB_OUTPUT
echo "$CMD_OUTPUT" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
fi
git add -A
git diff HEAD > /tmp/cmd/command_diff.patch -U0
git commit -m "tmp cmd: $CMD" || true
# without push, as we're saving the diff to an artifact and subweight will compare the local branch with the remote branch
- name: Upload command output
if: ${{ always() }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: command-output
path: /tmp/cmd/command_output.log
- name: Upload command diff
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: command-diff
path: /tmp/cmd/command_diff.patch
- name: Upload git status
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: git-status
path: /tmp/cmd/git_status.log
- name: Upload git diff
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: git-diff
path: /tmp/cmd/git_diff.log
- name: Install subweight for bench
if: startsWith(github.event.inputs.cmd, 'bench')
run: cargo install subweight
- name: Run Subweight for bench
id: subweight
if: startsWith(github.event.inputs.cmd, 'bench')
shell: bash
run: |
git fetch
git remote -v
echo $(git log -n 2 --oneline)
result=$(subweight compare commits \
--path-pattern "./**/weights/**/*.rs,./**/weights.rs" \
--method asymptotic \
--format markdown \
--no-color \
--change added changed \
--ignore-errors \
refs/remotes/origin/master $PR_BRANCH)
echo $result
echo $result > /tmp/cmd/subweight.log
# Though github claims that it supports 1048576 bytes in GITHUB_OUTPUT in fact it only supports ~200000 bytes of a multiline string
if [ $(wc -c < "/tmp/cmd/subweight.log") -gt 200000 ]; then
echo "Subweight result is too large, truncating..."
echo "Please check subweight.log for the full output"
result="Please check subweight.log for the full output"
fi
echo "Trying to save subweight result to GITHUB_OUTPUT"
# Save the multiline result to the output
{
echo "result<<EOF"
echo "$result"
echo "EOF"
} >> $GITHUB_OUTPUT
- name: Upload Subweight
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: startsWith(github.event.inputs.cmd, 'bench')
with:
name: subweight
path: /tmp/cmd/subweight.log
after-cmd:
needs: [cmd, before-cmd]
env:
CMD: ${{ github.event.inputs.cmd }}
PR_BRANCH: ${{ github.event.inputs.pr_branch }}
PR_NUM: ${{ github.event.inputs.pr_num }}
REPO: ${{ github.event.inputs.repo }}
runs-on: ubuntu-latest
steps:
# needs to be able to trigger CI, as default token does not retrigger
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
id: generate_token
with:
app-id: ${{ secrets.CMD_BOT_APP_ID }}
private-key: ${{ secrets.CMD_BOT_APP_KEY }}
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
token: ${{ steps.generate_token.outputs.token }}
repository: ${{ env.REPO }}
ref: ${{ env.PR_BRANCH }}
- name: Download all artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: command-diff
path: command-diff
- name: Apply labels for label command
if: startsWith(github.event.inputs.cmd, 'label')
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
github-token: ${{ steps.generate_token.outputs.token }}
script: |
// Read the command output to get validated labels
const fs = require('fs');
let labels = [];
try {
const output = fs.readFileSync('/tmp/cmd/command_output.log', 'utf8');
// Parse JSON labels from output - look for "LABELS_JSON: {...}"
const jsonMatch = output.match(/LABELS_JSON: (.+)/);
if (jsonMatch) {
const labelsData = JSON.parse(jsonMatch[1]);
labels = labelsData.labels || [];
}
} catch (error) {
console.error(`Error reading command output: ${error.message}`);
throw new Error('Label validation failed. Check the command output for details.');
}
if (labels.length > 0) {
try {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ env.PR_NUM }},
labels: labels
});
} catch (error) {
console.error(`Error adding labels: ${error.message}`);
throw error;
}
}
- name: Comment PR (Label Error)
if: ${{ failure() && startsWith(github.event.inputs.cmd, 'label') }}
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
CMD_OUTPUT: "${{ needs.cmd.outputs.cmd_output }}"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
let runUrl = ${{ needs.before-cmd.outputs.run_url }};
let cmdOutput = process.env.CMD_OUTPUT || '';
// Try to parse JSON error for better formatting
let errorMessage = 'Label validation failed. Please check the error details below and try again.';
let errorDetails = '';
try {
const errorMatch = cmdOutput.match(/ERROR_JSON: (.+)/);
if (errorMatch) {
const errorData = JSON.parse(errorMatch[1]);
errorMessage = errorData.message || errorMessage;
errorDetails = errorData.details || '';
}
} catch (e) {
// Fallback to raw output
errorDetails = cmdOutput;
}
let cmdOutputCollapsed = errorDetails.trim() !== ''
? `<details>\n\n<summary>Error details:</summary>\n\n${errorDetails}\n\n</details>`
: '';
github.rest.issues.createComment({
issue_number: ${{ env.PR_NUM }},
owner: context.repo.owner,
repo: context.repo.repo,
body: `❌ ${errorMessage}\n\n${cmdOutputCollapsed}\n\n[See full logs here](${runUrl})`
})
- name: Apply & Commit changes
if: ${{ !startsWith(github.event.inputs.cmd, 'label') }}
run: |
ls -lsa .
git config --global --add safe.directory $GITHUB_WORKSPACE
git config user.name "cmd[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global pull.rebase false
echo "Applying $file"
git apply "command-diff/command_diff.patch" --unidiff-zero --allow-empty
rm -rf command-diff
git status
if [ -n "$(git status --porcelain)" ]; then
git remote -v
push_changes() {
git push origin "HEAD:$PR_BRANCH"
}
git add .
git restore --staged Cargo.lock # ignore changes in Cargo.lock
git commit -m "Update from ${{ github.actor }} running command '$CMD'" || true
# Attempt to push changes
if ! push_changes; then
echo "Push failed, trying to rebase..."
git pull --rebase origin $PR_BRANCH
# After successful rebase, try pushing again
push_changes
fi
else
echo "Nothing to commit";
fi
- name: Comment PR (End)
# No need to comment on prdoc success or --quiet
#TODO: return "&& !contains(github.event.comment.body, '--quiet')"
if: ${{ github.event.inputs.is_quiet == 'false' && needs.cmd.result == 'success' && !startsWith(github.event.inputs.cmd, 'prdoc') && !startsWith(github.event.inputs.cmd, 'fmt') && !startsWith(github.event.inputs.cmd, 'label') }}
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
SUBWEIGHT: "${{ needs.cmd.outputs.subweight }}"
CMD_OUTPUT: "${{ needs.cmd.outputs.cmd_output }}"
PR_NUM: ${{ github.event.inputs.pr_num }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
let runUrl = ${{ needs.before-cmd.outputs.run_url }};
let subweight = process.env.SUBWEIGHT || '';
let cmdOutput = process.env.CMD_OUTPUT || '';
let cmd = process.env.CMD;
console.log(cmdOutput);
let subweightCollapsed = subweight.trim() !== ''
? `<details>\n\n<summary>Subweight results:</summary>\n\n${subweight}\n\n</details>`
: '';
let cmdOutputCollapsed = cmdOutput.trim() !== ''
? `<details>\n\n<summary>Command output:</summary>\n\n${cmdOutput}\n\n</details>`
: '';
github.rest.issues.createComment({
issue_number: ${{ env.PR_NUM }},
owner: context.repo.owner,
repo: context.repo.repo,
body: `Command "${cmd}" has finished ✅ [See logs here](${runUrl})${subweightCollapsed}${cmdOutputCollapsed}`
})
finish:
needs: [before-cmd, cmd, after-cmd]
if: ${{ always() }}
runs-on: ubuntu-latest
env:
CMD_OUTPUT: "${{ needs.cmd.outputs.cmd_output }}"
CMD: ${{ github.event.inputs.cmd }}
PR_NUM: ${{ github.event.inputs.pr_num }}
COMMENT_ID: ${{ github.event.inputs.comment_id }}
steps:
- name: Comment PR (Failure)
if: ${{ needs.cmd.result == 'failure' || needs.after-cmd.result == 'failure' || needs.before-cmd.result == 'failure' }}
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
let jobUrl = ${{ needs.before-cmd.outputs.job_url }};
let cmdOutput = process.env.CMD_OUTPUT;
let cmd = process.env.CMD;
let cmdOutputCollapsed = '';
if (cmdOutput && cmdOutput.trim() !== '') {
cmdOutputCollapsed = `<details>\n\n<summary>Command output:</summary>\n\n${cmdOutput}\n\n</details>`
}
github.rest.issues.createComment({
issue_number: ${{ env.PR_NUM }},
owner: context.repo.owner,
repo: context.repo.repo,
body: `Command "${cmd}" has failed ❌! [See logs here](${jobUrl})${cmdOutputCollapsed}`
})
- name: Add 😕 reaction on failure
if: ${{ needs.cmd.result == 'failure' || needs.after-cmd.result == 'failure' || needs.before-cmd.result == 'failure' }}
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.reactions.createForIssueComment({
comment_id: ${{ env.COMMENT_ID }},
owner: context.repo.owner,
repo: context.repo.repo,
content: 'confused'
})
- name: Add 👍 reaction on success
if: ${{ needs.cmd.result == 'success' && needs.after-cmd.result == 'success' && needs.before-cmd.result == 'success' }}
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.reactions.createForIssueComment({
comment_id: ${{ env.COMMENT_ID }},
owner: context.repo.owner,
repo: context.repo.repo,
content: '+1'
})
-22
View File
@@ -1,22 +0,0 @@
name: Command Bot Tests
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
test-cmd-bot:
runs-on: ubuntu-latest
needs: [isdraft]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- run: python3 .github/scripts/cmd/test_cmd.py
-334
View File
@@ -1,334 +0,0 @@
name: Command
on:
issue_comment: # listen for comments on issues
types: [created]
permissions: # allow the action to comment in PR
contents: read
issues: write
pull-requests: write
actions: read
jobs:
is-org-member:
if: startsWith(github.event.comment.body, '/cmd')
runs-on: ubuntu-latest
outputs:
member: ${{ steps.is-member.outputs.result }}
steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
with:
app-id: ${{ secrets.CMD_BOT_APP_ID }}
private-key: ${{ secrets.CMD_BOT_APP_KEY }}
- name: Check if user is a member of the organization
id: is-member
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
github-token: ${{ steps.generate_token.outputs.token }}
result-encoding: string
script: |
const fs = require("fs");
try {
const org = '${{ github.event.repository.owner.login }}';
const username = '${{ github.event.comment.user.login }}';
const membership = await github.rest.orgs.checkMembershipForUser({
org: org,
username: username
});
console.log(membership, membership.status, membership.status === 204);
if (membership.status === 204) {
return 'true';
} else {
console.log(membership);
fs.appendFileSync(process.env["GITHUB_STEP_SUMMARY"], `${membership.data && membership.data.message || 'Unknown error happened, please check logs'}`);
}
} catch (error) {
console.log(error)
}
return 'false';
acknowledge:
if: ${{ startsWith(github.event.comment.body, '/cmd') }}
runs-on: ubuntu-latest
steps:
- name: Add reaction to triggered comment
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.reactions.createForIssueComment({
comment_id: ${{ github.event.comment.id }},
owner: context.repo.owner,
repo: context.repo.repo,
content: 'eyes'
})
clean:
runs-on: ubuntu-latest
steps:
- name: Clean previous comments
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
if: ${{ startsWith(github.event.comment.body, '/cmd') && contains(github.event.comment.body, '--clean') }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo
}).then(comments => {
for (let comment of comments.data) {
console.log(comment)
if (
${{ github.event.comment.id }} !== comment.id &&
(
(
(
comment.body.startsWith('Command') ||
comment.body.startsWith('<details><summary>Command') ||
comment.body.startsWith('Sorry, only ')
) && comment.user.type === 'Bot'
) ||
(comment.body.startsWith('/cmd') && comment.user.login === context.actor)
)
) {
github.rest.issues.deleteComment({
comment_id: comment.id,
owner: context.repo.owner,
repo: context.repo.repo
})
}
}
})
get-pr-info:
if: ${{ startsWith(github.event.comment.body, '/cmd') }}
runs-on: ubuntu-latest
outputs:
CMD: ${{ steps.get-comment.outputs.group2 }}
pr-branch: ${{ steps.get-pr.outputs.pr_branch }}
repo: ${{ steps.get-pr.outputs.repo }}
steps:
- name: Get command
uses: actions-ecosystem/action-regex-match@9e6c4fb3d5e898f505be7a1fb6e7b0a278f6665b # v2.0.2
id: get-comment
with:
text: ${{ github.event.comment.body }}
regex: "^(\\/cmd )([-\\/\\s\\w.=:]+)$" # see explanation in docs/contributor/commands-readme.md#examples
# Get PR branch name, because the issue_comment event does not contain the PR branch name
- name: Check if the issue is a PR
id: check-pr
run: |
if [ -n "${{ github.event.issue.pull_request.url }}" ]; then
echo "This is a pull request comment"
else
echo "This is not a pull request comment"
exit 1
fi
- name: Get PR Branch Name and Repo
if: steps.check-pr.outcome == 'success'
id: get-pr
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
});
const prBranch = pr.data.head.ref;
const repo = pr.data.head.repo.full_name;
console.log(prBranch, repo)
core.setOutput('pr_branch', prBranch);
core.setOutput('repo', repo);
- name: Use PR Branch Name and Repo
env:
PR_BRANCH: ${{ steps.get-pr.outputs.pr_branch }}
REPO: ${{ steps.get-pr.outputs.repo }}
CMD: ${{ steps.get-comment.outputs.group2 }}
run: |
echo "The PR branch is $PR_BRANCH"
echo "The repository is $REPO"
echo "The CMD is $CMD"
help:
needs: [clean, get-pr-info]
if: ${{ startsWith(github.event.comment.body, '/cmd') && contains(github.event.comment.body, '--help') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Save output of help
id: help
env:
CMD: ${{ needs.get-pr-info.outputs.CMD }} # to avoid "" around the command
run: |
python3 -m pip install -r .github/scripts/generate-prdoc.requirements.txt
echo 'help<<EOF' >> $GITHUB_OUTPUT
python3 .github/scripts/cmd/cmd.py $CMD >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Comment PR (Help)
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `<details><summary>Command help:</summary>
\`\`\`
${{ steps.help.outputs.help }}
\`\`\`
</details>`
})
- name: Add confused reaction on failure
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
if: ${{ failure() }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.reactions.createForIssueComment({
comment_id: ${{ github.event.comment.id }},
owner: context.repo.owner,
repo: context.repo.repo,
content: 'confused'
})
- name: Add 👍 reaction on success
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
if: ${{ !failure() }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.reactions.createForIssueComment({
comment_id: ${{ github.event.comment.id }},
owner: context.repo.owner,
repo: context.repo.repo,
content: '+1'
})
set-image:
needs: [clean, get-pr-info]
if: ${{ startsWith(github.event.comment.body, '/cmd') && !contains(github.event.comment.body, '--help') }}
runs-on: ubuntu-latest
env:
CMD: ${{ needs.get-pr-info.outputs.CMD }}
outputs:
IMAGE: ${{ steps.set-image.outputs.IMAGE }}
RUNNER: ${{ steps.set-image.outputs.RUNNER }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- id: set-image
run: |
BODY=$(echo "$CMD" | xargs) # remove whitespace
IMAGE_OVERRIDE=$(echo $BODY | grep -oe 'docker.io/pezkuwi/ci-unified:.*\s' | xargs)
cat .github/env >> $GITHUB_OUTPUT
if [ -n "$IMAGE_OVERRIDE" ]; then
IMAGE=$IMAGE_OVERRIDE
echo "IMAGE=$IMAGE" >> $GITHUB_OUTPUT
fi
# Use GitHub-hosted runners for Pezkuwi SDK
echo "RUNNER=ubuntu-latest" >> $GITHUB_OUTPUT
- name: Print outputs
run: |
echo "RUNNER=${{ steps.set-image.outputs.RUNNER }}"
echo "IMAGE=${{ steps.set-image.outputs.IMAGE }}"
check-pr-author:
runs-on: ubuntu-latest
outputs:
is_author: ${{ steps.check-author.outputs.result }}
steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
with:
app-id: ${{ secrets.CMD_BOT_APP_ID }}
private-key: ${{ secrets.CMD_BOT_APP_KEY }}
- name: Check if user is PR author
id: check-author
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
github-token: ${{ steps.generate_token.outputs.token }}
result-encoding: string
script: |
const commentUser = '${{ github.event.comment.user.login }}';
const prNumber = ${{ github.event.issue.number }};
try {
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber
});
const prAuthor = pr.data.user.login;
return commentUser === prAuthor ? 'true' : 'false';
} catch (error) {
console.error('Error checking PR author:', error);
return 'false';
}
run-cmd-workflow:
needs: [set-image, get-pr-info, is-org-member, check-pr-author]
runs-on: ubuntu-latest
# don't run on help command
if: ${{ startsWith(github.event.comment.body, '/cmd') && !contains(github.event.comment.body, '--help') }}
permissions: # run workflow
contents: read
issues: write
pull-requests: write
actions: write
env:
CMD: ${{ needs.get-pr-info.outputs.CMD }}
PR_BRANCH: ${{ needs.get-pr-info.outputs.pr-branch }}
RUNNER: ${{ needs.set-image.outputs.RUNNER }}
IMAGE: ${{ needs.set-image.outputs.IMAGE }}
REPO: ${{ needs.get-pr-info.outputs.repo }}
IS_ORG_MEMBER: ${{ needs.is-org-member.outputs.member }}
IS_PR_AUTHOR: ${{ needs.check-pr-author.outputs.is_author }}
COMMENT_ID: ${{ github.event.comment.id }}
PR_NUMBER: ${{ github.event.issue.number }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Start cmd with gh cli
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh workflow run cmd-run.yml \
--ref cmd-bot \
-f cmd="${CMD}" \
-f repo="${REPO}" \
-f pr_branch="${PR_BRANCH}" \
-f pr_num="${PR_NUMBER}" \
-f runner="${RUNNER}" \
-f is_org_member="${IS_ORG_MEMBER}" \
-f is_pr_author="${IS_PR_AUTHOR}" \
-f comment_id="${COMMENT_ID}" \
-f image="${IMAGE}" \
-f is_quiet="${{ contains(github.event.comment.body, '--quiet') }}"
-216
View File
@@ -1,216 +0,0 @@
name: Docs
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
test-doc:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 300
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
volumes:
- /cache/cargo-target/pezkuwi-sdk-docs:/cache/target
env:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
CARGO_INCREMENTAL: 0
CARGO_TARGET_DIR: /cache/target
WASM_BUILD_WORKSPACE_HINT: ${{ github.workspace }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
# Clean stale caches from other workflows that ran on this VPS runner.
# Each VPS has limited disk; leftover caches from tests/checks can fill it.
- name: Clean stale caches
run: |
echo "Disk before cleanup:"
df -h /cache 2>/dev/null || df -h /
for dir in /cache/cargo-target/*/; do
[ "$dir" = "/cache/cargo-target/pezkuwi-sdk-docs/" ] && continue
echo "Removing stale cache: $dir"
rm -rf "$dir"
done
echo "Disk after cleanup:"
df -h /cache 2>/dev/null || df -h /
# Exclude pezkuwi-zombienet-sdk-tests: its build.rs runs nested cargo build
# which doesn't inherit workspace [patch.crates-io] settings, causing
# serde_core duplicate lang item error. See: https://github.com/pezkuwichain/pezkuwi-sdk/issues/357
- name: script
id: required
run: |
git config --global --add safe.directory '*'
cargo test --doc --workspace --locked --all-features --exclude pezkuwi-zombienet-sdk-tests --exclude pezpallet-revive-eth-rpc
build-rustdoc:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 240
continue-on-error: true
if: ${{ always() && !cancelled() && needs.preflight.outputs.changes_rust }}
needs: [preflight, test-doc]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
volumes:
- /cache/cargo-target/pezkuwi-sdk-docs:/cache/target
env:
SKIP_WASM_BUILD: 1
CARGO_INCREMENTAL: 0
CARGO_TARGET_DIR: /cache/target
RUSTDOCFLAGS: "-Dwarnings --default-theme=ayu --html-in-header ./docs/sdk/assets/header.html --extend-css ./docs/sdk/assets/theme.css --html-after-content ./docs/sdk/assets/after-content.html"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
# Exclude pezkuwi-zombienet-sdk-tests: nested cargo build in build.rs
# doesn't inherit workspace patches. See test-doc job comment.
- name: script
id: required
run: |
git config --global --add safe.directory '*'
cargo doc --all-features --workspace --no-deps --locked --exclude pezkuwi-zombienet-sdk-tests --exclude pezpallet-revive-eth-rpc
- run: rm -f ${CARGO_TARGET_DIR}/doc/.lock
- run: mv ${CARGO_TARGET_DIR}/doc ./crate-docs
- name: Inject Simple Analytics script
run: |
script_content="<script async defer src=\"https://apisa.pezkuwichain.io/latest.js\"></script><noscript><img src=\"https://apisa.pezkuwichain.io/latest.js\" alt=\"\" referrerpolicy=\"no-referrer-when-downgrade\" /></noscript>"
docs_dir="./crate-docs"
inject_simple_analytics() {
find "$1" -name '*.html' | xargs -I {} -P "$(nproc)" bash -c 'file="{}"; echo "Adding Simple Analytics script to $file"; sed -i "s|</head>|'"$2"'</head>|" "$file";'
}
inject_simple_analytics "$docs_dir" "$script_content"
- run: echo "<meta http-equiv=refresh content=0;url=pezkuwi_sdk_docs/index.html>" > ./crate-docs/index.html
- name: Compress docs for upload
run: tar czf crate-docs.tar.gz -C . crate-docs/
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ github.sha }}-doc
path: crate-docs.tar.gz
retention-days: 1
if-no-files-found: error
compression-level: 0
build-implementers-guide:
runs-on: ubuntu-latest
needs: isdraft
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install mdbook
run: |
cargo install mdbook --version 0.4.35 --locked
- run: mdbook build ./pezkuwi/roadmap/implementers-guide
- run: mkdir -p artifacts
- run: mv pezkuwi/roadmap/implementers-guide/book artifacts/
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ github.sha }}-guide
path: ./artifacts/
retention-days: 1
if-no-files-found: error
confirm-required-jobs-passed:
runs-on: ubuntu-latest
name: All docs jobs passed
# If any new job gets added, be sure to add it to this array
needs: [test-doc, build-implementers-guide]
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
publish-rustdoc:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
environment: subsystem-benchmarks
needs: [build-rustdoc, build-implementers-guide]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: gh-pages
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
id: app-token
with:
app-id: ${{ secrets.PEZKUWI_GHPAGES_APP_ID }}
private-key: ${{ secrets.PEZKUWI_GHPAGES_APP_KEY }}
- name: Ensure destination dir does not exist
run: |
rm -rf book/
rm -rf ${REF_NAME}
env:
REF_NAME: ${{ github.head_ref || github.ref_name }}
- name: Download rustdocs
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: ${{ github.sha }}-doc
path: /tmp/rustdocs
- name: Extract rustdocs
run: |
tar xzf /tmp/rustdocs/crate-docs.tar.gz -C .
mv crate-docs ${REF_NAME}
env:
REF_NAME: ${{ github.head_ref || github.ref_name }}
- name: Download guide
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: ${{ github.sha }}-guide
path: /tmp
- run: mkdir -p book
- name: Move book files
run: mv /tmp/book/html/* book/
- name: Push changes to gh-pages
env:
TOKEN: ${{ steps.app-token.outputs.token }}
APP_NAME: "pezkuwichain-upd-ghpages"
REF_NAME: ${{ github.head_ref || github.ref_name }}
Green: "\e[32m"
NC: "\e[0m"
run: |
echo "${Green}Git add${NC}"
git add book/
git add ${REF_NAME}/
echo "${Green}git status | wc -l${NC}"
git status | wc -l
echo "${Green}Add new remote with gh app token${NC}"
git remote set-url origin $(git config remote.origin.url | sed "s/github.com/${APP_NAME}:${TOKEN}@github.com/g")
echo "${Green}Remove http section that causes issues with gh app auth token${NC}"
sed -i.bak '/\[http/d' ./.git/config
sed -i.bak '/extraheader/d' ./.git/config
echo "${Green}Git push${NC}"
git config user.email "ci@pezkuwichain.io"
git config user.name "${APP_NAME}"
git commit --amend -m "___Updated docs" || echo "___Nothing to commit___"
git push origin gh-pages --force
-17
View File
@@ -1,17 +0,0 @@
# If the author of the issues is not a contributor to the project, label
# the issue with 'Z0-unconfirmed'
name: Label New Issues
on:
issues:
types: [opened]
jobs:
label-new-issues:
runs-on: ubuntu-latest
steps:
- name: Label drafts
uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90 # 1.0.4
if: github.event.issue.author_association == 'NONE'
with:
add-labels: "I10-unconfirmed"
-41
View File
@@ -1,41 +0,0 @@
# Mirror upstream CI image to GHCR so we control our own build infrastructure.
# Runs manually or when .github/env changes (new CI image version).
name: Mirror CI Image
on:
workflow_dispatch:
push:
branches: [main]
paths: [".github/env"]
permissions:
packages: write
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Read source image from env file
id: source
run: |
SOURCE_IMAGE=$(grep '^IMAGE=' .github/env | cut -d'"' -f2)
TAG=$(echo "$SOURCE_IMAGE" | cut -d: -f2)
echo "source=$SOURCE_IMAGE" >> "$GITHUB_OUTPUT"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "Source: $SOURCE_IMAGE"
- name: Log in to GHCR
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull, tag, and push to GHCR
run: |
docker pull "${{ steps.source.outputs.source }}"
docker tag "${{ steps.source.outputs.source }}" "ghcr.io/pezkuwichain/ci-unified:${{ steps.source.outputs.tag }}"
docker push "ghcr.io/pezkuwichain/ci-unified:${{ steps.source.outputs.tag }}"
echo "Mirrored to ghcr.io/pezkuwichain/ci-unified:${{ steps.source.outputs.tag }}"
@@ -1,25 +0,0 @@
# Actions that makes review-bot green in the merge queue
name: Merge-Queue
on:
merge_group:
jobs:
trigger-merge-queue-action:
runs-on: ubuntu-latest
environment: merge-queues
steps:
- name: Generate token
id: app_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{ secrets.REVIEW_APP_ID }}
private_key: ${{ secrets.REVIEW_APP_KEY }}
- name: Add Merge Queue status check
uses: billyjbryant/create-status-check@3e6fa0ac599d10d9588cf9516ca4330ef669b858 # v2
with:
authToken: ${{ steps.app_token.outputs.token }}
context: "review-bot"
description: "PRs for merge queue gets approved"
state: "success"
sha: ${{ github.event.merge_group.head_commit.id }}
@@ -1,84 +0,0 @@
name: Check publish build
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
check-publish-compile:
timeout-minutes: 90
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- name: Rust Cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: install pezkuwi-publish
run: |
cargo install pezkuwi-publish@0.10.6 --locked -q
- name: set current PR's prdoc name in a variable
env:
GITHUB_PR_NUM: ${{ github.event.pull_request.number }}
run: |
echo "CURRENT_PRDOC=pr_${GITHUB_PR_NUM}.prdoc" >> $GITHUB_ENV
- name: pezkuwi-publish update plan w/o current prdoc
run: |
if [ -f prdoc/$CURRENT_PRDOC ]; then
mv prdoc/$CURRENT_PRDOC .
fi
pezkuwi-publish --color always plan --skip-check --prdoc prdoc/
# The code base is not in master's state (due to commits brought by the
# current PR), but we're interested in all master's prdocs to be applied
# as if master is a stable branch, and in next steps we're following up with
# a patch release of all crates based on some newly added prdocs
# (meaning only the current prdoc).
- name: pezkuwi-publish apply plan on the code state prior to current prdoc
run: pezkuwi-publish --color always apply --registry
- name: move all prdocs except current one to unstable dir
run: |
if [ -f $CURRENT_PRDOC ]; then
mkdir prdoc/unstable
mv prdoc/pr_*.prdoc prdoc/unstable
mv $CURRENT_PRDOC prdoc
fi
- name: pezkuwi-publish update plan just for PR's prdoc
run: |
if [ -f "prdoc/$CURRENT_PRDOC" ]; then
pezkuwi-publish --color always plan --skip-check --prdoc prdoc/
fi
- name: pezkuwi-publish apply plan
run: |
if [ -f "prdoc/$CURRENT_PRDOC" ]; then
pezkuwi-publish --color always apply --registry
fi
- name: pezkuwi-publish check compile
run: |
packages="$(pezkuwi-publish apply --print)"
if [ -n "$packages" ]; then
cargo --color always check $(printf -- '-p %s ' $packages)
fi
@@ -1,48 +0,0 @@
name: Check publish
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
check-publish:
runs-on: ubuntu-latest
needs: isdraft
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- name: Check for publishable crates
id: check-publishable
run: |
# Find crates that are publishable (don't have publish = false)
PUBLISHABLE=$(find . -name "Cargo.toml" -exec grep -L 'publish = false' {} \; | grep -v target | head -20)
if [ -z "$PUBLISHABLE" ]; then
echo "No publishable crates found (all have publish = false)"
echo "has_publishable=false" >> $GITHUB_OUTPUT
else
echo "Found publishable crates:"
echo "$PUBLISHABLE"
echo "has_publishable=true" >> $GITHUB_OUTPUT
fi
- name: Rust Cache
if: steps.check-publishable.outputs.has_publishable == 'true'
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: Install pezkuwi-publish (when ready)
if: steps.check-publishable.outputs.has_publishable == 'true'
run: |
echo "Publishable crates detected - publish checks will run when pezkuwi-publish tool is ready"
# TODO: Replace with pezkuwi-publish when available
# cargo install pezkuwi-publish --locked -q
- name: Skip - all crates have publish = false
if: steps.check-publishable.outputs.has_publishable == 'false'
run: echo "All crates have publish = false, skipping publish checks"
+67
View File
@@ -0,0 +1,67 @@
name: quick-checks
# Fast, lightweight correctness gates. These run on GitHub-hosted runners (free,
# parallel) so they do not consume the self-hosted build runner. Ported and adapted
# from the upstream Substrate quick-checks.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Cargo.toml formatting is consistent (taplo).
toml-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install taplo
run: cargo install taplo-cli --locked -q || cargo install taplo-cli --locked
- name: Check TOML formatting
run: taplo format --check --config .config/taplo.toml
# Feature propagation is correct across the dependency tree (std / runtime-benchmarks
# / try-runtime). Broken propagation can produce a runtime that does not build no_std
# — a fund-critical correctness property.
zepter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install zepter
run: cargo install zepter@1.82.1 --locked -q || cargo install zepter@1.82.1 --locked
- name: Run zepter
run: zepter run check
# No leftover CI-blocking markers in the tree.
fail-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Check for FAIL-CI markers
run: |
set -e
if grep -rI --include="*.rs" --exclude-dir=target "FAIL-CI" .; then
echo "::error::Found FAIL-CI marker(s) — resolve before merging."
exit 1
fi
echo "no FAIL-CI markers"
# No git dependencies sneak into the workspace (reproducibility). Vendored/patched
# crates are allowed via [patch]; this guards [dependencies].
no-git-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install checker deps
run: python3 -m pip install --break-system-packages "cargo-workspace>=1.2.4" toml
- name: Deny git dependencies in [workspace.dependencies]
# [patch.crates-io] entries (vendored/wasm-fix forks) are allowed and not checked.
run: python3 .github/scripts/deny-git-deps.py .
-300
View File
@@ -1,300 +0,0 @@
name: Release - Build node release candidate
on:
workflow_dispatch:
inputs:
binary:
description: Binary to be build for the release
default: all
type: choice
options:
- pezkuwi
- pezkuwi-teyrchain
- pezkuwi-omni-node
- pezframe-omni-bencher
- chain-spec-builder
- bizinikiwi-node
- eth-rpc
- pez-subkey
- all
release_tag:
description: Tag matching the actual release candidate with the format pezkuwi-stableYYMM(-X)-rcX or pezkuwi-stableYYMM(-X)
type: string
workflow_call:
inputs:
binary:
description: Binary to be built for the release
default: all
type: string
release_tag:
description: Tag matching the actual release candidate with the format pezkuwi-stableYYMM(-X)-rcY or pezkuwi-stableYYMM(-X)
type: string
jobs:
# DISABLED: Workflow synchronization check
# check-synchronization:
# uses: pezkuwichain-release/sync-workflows/.github/workflows/check-synchronization.yml@main
# secrets:
# fork_writer_app_key: ${{ secrets.UPSTREAM_CONTENT_SYNC_APP_KEY }}
validate-inputs:
runs-on: ubuntu-latest
outputs:
release_tag: ${{ steps.validate_inputs.outputs.release_tag }}
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Validate inputs
id: validate_inputs
run: |
. ./.github/scripts/common/lib.sh
RELEASE_TAG=$(validate_stable_tag ${{ inputs.release_tag }})
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
build-pezkuwi-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'pezkuwi' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["pezkuwi", "pezkuwi-prepare-worker", "pezkuwi-execute-worker"]'
package: pezkuwi
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: x86_64-unknown-linux-gnu
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-pezkuwi-teyrchain-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'pezkuwi-teyrchain' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["pezkuwi-teyrchain"]'
package: "pezkuwi-teyrchain-bin"
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: x86_64-unknown-linux-gnu
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-pezkuwi-omni-node-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'pezkuwi-omni-node' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["pezkuwi-omni-node"]'
package: "pezkuwi-omni-node"
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: x86_64-unknown-linux-gnu
features: runtime-benchmarks
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-pezframe-omni-bencher-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'pezframe-omni-bencher' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["pezframe-omni-bencher"]'
package: "pezframe-omni-bencher"
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: x86_64-unknown-linux-gnu
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-chain-spec-builder-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'chain-spec-builder' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["chain-spec-builder"]'
package: pez-staging-chain-spec-builder
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: x86_64-unknown-linux-gnu
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-bizinikiwi-node-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'bizinikiwi-node' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["bizinikiwi-node"]'
package: pezstaging-node-cli
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: x86_64-unknown-linux-gnu
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-eth-rpc-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'eth-rpc' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["eth-rpc"]'
package: pezpallet-revive-eth-rpc
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: x86_64-unknown-linux-gnu
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-pez-subkey-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'pez-subkey' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["pez-subkey"]'
package: pez-subkey
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: x86_64-unknown-linux-gnu
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-pezkuwi-macos-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'pezkuwi' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["pezkuwi", "pezkuwi-prepare-worker", "pezkuwi-execute-worker"]'
package: pezkuwi
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: aarch64-apple-darwin
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-pezkuwi-teyrchain-macos-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'pezkuwi-teyrchain' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["pezkuwi-teyrchain"]'
package: pezkuwi-teyrchain-bin
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: aarch64-apple-darwin
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-pezkuwi-omni-node-macos-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'pezkuwi-omni-node' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["pezkuwi-omni-node"]'
package: pezkuwi-omni-node
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: aarch64-apple-darwin
features: runtime-benchmarks
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-pezframe-omni-bencher-macos-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'pezframe-omni-bencher' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["pezframe-omni-bencher"]'
package: pezframe-omni-bencher
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: aarch64-apple-darwin
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-chain-spec-builder-macos-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'chain-spec-builder' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["chain-spec-builder"]'
package: pez-staging-chain-spec-builder
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: aarch64-apple-darwin
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-bizinikiwi-node-macos-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'bizinikiwi-node' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["bizinikiwi-node"]'
package: pezstaging-node-cli
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: aarch64-apple-darwin
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-eth-rpc-macos-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'eth-rpc' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["eth-rpc"]'
package: pezpallet-revive-eth-rpc
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: aarch64-apple-darwin
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-pez-subkey-macos-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'pez-subkey' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-build.yml"
with:
binary: '["pez-subkey"]'
package: pez-subkey
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: aarch64-apple-darwin
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
@@ -1,90 +0,0 @@
name: Release - Build runtimes
on:
workflow_dispatch:
inputs:
chain:
description: The chain to use
default: all
required: true
type: choice
options:
- all
- zagros
- asset-hub-zagros
- bridge-hub-zagros
- collectives-zagros
- coretime-zagros
- glutton-zagros
- people-zagros
runtime_dir:
description: The runtime dir to be used (⚠️ this parameter is optional and needed only in case of the single runtime build, set it accordingly to the runtime you want to build)
default: pezkuwi/runtime/zagros
type: choice
options:
- pezkuwi/runtime/zagros
- pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros
- pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros
- pezcumulus/teyrchains/runtimes/collectives/collectives-zagros
- pezcumulus/teyrchains/runtimes/coretime/coretime-zagros
- pezcumulus/teyrchains/runtimes/people/people-zagros
- pezcumulus/teyrchains/runtimes/glutton/glutton-zagros
release_tag:
description: Tag matching the actual release candidate with the format pezkuwi-stableYYMM(-X)-rcY or pezkuwi-stableYYMM(-X)
type: string
workflow_call:
inputs:
chain:
description: The chain to use
default: all
required: true
type: string
runtime_dir:
description: The runtime dir to be used (⚠️ this parameter is optional and needed only in case of the single runtime build, set it accordingly to the runtime you want to build)
default: pezkuwi/runtime/zagros
type: string
release_tag:
description: Tag matching the actual release candidate with the format pezkuwi-stableYYMM(-X)-rcY or pezkuwi-stableYYMM(-X)
type: string
outputs:
published_runtimes:
value: ${{ jobs.build-runtimes.outputs.published_runtimes }}
jobs:
# DISABLED: Workflow synchronization check
# check-synchronization:
# uses: pezkuwichain-release/sync-workflows/.github/workflows/check-synchronization.yml@main
# secrets:
# fork_writer_app_key: ${{ secrets.UPSTREAM_CONTENT_SYNC_APP_KEY }}
validate-inputs:
runs-on: ubuntu-latest
outputs:
release_tag: ${{ steps.validate_inputs.outputs.release_tag }}
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Validate inputs
id: validate_inputs
run: |
. ./.github/scripts/common/lib.sh
RELEASE_TAG=$(validate_stable_tag ${{ inputs.release_tag }})
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
build-runtimes:
needs: [validate-inputs]
uses: "./.github/workflows/release-srtool.yml"
with:
excluded_runtimes: "asset-hub-pezkuwichain bridge-hub-pezkuwichain coretime-pezkuwichain people-pezkuwichain pezkuwichain pezkuwichain-teyrchain bizinikiwi-test bp pezcumulus-test kitchensink minimal-template teyrchain-template penpal pezkuwi-test seedling shell pezframe-try sp solochain-template pezkuwi-sdk-docs-first pezpallet-staking-async-teyrchain pezpallet-staking-async-rc pezframe-storage-access-test yet-another-teyrchain revive-dev"
build_opts: "--features on-chain-release-build"
profile: production
chain: ${{ inputs.chain }}
runtime_dir: ${{ inputs.runtime_dir }}
permissions:
id-token: write
attestations: write
contents: read
@@ -1,126 +0,0 @@
name: Release - Combined Builds Flow
on:
workflow_dispatch:
inputs:
chain:
description: The chain to use for runtime builds
default: all
required: true
type: choice
options:
- all
- zagros
- asset-hub-zagros
- bridge-hub-zagros
- collectives-zagros
- coretime-zagros
- glutton-zagros
- people-zagros
runtime_dir:
description: The runtime dir to be used (⚠️ this parameter is optional and needed only in case of the single runtime build, set it accordingly to the runtime you want to build)
default: pezkuwi/runtime/zagros
type: choice
options:
- pezkuwi/runtime/zagros
- pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros
- pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros
- pezcumulus/teyrchains/runtimes/collectives/collectives-zagros
- pezcumulus/teyrchains/runtimes/coretime/coretime-zagros
- pezcumulus/teyrchains/runtimes/people/people-zagros
- pezcumulus/teyrchains/runtimes/glutton/glutton-zagros
binary:
description: Binary to be built for the release candidate
default: all
type: choice
options:
- pezkuwi
- pezkuwi-teyrchain
- pezkuwi-omni-node
- pezframe-omni-bencher
- chain-spec-builder
- bizinikiwi-node
- eth-rpc
- pez-subkey
- all
release_tag:
description: Tag matching the actual release candidate with the format pezkuwi-stableYYMM(-X)-rcY or pezkuwi-stableYYMM(-X)
type: string
required: true
no_runtimes:
description: If true, no runtime build will be triggered and release draft will be published without runtimes (⚠️ use it for the patch releases of the latest stable)
required: true
type: boolean
default: false
jobs:
# DISABLED: Workflow synchronization check
# check-synchronization:
# uses: pezkuwichain-release/sync-workflows/.github/workflows/check-synchronization.yml@main
# secrets:
# fork_writer_app_key: ${{ secrets.UPSTREAM_CONTENT_SYNC_APP_KEY }}
validate-inputs:
runs-on: ubuntu-latest
outputs:
release_tag: ${{ steps.validate_inputs.outputs.release_tag }}
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Validate inputs
id: validate_inputs
run: |
. ./.github/scripts/common/lib.sh
RELEASE_TAG=$(validate_stable_tag ${{ inputs.release_tag }})
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
build-runtimes-flow:
if: ${{ inputs.no_runtimes == false }}
needs: [validate-inputs]
uses: "./.github/workflows/release-21_build-runtimes.yml"
with:
chain: ${{ inputs.chain }}
runtime_dir: ${{ inputs.runtime_dir }}
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
build-rc-flow:
needs: [validate-inputs]
uses: "./.github/workflows/release-20_build-rc.yml"
with:
binary: ${{ inputs.binary }}
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
secrets: inherit
permissions:
id-token: write
attestations: write
contents: read
trigger-release-draft-with-runtimes:
if: ${{ inputs.no_runtimes == false }}
needs: [build-runtimes-flow, build-rc-flow, validate-inputs]
uses: "./.github/workflows/release-30_publish_release_draft.yml"
with:
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
build_run_id: ${{ github.run_id }}
runtimes: '${{ needs.build-runtimes-flow.outputs.published_runtimes }}'
no_runtimes: ${{ inputs.no_runtimes }}
crates_only: false
secrets: inherit
trigger-release-draft-without-runtimes:
if: ${{ inputs.no_runtimes == true }}
needs: [build-rc-flow, validate-inputs]
uses: "./.github/workflows/release-30_publish_release_draft.yml"
with:
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
build_run_id: ${{ github.run_id }}
no_runtimes: ${{ inputs.no_runtimes }}
crates_only: false
secrets: inherit
@@ -1,99 +0,0 @@
name: Release - Announce release to Discord
on:
release:
types:
- published
- prereleased
jobs:
ping_discord:
runs-on: ubuntu-latest
environment: release
# Discord notification - Pezkuwi uses Discord instead of Matrix
# Server ID: 1444335345935057049
# Discord webhook should be configured in repository secrets as PEZKUWI_DISCORD_WEBHOOK
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.release.tag_name }}
- name: Extract node version
id: extract_version
run: |
. ./.github/scripts/common/lib.sh
version=v$(get_pezkuwi_node_version_from_code)
echo "Extracted node version: $version"
echo "node_version=$version" >> $GITHUB_OUTPUT
- name: Send Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.PEZKUWI_DISCORD_WEBHOOK }}
run: |
if [ -z "$DISCORD_WEBHOOK" ]; then
echo "::notice::Discord webhook not configured. Release notification skipped."
echo "Release: ${{ github.event.release.tag_name }}"
echo "URL: ${{ github.event.release.html_url }}"
echo "Node Version: ${{ steps.extract_version.outputs.node_version }}"
exit 0
fi
RELEASE_TYPE="${{ github.event.action }}"
TAG_NAME="${{ github.event.release.tag_name }}"
RELEASE_URL="${{ github.event.release.html_url }}"
NODE_VERSION="${{ steps.extract_version.outputs.node_version }}"
REPO_NAME="${{ github.event.repository.full_name }}"
# Set emoji based on release type
if [ "${{ github.event.release.prerelease }}" == "true" ]; then
EMOJI="🧪"
TITLE="Pre-release Published"
else
EMOJI="🚀"
TITLE="New Release Published"
fi
# Create Discord embed payload
PAYLOAD=$(cat <<'PAYLOAD_EOF'
{
"embeds": [{
"title": "EMOJI_PLACEHOLDER TITLE_PLACEHOLDER",
"description": "A new node release has been RELEASE_TYPE_PLACEHOLDER in **REPO_NAME_PLACEHOLDER**",
"color": 5814783,
"fields": [
{
"name": "Release Version",
"value": "[TAG_NAME_PLACEHOLDER](RELEASE_URL_PLACEHOLDER)",
"inline": true
},
{
"name": "Node Version",
"value": "NODE_VERSION_PLACEHOLDER",
"inline": true
}
],
"footer": {
"text": "Pezkuwi SDK Release"
},
"timestamp": "TIMESTAMP_PLACEHOLDER"
}]
}
PAYLOAD_EOF
)
# Replace placeholders with actual values
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
PAYLOAD="${PAYLOAD//EMOJI_PLACEHOLDER/$EMOJI}"
PAYLOAD="${PAYLOAD//TITLE_PLACEHOLDER/$TITLE}"
PAYLOAD="${PAYLOAD//RELEASE_TYPE_PLACEHOLDER/$RELEASE_TYPE}"
PAYLOAD="${PAYLOAD//REPO_NAME_PLACEHOLDER/$REPO_NAME}"
PAYLOAD="${PAYLOAD//TAG_NAME_PLACEHOLDER/$TAG_NAME}"
PAYLOAD="${PAYLOAD//RELEASE_URL_PLACEHOLDER/$RELEASE_URL}"
PAYLOAD="${PAYLOAD//NODE_VERSION_PLACEHOLDER/$NODE_VERSION}"
PAYLOAD="${PAYLOAD//TIMESTAMP_PLACEHOLDER/$TIMESTAMP}"
curl -H "Content-Type: application/json" \
-d "$PAYLOAD" \
"$DISCORD_WEBHOOK"
@@ -1,81 +0,0 @@
name: Binary Build
# This workflow can be used to build a binary like pezkuwi + workers, omninode or pezkuwi-teyrchain
# from any branch with release or profuction profile to be later used for testing.
# ⚠️ IT should not be used for release purposes!
on:
workflow_dispatch:
inputs:
binary:
required: true
default: "pezkuwi"
description: "The binary to build"
package:
description: Package to be built, can be pezkuwi, pezkuwi-teyrchain-bin, pezkuwi-omni-node etc.
required: true
type: string
profile:
required: true
default: "release"
description: "The profile to use for the binary build"
features:
required: false
type: string
description: "Features to enable when building the binary (must be a list of comma-separated features)"
jobs:
setup:
# GitHub Actions allows using 'env' in a container context.
# However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322
# This workaround sets the container image for each job using 'set-image' job output.
runs-on: ubuntu-latest
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
RUNNER: ${{ steps.set_runner.outputs.RUNNER }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set image
id: set_image
run: cat .github/env >> $GITHUB_OUTPUT
- name: Set runner
id: set_runner
shell: bash
run: |
if [[ "${{ inputs.binary }}" == "pezkuwi-teyrchain" ]]; then
echo "RUNNER=pezkuwichain-large" >> $GITHUB_OUTPUT
else
echo "RUNNER=ubuntu-latest" >> $GITHUB_OUTPUT
fi
build:
needs: [setup]
runs-on: ${{ needs.setup.outputs.RUNNER }}
container:
image: ${{ needs.setup.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Build binary
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}" #avoid "detected dubious ownership" error
PROFILE=${{ inputs.profile }}
if [ "${{ inputs.binary }}" = "pezkuwi" ]; then
for binary in pezkuwi pezkuwi-prepare-worker pezkuwi-execute-worker; do
echo "Building $binary with profile $PROFILE and features ${{ inputs.features }}"
./.github/scripts/release/build-linux-release.sh $binary ${{ inputs.package }} ${{ inputs.features }}
done
else
echo "Building ${{ inputs.binary }} with profile $PROFILE and features ${{ inputs.features }}"
./.github/scripts/release/build-linux-release.sh ${{ inputs.binary }} ${{ inputs.package }} ${{ inputs.features }}
fi
- name: Upload ${{ inputs.binary }} artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ inputs.binary }}
path: /artifacts/**
@@ -1,94 +0,0 @@
name: Check Runtimes Specs
# This GH Workflow fetches the runtimes available in a release.
# It then compares their metadata with reference specs located under
# .github/runtime_specs.
on:
workflow_dispatch:
inputs:
release_id:
description: |
Release ID.
You can find it using the command:
curl -s \
-H "Authorization: Bearer ${GITHUB_TOKEN}" https://api.github.com/repos/pezkuwichain/pezkuwi-sdk/releases | \
jq '.[] | { name: .name, id: .id }'
required: true
type: string
# This trigger unfortunately does not work as expected.
# https://github.com/orgs/community/discussions/47794
# release:
# types: [edited]
env:
RUNTIME_SPECS_DIR: .github/runtime_specs
DATA_DIR: runtimes
RELEASE_ID: ${{ inputs.release_id }}
REPO: ${{ github.repository }}
jobs:
find-specs:
name: Fetch runtime specs
outputs:
specs: ${{ steps.get-list.outputs.specs }}
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- name: Get list
id: get-list
run: |
lst=$(ls $RUNTIME_SPECS_DIR/*.json | xargs -I{} basename "{}" .json | jq -R .| jq -sc .)
echo "Found: $lst"
echo "specs=$lst" >> $GITHUB_OUTPUT
check-runtimes:
name: Check runtime specs
runs-on: ubuntu-latest
needs:
- find-specs
strategy:
matrix:
specs: ${{ fromJSON(needs.find-specs.outputs.specs) }}
steps:
- name: Checkout the repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- name: Fetch release artifacts based on release id
env:
OUTPUT_DIR: ${{ env.DATA_DIR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
. ./.github/scripts/common/lib.sh
fetch_release_artifacts
- name: Install tooling
env:
SUBWASM_VERSION: v0.20.0
DL_BASE_URL: https://github.com/chevdor/subwasm/releases/download
run: |
wget $DL_BASE_URL/$SUBWASM_VERSION/subwasm_linux_amd64_$SUBWASM_VERSION.deb \
-O subwasm.deb
sudo dpkg -i subwasm.deb
subwasm --version
- name: Extract metadata JSON for ${{ matrix.specs }}
env:
RUNTIME: ${{ matrix.specs }}
run: |
WASM=$(ls ${DATA_DIR}/${RUNTIME}*.wasm)
echo "WASM=$WASM"
subwasm show --json "$WASM" > "${DATA_DIR}/${RUNTIME}.json"
- name: Check specs for ${{ matrix.specs }}
id: build
env:
RUNTIME: ${{ matrix.specs }}
LOGLEVEL: info
run: |
python --version
.github/scripts/check-runtime.py "${DATA_DIR}/${RUNTIME}.json" "${RUNTIME_SPECS_DIR}/${RUNTIME}.json"
@@ -1,536 +0,0 @@
name: RC Build
on:
workflow_call:
inputs:
binary:
description: Binary to be build for the release
required: true
default: pezkuwi
type: string
package:
description: Package to be built, for now can be pezkuwi, pezkuwi-teyrchain-bin, or pezkuwi-omni-node
required: true
type: string
release_tag:
description: Tag matching the actual release candidate with the format pezkuwi-stableYYMM(-rcX) or pezkuwi-stableYYMM-X(-rcX)
required: true
type: string
target:
description: Target triple for which the artifacts are being built (e.g. x86_64-unknown-linux-gnu)
required: true
type: string
features:
description: Features to be enabled when building the binary (must be a list of comma-separated features)
required: false
type: string
permissions:
id-token: write
contents: read
attestations: write
jobs:
set-image:
# GitHub Actions allows using 'env' in a container context.
# However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322
# This workaround sets the container image for each job using 'set-image' job output.
runs-on: ubuntu-latest
env:
BINARY: ${{ inputs.binary }}
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
RUNNER: ${{ steps.set_image.outputs.RUNNER }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- id: set_image
run: |
cat .github/env >> $GITHUB_OUTPUT
RUNNER=""
if [[ "${BINARY}" =~ "pezkuwi-teyrchain" || "${BINARY}" =~ "pezkuwi-omni-node" ]]; then
RUNNER="ubuntu-latest-m"
echo "Using ubuntu-latest-m runner"
else
RUNNER="ubuntu-latest"
echo "Using ubuntu-latest runner"
fi
echo "RUNNER=${RUNNER}" >> $GITHUB_OUTPUT
build-rc:
if: ${{ inputs.target == 'x86_64-unknown-linux-gnu' }}
needs: [set-image]
runs-on: ${{ needs.set-image.outputs.RUNNER }}
environment: release
container:
image: ${{ needs.set-image.outputs.IMAGE }}
strategy:
matrix:
binaries: ${{ fromJSON(inputs.binary) }}
env:
PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }}
PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
steps:
- name: Install pgpkkms
run: |
# Install pgpkms that is used to sign built artifacts
python3 -m pip install "pgpkms @ git+https://github.com/pezkuwichain-release/pgpkms.git@6cb1cecce1268412189b77e4b130f4fa248c4151"
which pgpkms
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.release_tag }}
fetch-depth: 0
- name: Import gpg keys
shell: bash
run: |
. ./.github/scripts/common/lib.sh
import_gpg_keys
- name: Build binary
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}" #avoid "detected dubious ownership" error
./.github/scripts/release/build-linux-release.sh ${{ matrix.binaries }} ${{ inputs.package }} ${{ inputs.features }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
with:
subject-path: /artifacts/${{ matrix.binaries }}/${{ matrix.binaries }}
- name: Sign artifacts
working-directory: /artifacts/${{ matrix.binaries }}
run: |
python3 -m pgpkms sign --input ${{matrix.binaries }} -o ${{ matrix.binaries }}.asc
- name: Check sha256 ${{ matrix.binaries }}
working-directory: /artifacts/${{ matrix.binaries }}
shell: bash
run: |
. "${GITHUB_WORKSPACE}"/.github/scripts/common/lib.sh
echo "Checking binary ${{ matrix.binaries }}"
check_sha256 ${{ matrix.binaries }}
- name: Check GPG ${{ matrix.binaries }}
working-directory: /artifacts/${{ matrix.binaries }}
shell: bash
run: |
. "${GITHUB_WORKSPACE}"/.github/scripts/common/lib.sh
check_gpg ${{ matrix.binaries }}
- name: Upload ${{ matrix.binaries }} artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ matrix.binaries }}_${{ inputs.target }}
path: /artifacts/${{ matrix.binaries }}
build-macos-rc:
if: ${{ inputs.target == 'aarch64-apple-darwin' }}
runs-on: macos-latest
environment: release
strategy:
matrix:
binaries: ${{ fromJSON(inputs.binary) }}
env:
PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }}
PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.release_tag }}
fetch-depth: 0
- name: Set rust version from env file
run: |
RUST_VERSION=$(cat .github/env | sed -E 's/.*ci-unified:([^-]+)-([^-]+).*/\2/')
echo $RUST_VERSION
echo "RUST_VERSION=${RUST_VERSION}" >> $GITHUB_ENV
- name: Set workspace environment variable
# relevant for artifacts upload, which can not interpolate Github Action variable syntax when
# used within valid paths. We can not use root-based paths either, since it is set as read-only
# on the `pezkuwichain-macos` runner.
run: echo "ARTIFACTS_PATH=${GITHUB_WORKSPACE}/artifacts/${{ matrix.binaries }}" >> $GITHUB_ENV
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@1ccc07ccd54b6048295516a3eb89b192c35057dc # master from 12.09.2024
- name: Set homebrew binaries location on path
run: echo "/opt/homebrew/bin" >> $GITHUB_PATH
- name: Install rust ${{ env.RUST_VERSION }}
uses: actions-rust-lang/setup-rust-toolchain@a0b538fa0b742a6aa35d6e2c169b4bd06d225a98 # v1.15.3
with:
cache: false
toolchain: ${{ env.RUST_VERSION }}
target: wasm32v1-none
components: cargo, clippy, rust-docs, rust-src, rustfmt, rustc, rust-std
- name: cargo info
run: |
echo "######## rustup show ########"
rustup show
echo "######## cargo --version ########"
cargo --version
- name: Install protobuf
run: brew install protobuf
- name: Install gpg
run: |
brew install gnupg
# Setup for being able to resolve: keyserver.ubuntu.com.
# See: https://github.com/actions/runner-images/issues/9777
mkdir -p ~/.gnupg/
touch ~/.gnupg/dirmngr.conf
echo "standard-resolver" > ~/.gnupg/dirmngr.conf
- name: Install solc
run: brew install solidity
- name: Install resolc
# NOTE: resolc is an upstream shared tool from paritytech/revive (EVM compiler)
run: |
VERSION="0.3.0"
ASSET_URL="https://github.com/paritytech/revive/releases/download/v$VERSION/resolc-universal-apple-darwin"
echo "Downloading resolc v$VERSION from $ASSET_URL"
curl -Lsf --show-error -o $HOME/.cargo/bin/resolc "$ASSET_URL"
chmod +x $HOME/.cargo/bin/resolc
xattr -c $HOME/.cargo/bin/resolc
resolc --version
- name: Install llvm
run: |
brew install llvm@21
- name: Set dynamic library path
run: |
LLVM_PATH=$(brew --prefix llvm)
export LIBCLANG_PATH="$LLVM_PATH/lib"
export LDFLAGS="-L$LLVM_PATH/lib"
export CPPFLAGS="-I$LLVM_PATH/include"
echo "DYLD_LIBRARY_PATH=$LLVM_PATH/lib" >> $GITHUB_ENV
- name: Install sha256sum
run: |
brew install coreutils
- name: Install pgpkkms
run: |
# Install pgpkms that is used to sign built artifacts
python3 -m pip install "pgpkms @ git+https://github.com/pezkuwichain-release/pgpkms.git@6cb1cecce1268412189b77e4b130f4fa248c4151" --break-system-packages
- name: Import gpg keys
shell: bash
run: |
. ./.github/scripts/common/lib.sh
import_gpg_keys
- name: Build binary
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}" #avoid "detected dubious ownership" error
./.github/scripts/release/build-macos-release.sh ${{ matrix.binaries }} ${{ inputs.package }} ${{ inputs.features }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
with:
subject-path: ${{ env.ARTIFACTS_PATH }}/${{ matrix.binaries }}
- name: Sign artifacts
working-directory: ${{ env.ARTIFACTS_PATH }}
run: |
python3 -m pgpkms sign --input ${{matrix.binaries }} -o ${{ matrix.binaries }}.asc
- name: Check sha256 ${{ matrix.binaries }}
working-directory: ${{ env.ARTIFACTS_PATH }}
shell: bash
run: |
. "${GITHUB_WORKSPACE}"/.github/scripts/common/lib.sh
echo "Checking binary ${{ matrix.binaries }}"
check_sha256 ${{ matrix.binaries }}
- name: Check GPG ${{ matrix.binaries }}
working-directory: ${{ env.ARTIFACTS_PATH }}
shell: bash
run: |
. "${GITHUB_WORKSPACE}"/.github/scripts/common/lib.sh
check_gpg ${{ matrix.binaries }}
- name: Upload ${{ matrix.binaries }} artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ matrix.binaries }}_${{ inputs.target }}
path: ${{ env.ARTIFACTS_PATH }}
build-pezkuwi-deb-and-rpm-package:
if: ${{ inputs.package == 'pezkuwi' && inputs.target == 'x86_64-unknown-linux-gnu' }}
needs: [build-rc]
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.release_tag }}
fetch-depth: 0
- name: Download pezkuwi_x86_64-unknown-linux-gnu artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: pezkuwi_x86_64-unknown-linux-gnu
path: target/production
merge-multiple: true
- name: Download pezkuwi-execute-worker_x86_64-unknown-linux-gnu artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: pezkuwi-execute-worker_x86_64-unknown-linux-gnu
path: target/production
merge-multiple: true
- name: Download pezkuwi-prepare-worker_x86_64-unknown-linux-gnu artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: pezkuwi-prepare-worker_x86_64-unknown-linux-gnu
path: target/production
merge-multiple: true
- name: Install rpmbuild
run: sudo apt-get update && sudo apt-get install -y rpm
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: '3.2'
- name: Install fpm
run: gem install fpm
- name: Build pezkuwi deb package
shell: bash
run: |
. "${GITHUB_WORKSPACE}"/.github/scripts/common/lib.sh
VERSION=$(get_pezkuwi_node_version_from_code)
. "${GITHUB_WORKSPACE}"/.github/scripts/release/build-deb.sh ${{ inputs.package }} ${VERSION}
- name: Build pezkuwi rpm package
shell: bash
run: |
. "${GITHUB_WORKSPACE}"/.github/scripts/common/lib.sh
VERSION=$(get_pezkuwi_node_version_from_code)
. "${GITHUB_WORKSPACE}"/.github/scripts/release/build-rpm.sh ${{ inputs.package }} ${VERSION}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
with:
subject-path: |
target/production/*.deb
target/production/*.rpm
- name: Upload ${{inputs.package }} artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ inputs.package }}_${{ inputs.target }}
path: target/production
overwrite: true
upload-pezkuwi-artifacts-to-s3:
if: ${{ inputs.package == 'pezkuwi' && inputs.target == 'x86_64-unknown-linux-gnu' }}
needs: [build-pezkuwi-deb-and-rpm-package]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: ${{ inputs.package }}
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-pezkuwi-teyrchain-artifacts-to-s3:
if: ${{ inputs.package == 'pezkuwi-teyrchain-bin' && inputs.target == 'x86_64-unknown-linux-gnu' }}
needs: [build-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: pezkuwi-teyrchain
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-pezkuwi-omni-node-artifacts-to-s3:
if: ${{ inputs.package == 'pezkuwi-omni-node' && inputs.target == 'x86_64-unknown-linux-gnu' }}
needs: [build-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: ${{ inputs.package }}
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-pezframe-omni-bencher-artifacts-to-s3:
if: ${{ inputs.package == 'pezframe-omni-bencher' && inputs.target == 'x86_64-unknown-linux-gnu' }}
needs: [build-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: ${{ inputs.package }}
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-chain-spec-builder-artifacts-to-s3:
if: ${{ inputs.package == 'pez-staging-chain-spec-builder' && inputs.target == 'x86_64-unknown-linux-gnu' }}
needs: [build-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: chain-spec-builder
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-bizinikiwi-node-artifacts-to-s3:
if: ${{ inputs.package == 'pezstaging-node-cli' && inputs.target == 'x86_64-unknown-linux-gnu' }}
needs: [build-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: bizinikiwi-node
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-eth-rpc-artifacts-to-s3:
if: ${{ inputs.package == 'pezpallet-revive-eth-rpc' && inputs.target == 'x86_64-unknown-linux-gnu' }}
needs: [build-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: eth-rpc
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-pez-subkey-artifacts-to-s3:
if: ${{ inputs.package == 'pez-subkey' && inputs.target == 'x86_64-unknown-linux-gnu' }}
needs: [build-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: pez-subkey
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-pezkuwi-macos-artifacts-to-s3:
if: ${{ inputs.package == 'pezkuwi' && inputs.target == 'aarch64-apple-darwin' }}
# TODO: add and use a `build-pezkuwi-homebrew-package` which packs all `pezkuwi` binaries:
# `pezkuwi`, `pezkuwi-prepare-worker` and `pezkuwi-execute-worker`.
needs: [build-macos-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: ${{ inputs.package }}
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-pezkuwi-prepare-worker-macos-artifacts-to-s3:
if: ${{ inputs.package == 'pezkuwi' && inputs.target == 'aarch64-apple-darwin' }}
needs: [build-macos-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: pezkuwi-prepare-worker
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-pezkuwi-execute-worker-macos-artifacts-to-s3:
if: ${{ inputs.package == 'pezkuwi' && inputs.target == 'aarch64-apple-darwin' }}
needs: [build-macos-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: pezkuwi-execute-worker
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-pezkuwi-omni-node-macos-artifacts-to-s3:
if: ${{ inputs.package == 'pezkuwi-omni-node' && inputs.target == 'aarch64-apple-darwin' }}
needs: [build-macos-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: ${{ inputs.package }}
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-pezkuwi-teyrchain-macos-artifacts-to-s3:
if: ${{ inputs.package == 'pezkuwi-teyrchain-bin' && inputs.target == 'aarch64-apple-darwin' }}
needs: [build-macos-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: pezkuwi-teyrchain
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-pezframe-omni-bencher-macos-artifacts-to-s3:
if: ${{ inputs.package == 'pezframe-omni-bencher' && inputs.target == 'aarch64-apple-darwin' }}
needs: [build-macos-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: ${{ inputs.package }}
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-chain-spec-builder-macos-artifacts-to-s3:
if: ${{ inputs.package == 'pez-staging-chain-spec-builder' && inputs.target == 'aarch64-apple-darwin' }}
needs: [build-macos-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: chain-spec-builder
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-bizinikiwi-node-macos-artifacts-to-s3:
if: ${{ inputs.package == 'pezstaging-node-cli' && inputs.target == 'aarch64-apple-darwin' }}
needs: [build-macos-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: bizinikiwi-node
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-eth-rpc-macos-artifacts-to-s3:
if: ${{ inputs.package == 'pezpallet-revive-eth-rpc' && inputs.target == 'aarch64-apple-darwin' }}
needs: [build-macos-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: eth-rpc
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
upload-pez-subkey-macos-artifacts-to-s3:
if: ${{ inputs.package == 'pez-subkey' && inputs.target == 'aarch64-apple-darwin' }}
needs: [build-macos-rc]
uses: ./.github/workflows/release-reusable-s3-upload.yml
with:
package: pez-subkey
release_tag: ${{ inputs.release_tag }}
target: ${{ inputs.target }}
secrets: inherit
-152
View File
@@ -1,152 +0,0 @@
name: Srtool build
env:
SUBWASM_VERSION: 0.21.0
TOML_CLI_VERSION: 0.2.4
on:
workflow_call:
inputs:
excluded_runtimes:
type: string
build_opts:
type: string
profile:
type: string
chain:
type: string
runtime_dir:
type: string
outputs:
published_runtimes:
value: ${{ jobs.find-runtimes.outputs.runtime }}
permissions:
id-token: write
attestations: write
contents: read
jobs:
find-runtimes:
name: Scan repo pezkuwichain/pezkuwi-sdk
outputs:
runtime: ${{ steps.get_runtimes_list.outputs.runtime }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.0.0
with:
fetch-depth: 0
- name: Install tooling
run: |
URL=https://github.com/chevdor/toml-cli/releases/download/v${{ env.TOML_CLI_VERSION }}/toml_linux_amd64_v${{ env.TOML_CLI_VERSION }}.deb
curl -L $URL --output toml.deb
sudo dpkg -i toml.deb
toml --version; jq --version
- name: Scan and get runtimes list
id: get_runtimes_list
env:
EXCLUDED_RUNTIMES: ${{ inputs.excluded_runtimes }}:"bizinikiwi-test"
CHAIN: ${{ inputs.chain }}
RUNTIME_DIR: ${{ inputs.runtime_dir }}
run: |
. ./.github/scripts/common/lib.sh
echo "Github workspace: ${{ github.workspace }}"
echo "Current folder: $(pwd)"; ls -al
ls -al
if [ "$CHAIN" == "all" ]; then
MATRIX=$(find_runtimes | tee runtimes_list.json)
echo $MATRIX
echo "runtime=$MATRIX" >> $GITHUB_OUTPUT
else
if [ -n "$RUNTIME_DIR" ]; then
# Create a custom matrix with specific chain and runtime_dir
MATRIX='{"include":[{"chain":"'$CHAIN'","crate":"'$CHAIN'-runtime","runtime_dir":"'$RUNTIME_DIR'"}]}'
else
echo "RUNTIME_DIR is not set"
exit 1
fi
echo $MATRIX
echo "runtime=$MATRIX" >> $GITHUB_OUTPUT
fi
srtool:
runs-on: ubuntu-latest
needs:
- find-runtimes
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.find-runtimes.outputs.runtime) }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.0.0
with:
fetch-depth: 0
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@48e9baed50ca414936dfac59d34d8b9bbe581abd # v0.9.2
env:
BUILD_OPTS: ${{ inputs.build_opts }}
with:
chain: ${{ matrix.chain }}
runtime_dir: ${{ matrix.runtime_dir }}
profile: ${{ inputs.profile }}
- name: Summary
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.chain }}-srtool-digest.json
cat ${{ matrix.chain }}-srtool-digest.json
echo "Compact Runtime: ${{ steps.srtool_build.outputs.wasm }}"
echo "Compressed Runtime: ${{ steps.srtool_build.outputs.wasm_compressed }}"
- name: Generate artifact attestation
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
with:
subject-path: ${{ steps.srtool_build.outputs.wasm }}
# We now get extra information thanks to subwasm
- name: Install subwasm
run: |
wget https://github.com/chevdor/subwasm/releases/download/v${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
sudo dpkg -i subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
subwasm --version
- name: Show Runtime information
shell: bash
run: |
subwasm info ${{ steps.srtool_build.outputs.wasm }}
subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }}
subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-info.json
subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ matrix.chain }}-compressed-info.json
- name: Extract the metadata
shell: bash
run: |
subwasm meta ${{ steps.srtool_build.outputs.wasm }}
subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-metadata.json
- name: Check the metadata diff
shell: bash
# the following subwasm call will error for chains that are not known and/or live, that includes shell for instance
run: |
subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ matrix.chain }} || \
echo "Subwasm call failed, check the logs. This is likely because ${{ matrix.chain }} is not known by subwasm" | \
tee ${{ matrix.chain }}-diff.txt
- name: Archive Subwasm results
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ matrix.chain }}-runtime
path: |
${{ matrix.chain }}-info.json
${{ matrix.chain }}-compressed-info.json
${{ matrix.chain }}-metadata.json
${{ matrix.chain }}-diff.txt
${{ steps.srtool_build.outputs.wasm }}
${{ steps.srtool_build.outputs.wasm_compressed }}
${{ matrix.chain }}-srtool-digest.json
+148
View File
@@ -0,0 +1,148 @@
name: release
# Builds the deployable runtime WASM blobs, publishes their authorize_upgrade
# hashes, and signs the artifacts. A runtime upgrade on a fund-holding chain must be
# verifiable: anyone can rebuild from this tag with the pinned toolchain (1.96.0,
# rust-toolchain.toml) + the committed Cargo.lock and compare the blake2-256 hash to
# what governance authorizes.
#
# NOTE: this is pinned-toolchain reproducibility (deterministic given the same
# toolchain + lockfile + flags), not yet fully hermetic. srtool has no Rust 1.96
# image yet (latest is 1.93); a hermetic srtool/custom-container step will be added
# when available. Tracked in the release-process issue.
on:
push:
tags:
- "v*"
- "runtime-*"
workflow_dispatch:
inputs:
ref:
description: "Git ref to build (defaults to the triggering ref)"
required: false
permissions:
contents: write # create the GitHub release
id-token: write # build-provenance attestation
attestations: write # build-provenance attestation
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: "0"
jobs:
build-runtime:
# Pinned to one specific runner (not the whole substrate-build pool): these
# builds aren't hermetic yet (pending srtool), and the self-hosted fleet
# doesn't share a common absolute install path, so which runner picks up
# the job changes the resulting WASM hash even for identical source. Fixing
# the runner fixes the path, so the published hash is reproducible by
# rebuilding at the same path on the same box until srtool lands.
runs-on: [self-hosted, dks-runner-1]
strategy:
fail-fast: false
matrix:
# Mainnet relay + system teyrchains. The deployable on-chain artifacts.
runtime:
- pezkuwichain-runtime
- asset-hub-pezkuwichain-runtime
- people-pezkuwichain-runtime
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.inputs.ref || github.ref }}
- name: Toolchain & targets
run: |
rustup show
rustup component add rust-src
rustup target add wasm32v1-none wasm32-unknown-unknown
- name: Build deployable runtime WASM (release, locked)
run: cargo build --release --locked -p ${{ matrix.runtime }}
- name: Locate WASM and compute upgrade hashes
id: wasm
run: |
set -euo pipefail
# The compact+compressed blob is the artifact that goes on-chain.
# Some runtimes (the relay's build.rs, in particular) also emit a
# `fast-runtime`-feature devnet variant (fast_runtime_binary.rs.*) in
# the same wbuild dir for local/zombienet testing — never pick that
# one up here. Fail loudly on anything else ambiguous rather than
# silently taking whichever file a bare `find | head -1` returns
# first (directory order is not guaranteed).
wbuild_dir="target/release/wbuild/${{ matrix.runtime }}"
mapfile -t candidates < <(find "$wbuild_dir" -maxdepth 1 \
-name '*.compact.compressed.wasm' ! -name 'fast_runtime_binary*')
if [ "${#candidates[@]}" -eq 0 ]; then
echo "::error::no compressed WASM found for ${{ matrix.runtime }}"; exit 1
fi
if [ "${#candidates[@]}" -gt 1 ]; then
echo "::error::ambiguous compressed WASM candidates for ${{ matrix.runtime }}: ${candidates[*]}"; exit 1
fi
wasm="${candidates[0]}"
out="artifacts"; mkdir -p "$out"
base="${{ matrix.runtime }}"
cp "$wasm" "$out/${base}.compact.compressed.wasm"
# blake2-256 is the hash governance authorizes (authorize_upgrade / proposal hash).
b2=$(b2sum -l 256 "$wasm" | cut -d' ' -f1)
sha=$(sha256sum "$wasm" | cut -d' ' -f1)
size=$(stat -c%s "$wasm")
{
echo "### ${base}"
echo ""
echo "| field | value |"
echo "|---|---|"
echo "| commit | \`${GITHUB_SHA}\` |"
echo "| toolchain | \`$(rustc --version)\` |"
echo "| size (bytes) | ${size} |"
echo "| blake2-256 (authorize_upgrade) | \`0x${b2}\` |"
echo "| sha256 | \`${sha}\` |"
echo ""
} > "$out/${base}.digest.md"
echo "wasm=$out/${base}.compact.compressed.wasm" >> "$GITHUB_OUTPUT"
echo "blake2_256=0x${b2}" >> "$GITHUB_OUTPUT"
- name: Attest build provenance (SLSA)
uses: actions/attest-build-provenance@v4
with:
subject-path: ${{ steps.wasm.outputs.wasm }}
- uses: actions/upload-artifact@v7
with:
name: ${{ matrix.runtime }}
path: artifacts/*
if-no-files-found: error
publish:
needs: build-runtime
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v8
with:
path: dl
- name: Assemble release notes
run: |
set -e
mkdir -p release
find dl -name '*.compact.compressed.wasm' -exec cp {} release/ \;
echo "# PezkuwiChain runtimes — ${GITHUB_REF_NAME}" > NOTES.md
echo "" >> NOTES.md
echo "Verify: rebuild this tag with the pinned toolchain (rust-toolchain.toml)" >> NOTES.md
echo "and committed Cargo.lock, then compare the blake2-256 below to the hash" >> NOTES.md
echo "authorized on-chain (\`system.authorizeUpgrade\`)." >> NOTES.md
echo "" >> NOTES.md
cat $(find dl -name '*.digest.md' | sort) >> NOTES.md
- name: Publish GitHub release
uses: softprops/action-gh-release@v3
with:
body_path: NOTES.md
files: release/*
draft: true # human review before publishing a fund-critical artifact
fail_on_unmatched_files: true
@@ -1,12 +0,0 @@
name: Reusable Disk Cleanup
on:
workflow_call:
jobs:
# This is a no-op job that other workflows can use to trigger disk cleanup
# The actual cleanup happens via the composite action
placeholder:
runs-on: ubuntu-latest
steps:
- run: echo "Disk cleanup is handled by the composite action"
-16
View File
@@ -1,16 +0,0 @@
# The workflow is not part of reusable-preflight.yml to allow testing CI in draft.
name: Preflight isdraft
on:
workflow_call:
# Map the workflow outputs to job outputs
jobs:
isdraft:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'A5-run-CI')
steps:
- name: echo test
shell: bash
run: echo "PR is not draft, starting CI"
-227
View File
@@ -1,227 +0,0 @@
# Reusable workflow to set various useful variables
# and to perform checks and generate conditions for other workflows.
# Currently it checks if any Rust (build-related) file is changed
# and if the current (caller) workflow file is changed.
# Example:
#
# jobs:
# preflight:
# uses: ./.github/workflows/reusable-preflight.yml
# some-job:
# needs: changes
# if: ${{ needs.preflight.outputs.changes_rust }}
# .......
name: Preflight
on:
workflow_call:
# Map the workflow outputs to job outputs
outputs:
changes_rust:
value: ${{ jobs.preflight.outputs.changes_rust }}
changes_currentWorkflow:
value: ${{ jobs.preflight.outputs.changes_currentWorkflow }}
IMAGE:
value: ${{ jobs.preflight.outputs.IMAGE }}
description: "CI image"
# Runners
# https://github.com/pezkuwichain/ci_cd/wiki/GitHub#pezkuwichain-self-hosted-runners
RUNNER:
value: ${{ jobs.preflight.outputs.RUNNER }}
description: |
Main runner for resource-intensive tasks
By default we use spot machines that can be terminated at any time.
Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
RUNNER_OLDLINUX:
value: ${{ jobs.preflight.outputs.RUNNER_OLDLINUX }}
description: |
pezkuwichain-oldlinux
By default we use spot machines that can be terminated at any time.
Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
# New is used only during transition to the new runners
RUNNER_NEW:
value: ${{ jobs.preflight.outputs.RUNNER_NEW }}
description: |
Main runner for resource-intensive tasks
By default we use spot machines that can be terminated at any time.
Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
RUNNER_OLDLINUX_NEW:
value: ${{ jobs.preflight.outputs.RUNNER_OLDLINUX_NEW }}
description: |
pezkuwichain-oldlinux
By default we use spot machines that can be terminated at any time.
Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
RUNNER_DEFAULT:
value: ${{ jobs.preflight.outputs.RUNNER_DEFAULT }}
description: "Relatively lightweight runner. When `ubuntu-latest` is not enough"
RUNNER_WEIGHTS:
value: ${{ jobs.preflight.outputs.RUNNER_WEIGHTS }}
RUNNER_BENCHMARK:
value: ${{ jobs.preflight.outputs.RUNNER_BENCHMARK }}
RUNNER_MACOS:
value: ${{ jobs.preflight.outputs.RUNNER_MACOS }}
# Vars
SOURCE_REF_SLUG:
value: ${{ jobs.preflight.outputs.SOURCE_REF_SLUG }}
description: "Name of the current branch for `push` or source branch for `pull_request` with `/` replaced by `_`. Does not exists in merge_group"
REF_SLUG:
value: ${{ jobs.preflight.outputs.REF_SLUG }}
description: |
Name of the current revision (depending on the event) with `/` replaced by `_`, e.g:
push - main
pull_request - 49_merge
merge_group - gh-readonly-queue_master_pr-49-38d43798a986430231c828b2c762997f818ac012
COMMIT_SHA:
value: ${{ jobs.preflight.outputs.COMMIT_SHA }}
description: "Sha of the current revision"
COMMIT_SHA_SHORT:
value: ${{ jobs.preflight.outputs.COMMIT_SHA_SHORT }}
description: "Sha of the current revision, 8-symbols long"
jobs:
#
#
#
preflight:
runs-on: ubuntu-latest
outputs:
changes_rust: ${{ steps.set_changes.outputs.rust_any_changed || steps.set_changes.outputs.currentWorkflow_any_changed }}
changes_currentWorkflow: ${{ steps.set_changes.outputs.currentWorkflow_any_changed }}
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
# Runners
# https://github.com/pezkuwichain/ci_cd/wiki/GitHub#pezkuwichain-self-hosted-runners
RUNNER: ${{ steps.set_runner.outputs.RUNNER }}
RUNNER_NEW: ${{ steps.set_runner.outputs.RUNNER_NEW }}
RUNNER_OLDLINUX: ${{ steps.set_runner.outputs.RUNNER_OLDLINUX }}
RUNNER_OLDLINUX_NEW: ${{ steps.set_runner.outputs.RUNNER_OLDLINUX_NEW }}
RUNNER_DEFAULT: ${{ steps.set_runner.outputs.RUNNER_DEFAULT }}
RUNNER_WEIGHTS: ${{ steps.set_runner.outputs.RUNNER_WEIGHTS }}
RUNNER_BENCHMARK: ${{ steps.set_runner.outputs.RUNNER_BENCHMARK }}
RUNNER_MACOS: ${{ steps.set_runner.outputs.RUNNER_MACOS }}
SOURCE_REF_SLUG: ${{ steps.set_vars.outputs.SOURCE_REF_SLUG }}
REF_SLUG: ${{ steps.set_vars.outputs.REF_SLUG }}
COMMIT_SHA: ${{ steps.set_vars.outputs.COMMIT_SHA }}
COMMIT_SHA_SHORT: ${{ steps.set_vars.outputs.COMMIT_SHA_SHORT }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
#
# Set changes
#
- name: Current file
id: current_file
shell: bash
run: |
echo "currentWorkflowFile=$(echo ${{ github.workflow_ref }} | sed -nE "s/.*(\.github\/workflows\/[a-zA-Z0-9_-]*\.y[a]?ml)@refs.*/\1/p")" >> $GITHUB_OUTPUT
echo "currentActionDir=$(echo ${{ github.action_path }} | sed -nE "s/.*(\.github\/actions\/[a-zA-Z0-9_-]*)/\1/p")" >> $GITHUB_OUTPUT
- name: Set changes
id: set_changes
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 #v47.0.5
with:
files_yaml: |
rust:
- '**/*'
- '!.github/**/*'
- '!prdoc/**/*'
- '!docs/**/*'
currentWorkflow:
- '${{ steps.current_file.outputs.currentWorkflowFile }}'
- '.github/workflows/reusable-preflight.yml'
#
# Set image
#
- name: Set image
id: set_image
shell: bash
run: cat .github/env >> $GITHUB_OUTPUT
#
# Set runner
#
# By default we use spot machines that can be terminated at any time.
# Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
#
- name: Set runner
id: set_runner
shell: bash
run: |
# Hybrid: heavy jobs → self-hosted ephemeral VPS, light jobs → GitHub-hosted
echo "RUNNER_DEFAULT=pezkuwi-runner" >> $GITHUB_OUTPUT
echo "RUNNER_WEIGHTS=pezkuwi-runner" >> $GITHUB_OUTPUT
echo "RUNNER_BENCHMARK=pezkuwi-runner" >> $GITHUB_OUTPUT
echo "RUNNER_MACOS=macos-latest" >> $GITHUB_OUTPUT
echo "RUNNER=pezkuwi-runner" >> $GITHUB_OUTPUT
echo "RUNNER_OLDLINUX=pezkuwi-runner" >> $GITHUB_OUTPUT
echo "RUNNER_NEW=pezkuwi-runner" >> $GITHUB_OUTPUT
echo "RUNNER_OLDLINUX_NEW=pezkuwi-runner" >> $GITHUB_OUTPUT
#
# Set vars
#
- name: Set vars
id: set_vars
shell: bash
run: |
export SOURCE_REF_NAME=${{ github.head_ref || github.ref_name }}
echo "SOURCE_REF_SLUG=${SOURCE_REF_NAME//\//_}" >> $GITHUB_OUTPUT
#
export COMMIT_SHA=${{ github.sha }}
echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_OUTPUT
echo "COMMIT_SHA_SHORT=${COMMIT_SHA:0:8}" >> $GITHUB_OUTPUT
#
export REF_NAME=${{ github.ref_name }}
echo "REF_SLUG=${REF_NAME//\//_}" >> $GITHUB_OUTPUT
- name: log
shell: bash
run: |
echo "workflow file: ${{ steps.current_file.outputs.currentWorkflowFile }}"
echo "Modified: ${{ steps.set_changes.outputs.modified_keys }}"
#
#
#
ci-versions:
needs: [preflight]
runs-on: ubuntu-latest
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Info rust
run: |
rustup show
cargo --version
cargo +nightly --version
cargo clippy --version
echo "yarn version: $(yarn --version)"
echo $( bizinikiwi-contracts-node --version | awk 'NF' )
estuary --version
cargo-contract --version
taplo --version
- name: Info vars
run: |
echo "COMMIT_SHA: ${{ needs.preflight.outputs.COMMIT_SHA }}"
echo "COMMIT_SHA_SHORT: ${{ needs.preflight.outputs.COMMIT_SHA_SHORT }}"
echo "SOURCE_REF_SLUG: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }}"
echo "REF_SLUG: ${{ needs.preflight.outputs.REF_SLUG }}"
echo "RUNNER: ${{ needs.preflight.outputs.RUNNER }}"
echo "IMAGE: ${{ needs.preflight.outputs.IMAGE }}"
#
echo "github.ref: ${{ github.ref }}"
echo "github.ref_name: ${{ github.ref_name }}"
echo "github.sha: ${{ github.sha }}"
-46
View File
@@ -1,46 +0,0 @@
name: Review Bot
on:
workflow_run:
workflows:
- Review-Trigger
types:
- completed
workflow_dispatch:
inputs:
pr-number:
description: "Number of the PR to evaluate"
required: true
type: number
jobs:
review-approvals:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: app_token
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
with:
app-id: ${{ secrets.REVIEW_APP_ID }}
private-key: ${{ secrets.REVIEW_APP_KEY }}
- name: Extract content of artifact
if: ${{ !inputs.pr-number }}
id: number
uses: Bullrich/extract-text-from-artifact@28b4a438a07226f4e4e19f625354bbe3e745a29e # v1.0.1
with:
artifact-name: pr_number
# DISABLED: Review bot requires pezkuwichain GitHub App
# - name: "Evaluates PR reviews and assigns reviewers"
# uses: pezkuwichain/review-bot@9a5828019b78fcc2a7d851ca9797d810bcde95ea # v2.7.2
# with:
# repo-token: ${{ steps.app_token.outputs.token }}
# team-token: ${{ steps.app_token.outputs.token }}
# checks-token: ${{ steps.app_token.outputs.token }}
# pr-number: ${{ inputs.pr-number || steps.number.outputs.content }}
# request-reviewers: true
- name: "Review bot disabled"
run: echo "Review bot is disabled - requires pezkuwichain GitHub App"
- name: Log payload
if: ${{ failure() || runner.debug }}
run: echo "::debug::$payload"
env:
payload: ${{ toJson(github.event) }}
-73
View File
@@ -1,73 +0,0 @@
name: Review-Trigger
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- review_requested
- review_request_removed
- ready_for_review
pull_request_review:
jobs:
trigger-review-bot:
# (It is not a draft) && (it is not a review || it is an approving review)
if: ${{ github.event.pull_request.draft != true && (github.event_name != 'pull_request_review' || (github.event.review && github.event.review.state == 'APPROVED')) }}
runs-on: ubuntu-latest
name: trigger review bot
steps:
- name: Skip merge queue
if: ${{ contains(github.ref, 'gh-readonly-queue') }}
run: exit 0
- name: Get PR data
id: comments
run: |
echo "bodies=$(gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --json comments --jq '[.comments[].body]')" >> "$GITHUB_OUTPUT"
echo "reviews=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews --jq '[.[].state]')" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- name: Fail when author pushes new code
# Require new reviews when the author is pushing and he is not a member
if: |
contains(fromJson(steps.comments.outputs.reviews), 'APPROVED') &&
github.event_name == 'pull_request_target' &&
github.event.action == 'synchronize' &&
github.event.sender.login == github.event.pull_request.user.login &&
github.event.pull_request.author_association != 'CONTRIBUTOR' &&
github.event.pull_request.author_association != 'MEMBER'
run: |
echo "User's association is ${{ github.event.pull_request.author_association }}"
# We get the list of reviewers who approved the PR
REVIEWERS=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews \
--jq '{reviewers: [.[] | select(.state == "APPROVED") | .user.login]}')
# We request them to review again
echo $REVIEWERS | gh api --method POST repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers --input -
echo "::error::Project needs to be reviewed again"
exit 1
env:
GH_TOKEN: ${{ github.token }}
- name: Comment requirements
# If the previous step failed and github-actions hasn't commented yet we comment instructions
if: failure() && !contains(fromJson(steps.comments.outputs.bodies), 'Review required! Latest push from author must always be reviewed')
run: |
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "Review required! Latest push from author must always be reviewed"
env:
GH_TOKEN: ${{ github.token }}
COMMENTS: ${{ steps.comments.outputs.users }}
- name: Get PR number
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
echo "Saving PR number: $PR_NUMBER"
mkdir -p ./pr
echo $PR_NUMBER > ./pr/pr_number
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
name: Save PR number
with:
name: pr_number
path: pr/
retention-days: 5
-145
View File
@@ -1,145 +0,0 @@
[
{
"name": "dev",
"package": "kitchensink-runtime",
"path": "substrate/frame",
"header": "substrate/HEADER-APACHE2",
"template": "substrate/.maintain/frame-weight-template.hbs",
"bench_features": "runtime-benchmarks",
"bench_flags": "--exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage",
"uri": null,
"is_relay": false
},
{
"name": "zagros",
"package": "zagros-runtime",
"path": "pezkuwi/runtime/zagros",
"header": "pezkuwi/file_header.txt",
"template": "pezkuwi/xcm/pallet-xcm-benchmarks/template.hbs",
"bench_flags": "",
"bench_features": "runtime-benchmarks",
"uri": "wss://try-runtime-zagros.pezkuwichain.io:443",
"is_relay": true
},
{
"name": "pezkuwichain",
"package": "pezkuwichain-runtime",
"path": "pezkuwi/runtime/pezkuwichain",
"header": "pezkuwi/file_header.txt",
"template": "pezkuwi/xcm/pallet-xcm-benchmarks/template.hbs",
"bench_features": "runtime-benchmarks",
"bench_flags": "",
"uri": "wss://try-runtime-pezkuwichain.pezkuwichain.io:443",
"is_relay": true
},
{
"name": "asset-hub-zagros",
"package": "asset-hub-zagros-runtime",
"path": "cumulus/teyrchains/runtimes/assets/asset-hub-zagros",
"header": "cumulus/file_header.txt",
"template": "cumulus/templates/xcm-bench-template.hbs",
"bench_features": "runtime-benchmarks",
"bench_flags": "",
"uri": "wss://zagros-asset-hub-rpc.pezkuwichain.io:443",
"is_relay": false
},
{
"name": "asset-hub-pezkuwichain",
"package": "asset-hub-pezkuwichain-runtime",
"path": "cumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain",
"header": "cumulus/file_header.txt",
"template": "cumulus/templates/xcm-bench-template.hbs",
"bench_features": "runtime-benchmarks",
"bench_flags": "",
"uri": "wss://pezkuwichain-asset-hub-rpc.pezkuwichain.io:443",
"is_relay": false
},
{
"name": "bridge-hub-pezkuwichain",
"package": "bridge-hub-pezkuwichain-runtime",
"path": "cumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain",
"header": "cumulus/file_header.txt",
"template": "cumulus/templates/xcm-bench-template.hbs",
"bench_features": "runtime-benchmarks",
"bench_flags": "",
"uri": "wss://pezkuwichain-bridge-hub-rpc.pezkuwichain.io:443",
"is_relay": false
},
{
"name": "bridge-hub-zagros",
"package": "bridge-hub-zagros-runtime",
"path": "cumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros",
"header": "cumulus/file_header.txt",
"template": "cumulus/templates/xcm-bench-template.hbs",
"bench_features": "runtime-benchmarks",
"bench_flags": "",
"uri": "wss://zagros-bridge-hub-rpc.pezkuwichain.io:443",
"is_relay": false
},
{
"name": "collectives-zagros",
"package": "collectives-zagros-runtime",
"path": "cumulus/teyrchains/runtimes/collectives/collectives-zagros",
"header": "cumulus/file_header.txt",
"template": "cumulus/templates/xcm-bench-template.hbs",
"bench_features": "runtime-benchmarks",
"bench_flags": "",
"uri": "wss://zagros-collectives-rpc.pezkuwichain.io:443",
"is_relay": false
},
{
"name": "coretime-pezkuwichain",
"package": "coretime-pezkuwichain-runtime",
"path": "cumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain",
"header": "cumulus/file_header.txt",
"template": "cumulus/templates/xcm-bench-template.hbs",
"bench_features": "runtime-benchmarks",
"bench_flags": "",
"uri": "wss://pezkuwichain-coretime-rpc.pezkuwichain.io:443",
"is_relay": false
},
{
"name": "coretime-zagros",
"package": "coretime-zagros-runtime",
"path": "cumulus/teyrchains/runtimes/coretime/coretime-zagros",
"header": "cumulus/file_header.txt",
"template": "cumulus/templates/xcm-bench-template.hbs",
"bench_features": "runtime-benchmarks",
"bench_flags": "",
"uri": "wss://zagros-coretime-rpc.pezkuwichain.io:443",
"is_relay": false
},
{
"name": "glutton-zagros",
"package": "glutton-zagros-runtime",
"path": "cumulus/teyrchains/runtimes/glutton/glutton-zagros",
"header": "cumulus/file_header.txt",
"template": "cumulus/templates/xcm-bench-template.hbs",
"bench_features": "runtime-benchmarks",
"bench_flags": "",
"uri": null,
"is_relay": false
},
{
"name": "people-pezkuwichain",
"package": "people-pezkuwichain-runtime",
"path": "cumulus/teyrchains/runtimes/people/people-pezkuwichain",
"header": "cumulus/file_header.txt",
"template": "cumulus/templates/xcm-bench-template.hbs",
"bench_features": "runtime-benchmarks",
"bench_flags": "",
"uri": "wss://pezkuwichain-people-rpc.pezkuwichain.io:443",
"is_relay": false
},
{
"name": "people-zagros",
"package": "people-zagros-runtime",
"path": "cumulus/teyrchains/runtimes/people/people-zagros",
"header": "cumulus/file_header.txt",
"template": "cumulus/templates/xcm-bench-template.hbs",
"bench_features": "runtime-benchmarks",
"bench_flags": "",
"uri": "wss://zagros-people-rpc.pezkuwichain.io:443",
"is_relay": false
}
]
-94
View File
@@ -1,94 +0,0 @@
name: Security Audit
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
# Run weekly on Monday at 06:00 UTC
schedule:
- cron: "0 6 * * 1"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
isdraft:
# Skip draft PRs but always run on schedule/push
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: ubuntu-latest
steps:
- run: echo "Not a draft"
cargo-deny:
needs: isdraft
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
checks:
- advisories
- licenses
- sources
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979 # v2.0.15
with:
command: check ${{ matrix.checks }}
cargo-audit:
needs: isdraft
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install cargo-audit
run: cargo install cargo-audit --locked
- name: Run cargo audit
run: |
echo "## Cargo Audit Results" >> $GITHUB_STEP_SUMMARY
# Ignored advisories: upstream transitive deps with no available fix.
# Review quarterly and remove ignores when patches become available.
cargo audit \
--ignore RUSTSEC-2026-0006 \
--ignore RUSTSEC-2026-0020 \
--ignore RUSTSEC-2026-0021 \
--ignore RUSTSEC-2026-0049 \
--ignore RUSTSEC-2023-0071 \
--ignore RUSTSEC-2025-0055 \
--ignore RUSTSEC-2026-0067 \
--ignore RUSTSEC-2026-0068 \
2>&1 | tee audit-output.txt
RESULT=${PIPESTATUS[0]}
if [ $RESULT -ne 0 ]; then
echo "### Vulnerabilities found" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
head -500 audit-output.txt >> $GITHUB_STEP_SUMMARY
if [ "$(wc -l < audit-output.txt)" -gt 500 ]; then
echo "... (truncated, see full output in job logs)" >> $GITHUB_STEP_SUMMARY
fi
echo '```' >> $GITHUB_STEP_SUMMARY
exit $RESULT
else
echo "### No vulnerabilities found" >> $GITHUB_STEP_SUMMARY
fi
confirm-security-audit-passed:
runs-on: ubuntu-latest
name: Security audit summary
needs: [cargo-deny, cargo-audit]
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### Security audit FAILED" >> $GITHUB_STEP_SUMMARY
echo "Review the cargo-deny and cargo-audit job outputs for details." >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### All security audits passed' >> $GITHUB_STEP_SUMMARY
fi
+63
View File
@@ -0,0 +1,63 @@
name: security
on:
push:
branches: [main]
pull_request:
schedule:
- cron: "0 6 * * 1" # weekly Monday 06:00 UTC
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Supply-chain: RUSTSEC advisories (known CVEs), license policy, banned/duplicate crates.
cargo-deny:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
checks: [advisories, licenses, bans, sources]
steps:
- uses: actions/checkout@v7
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check ${{ matrix.checks }}
# cargo-deny "advisories" uses the same RUSTSEC database as cargo-audit and is the
# single source of truth for the ignore policy (see deny.toml). A separate cargo-audit
# job is intentionally omitted to avoid maintaining two divergent ignore lists.
# Block PRs that introduce dependencies with known vulnerabilities or bad licenses.
dependency-review:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/dependency-review-action@v5
with:
fail-on-severity: high
# OpenSSF Scorecard — supply-chain security posture of the repo itself.
scorecard:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
permissions:
security-events: write
id-token: write
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: ossf/scorecard-action@v2.4.3
with:
results_file: results.sarif
results_format: sarif
publish_results: true
- uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: results.sarif
+209
View File
@@ -0,0 +1,209 @@
name: test
# Heavy correctness jobs that compile the whole workspace (full test suite, clippy,
# benches, doc-tests). To keep the push/PR feedback loop fast, these do NOT run on
# every push — the every-push gate (compile + runtime build + try-runtime + security
# + quick-checks) lives in check.yml / quick-checks.yml / security.yml. This heavy
# suite runs nightly and on demand (e.g. before a release). They run on the dedicated
# self-hosted build runners and — for security on this public repo — never on
# pull requests from forks.
on:
schedule:
- cron: "0 2 * * *" # nightly 02:00 UTC
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: "0"
# pallet-revive (PolkaVM smart contracts) is a TESTNET-only feature. Its contract
# fixtures are compiled by a build script that uses a polkavm `.json` target spec
# which the polkavm-linker tooling has not yet updated for Rust 1.96's target-spec
# format. Skip that contract compilation in native CI builds (upstream-provided
# env switch). The runtime WASM build is unaffected (it cross-compiles and already
# skips fixtures). Tracked separately for a proper polkavm/Rust-1.96 fix.
SKIP_PALLET_REVIVE_FIXTURES: "1"
# The full-workspace test/clippy/bench compile produced a target dir large enough to
# overflow the smaller self-hosted runners ("No space left on device"). Debug info is the
# bulk of compiled test binaries and is not needed to run tests, so drop it — this shrinks
# the target dir dramatically and keeps the heavy jobs within disk on every runner.
CARGO_PROFILE_DEV_DEBUG: "0"
CARGO_PROFILE_TEST_DEBUG: "0"
# The snowbridge ethereum-client tests are stack-heavy (SSZ merkleization + BLS over a
# 512-key sync committee). They pass in isolation but aborted under the full-suite
# concurrency on the runners; give every test thread a generous stack (upstream Substrate
# does the same for its CI).
RUST_MIN_STACK: "33554432"
# NOTE: CARGO_BUILD_JOBS is intentionally NOT set here. Build parallelism is configured
# per-runner via each runner's systemd Environment, so the big VPS3 runners (94GB/18-core)
# build with high parallelism while the small 11GB runners stay RAM-safe at a lower count.
jobs:
# Unit/integration tests, split into partitions that spread across the runner pool.
test:
runs-on: [self-hosted, substrate-build]
# sccache is intentionally NOT used (its server crashing mid-build failed jobs across
# retries); builds compile cold, so allow generous wall-clock instead of the 6h default.
timeout-minutes: 720
strategy:
fail-fast: false
matrix:
partition: [1, 2]
steps:
- uses: actions/checkout@v7
- name: Free disk if low
# Heaviest job — compiles the whole workspace's test binaries. The persistent
# target dir accumulates and can fill smaller runners; clean it when low.
run: |
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
echo "free: ${avail}G"
if [ "${avail:-999}" -lt 80 ]; then echo "cleaning target"; rm -rf target; fi
# Backstop on small-disk runners: if still critically low, drop the sccache cache too
# so a build can never fill the host disk (these runners share VPSs with validators,
# the bridge and web services — a full disk would take those down).
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
if [ "${avail:-999}" -lt 40 ]; then
echo "critically low (${avail}G): clearing sccache"
rm -rf "${SCCACHE_DIR:-$HOME/.cache/sccache}"/* 2>/dev/null || true
fi
- name: Run tests (nextest, partition ${{ matrix.partition }}/2)
run: |
# The excluded tests below are NOT on-chain fund logic — every runtime and
# FRAME/pezpallet test runs. They are vendor/SDK & chain-spec/metadata tooling
# snapshots, docs-guide node runs, dep-version match tests, the testnet-only
# contracts/revive pallets, and an xcm-emulator harness test. The sr25519/subkey
# "verify" tests check hardcoded SUBSTRATE-context signature vectors; PezkuwiChain
# signs with the sovereign b"bizinikiwi" context (see the wallet's sr25519-bizinikiwi
# binding), so those upstream vectors do not apply — the verify code path itself is
# sound. Tracked in issue #11 to re-enable as fixtures/tooling are updated.
FILTER='not (
package(pezkuwi-zombienet-sdk) |
package(pez-chain-spec-guide-runtime) | package(pezkuwi-sdk-docs) |
package(pezframe-omni-bencher) |
package(bizinikiwi-txtesttool) | package(pezpallet-contracts) |
package(pezpallet-revive-eth-rpc) | package(pezpallet-revive-fixtures) |
(package(asset-hub-zagros-runtime) & test(smart_contract_not_erc20_will_error)) |
package(asset-hub-pezkuwichain-integration-tests) |
package(people-pezkuwichain-integration-tests) |
(package(pezkuwi-zombienet-configuration) & test(network_config_builder))
)'
cargo nextest run --workspace --locked --no-fail-fast \
--exclude pezpallet-revive \
-E "$FILTER" \
--partition count:${{ matrix.partition }}/2 \
--config-file .config/nextest.toml
# Doctests (nextest does not run these).
doc-test:
runs-on: [self-hosted, substrate-build]
# sccache is intentionally NOT used (its server crashing mid-build failed jobs across
# retries); builds compile cold, so allow generous wall-clock instead of the 6h default.
timeout-minutes: 720
steps:
- uses: actions/checkout@v7
- name: Free disk if low
# The persistent target dir accumulates artifacts across heavy builds and can
# fill smaller runners. Clean it when free space is low; sccache keeps the
# rebuild warm. Prevents the "No space left on device" failures.
run: |
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
echo "free: ${avail}G"
if [ "${avail:-999}" -lt 80 ]; then echo "cleaning target"; rm -rf target; fi
# Backstop on small-disk runners: if still critically low, drop the sccache cache too
# so a build can never fill the host disk (these runners share VPSs with validators,
# the bridge and web services — a full disk would take those down).
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
if [ "${avail:-999}" -lt 40 ]; then
echo "critically low (${avail}G): clearing sccache"
rm -rf "${SCCACHE_DIR:-$HOME/.cache/sccache}"/* 2>/dev/null || true
fi
# Retry only transient infra failures (crate fetch, sccache first-use, runner glitch on a
# capped/shared VPS). A real failure still returns non-zero on every attempt and fails.
- name: Doc tests
run: |
n=0
until cargo test --doc --workspace --locked; do
n=$((n+1)); [ "$n" -ge 3 ] && { echo "doc tests failed after $n attempts"; exit 1; }
echo "doc-test attempt $n failed — retrying (transient infra)"; sleep 15
done
# Lint. The lint policy lives in the root Cargo.toml [workspace.lints.clippy]:
# `correctness` is denied (a hard, fund-critical gate — real-bug lints fail CI),
# while `complexity` stays at the upstream-curated `warn` (style/advisory). We do
# NOT add a blanket `-D warnings`, which would override that curated policy and
# turn every newer-toolchain style lint into a failure.
clippy:
runs-on: [self-hosted, substrate-build]
# sccache is intentionally NOT used (its server crashing mid-build failed jobs across
# retries); builds compile cold, so allow generous wall-clock instead of the 6h default.
timeout-minutes: 720
steps:
- uses: actions/checkout@v7
- name: Free disk if low
# The persistent target dir accumulates artifacts across heavy builds and can
# fill smaller runners. Clean it when free space is low; sccache keeps the
# rebuild warm. Prevents the "No space left on device" failures.
run: |
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
echo "free: ${avail}G"
if [ "${avail:-999}" -lt 80 ]; then echo "cleaning target"; rm -rf target; fi
# Backstop on small-disk runners: if still critically low, drop the sccache cache too
# so a build can never fill the host disk (these runners share VPSs with validators,
# the bridge and web services — a full disk would take those down).
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
if [ "${avail:-999}" -lt 40 ]; then
echo "critically low (${avail}G): clearing sccache"
rm -rf "${SCCACHE_DIR:-$HOME/.cache/sccache}"/* 2>/dev/null || true
fi
# Retry only transient infra failures (crate fetch, sccache first-use, runner glitch on a
# capped/shared VPS). A real lint still returns non-zero on every attempt and fails.
- name: Clippy
run: |
n=0
until cargo clippy --workspace --locked --no-deps; do
n=$((n+1)); [ "$n" -ge 3 ] && { echo "clippy failed after $n attempts"; exit 1; }
echo "clippy attempt $n failed — retrying (transient infra)"; sleep 15
done
# Benchmarks must compile (weights are fund-critical: wrong weights enable DoS /
# fee miscalculation). We check compilation here; actual weight generation is a
# separate release-time step.
check-benches:
runs-on: [self-hosted, substrate-build]
# sccache is intentionally NOT used (its server crashing mid-build failed jobs across
# retries); builds compile cold, so allow generous wall-clock instead of the 6h default.
timeout-minutes: 720
steps:
- uses: actions/checkout@v7
- name: Free disk if low
# The persistent target dir accumulates artifacts across heavy builds and can
# fill smaller runners. Clean it when free space is low; sccache keeps the
# rebuild warm. Prevents the "No space left on device" failures.
run: |
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
echo "free: ${avail}G"
if [ "${avail:-999}" -lt 80 ]; then echo "cleaning target"; rm -rf target; fi
# Backstop on small-disk runners: if still critically low, drop the sccache cache too
# so a build can never fill the host disk (these runners share VPSs with validators,
# the bridge and web services — a full disk would take those down).
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
if [ "${avail:-999}" -lt 40 ]; then
echo "critically low (${avail}G): clearing sccache"
rm -rf "${SCCACHE_DIR:-$HOME/.cache/sccache}"/* 2>/dev/null || true
fi
# Retry only transient infra failures (crate fetch, sccache first-use, runner glitch on a
# capped/shared VPS). A real failure still returns non-zero on every attempt and fails.
- name: Check benches
run: |
n=0
until cargo check --workspace --locked --benches --features runtime-benchmarks; do
n=$((n+1)); [ "$n" -ge 3 ] && { echo "check-benches failed after $n attempts"; exit 1; }
echo "check-benches attempt $n failed — retrying (transient infra)"; sleep 15
done
-165
View File
@@ -1,165 +0,0 @@
# DISABLED: External retester tool configuration issues
# Re-enable after mainnet launch when EVM testing infrastructure is ready
name: EVM test suite
on:
workflow_dispatch: # Manual trigger only
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
differential-tests:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
permissions:
pull-requests: write
strategy:
matrix:
platform:
["revive-dev-node-revm-solc", "revive-dev-node-polkavm-resolc"]
steps:
- name: Checkout the Pezkuwi SDK
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Update the Installed Python
run: apt-get update && apt-get install -y python3-pip python3
- name: Installing the Latest Resolc
# NOTE: resolc is an upstream shared tool from paritytech/revive (EVM compiler)
run: |
VERSION="0.5.0"
ASSET_URL="https://github.com/paritytech/revive/releases/download/v$VERSION/resolc-x86_64-unknown-linux-musl"
echo "Downloading resolc v$VERSION from $ASSET_URL"
curl -Lsf --show-error -o resolc "$ASSET_URL"
chmod +x resolc
./resolc --version
- name: Building the dependencies from the Pezkuwi SDK
run: cargo build --locked --profile release -p pezpallet-revive-eth-rpc -p pez-revive-dev-node
- name: Checkout the Differential Tests Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: pezkuwichain/revive-differential-tests
ref: main
path: revive-differential-tests
submodules: recursive
- name: Installing Retester
run: cargo install --locked --path revive-differential-tests/crates/core
- name: Creating a workdir for retester
run: mkdir workdir
- name: Downloading & Initializing the compilation caches
run: |
curl -fL --retry 3 --retry-all-errors --connect-timeout 10 -o cache.tar.gz "https://github.com/paritytech/revive-differential-tests/releases/download/compilation-caches-v1.0/cache.tar.gz"
tar -zxf cache.tar.gz -C ./workdir > /dev/null 2>&1
- name: Running the Differential Tests
run: |
retester test \
--test ./revive-differential-tests/resolc-compiler-tests/fixtures/solidity/simple \
--test ./revive-differential-tests/resolc-compiler-tests/fixtures/solidity/complex \
--test ./revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests \
--platform ${{ matrix.platform }} \
--concurrency.number-of-nodes 10 \
--concurrency.number-of-threads 10 \
--concurrency.number-of-concurrent-tasks 1000 \
--working-directory ./workdir \
--revive-dev-node.consensus manual-seal-200 \
--revive-dev-node.path ./target/release/pez-revive-dev-node \
--eth-rpc.path ./target/release/eth-rpc \
--resolc.path ./resolc
- name: Creating a markdown report of the test execution
run: |
mv ./workdir/*.json report.json
python3 ./.github/scripts/process-differential-tests-report.py report.json ${{ matrix.platform }}
# We upload the report as an artifact to the run since there could be
# certain cases where the report is too long to post as a Github comment.
# This happens if the all of the tests are failing and therefore the
# report exceeds the maximum allowed length of github comments
- name: Upload the Report to the CI
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
name: report-${{ matrix.platform }}.md
path: report.md
- name: Posting the report as a comment on the PR
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405
if: ${{ contains(github.event.pull_request.labels.*.name, 'T7-smart_contracts') }}
with:
header: diff-tests-report-${{ matrix.platform }}
path: report.md
evm-test-suite:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-C debug-assertions"
RUST_BACKTRACE: 1
strategy:
matrix:
platform:
["test:pvm", "test:evm"]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: script
run: |
cargo build --locked --release -p pezpallet-revive-eth-rpc --bin eth-rpc
cargo build --locked --release -p pez-revive-dev-node --bin pez-revive-dev-node
- name: Checkout evm-tests
# NOTE: evm-test-suite is an upstream shared test suite from paritytech
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: paritytech/evm-test-suite
ref: 9359438a13e8ab68f73320724f8783e170ecc193
path: evm-test-suite
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: script
run: |
echo "Change to the evm-test-suite directory"
cd evm-test-suite
deno --version
echo "Check that binaries are in place"
export REVIVE_DEV_NODE_PATH=$(readlink -f ../target/release/pez-revive-dev-node)
export ETH_RPC_PATH=$(readlink -f ../target/release/eth-rpc)
echo $REVIVE_DEV_NODE_PATH $ETH_RPC_PATH
echo "== Running tests =="
START_REVIVE_DEV_NODE=true START_ETH_RPC=true deno task ${{ matrix.platform }}
confirm-required-test-evm-jobs-passed:
runs-on: ubuntu-latest
name: All test misc tests passed
# If any new job gets added, be sure to add it to this array
needs:
- evm-test-suite
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
@@ -1,123 +0,0 @@
# GHA for test-linux-stable-int, test-linux-stable, test-linux-stable-oldkernel
name: tests linux stable coverage
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
preflight:
uses: ./.github/workflows/reusable-preflight.yml
if: contains(github.event.label.name, 'GHA-coverage') || contains(github.event.pull_request.labels.*.name, 'GHA-coverage')
#
#
#
test-linux-stable-coverage:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 120
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
RUST_TOOLCHAIN: stable
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
#
# -Cinstrument-coverage slows everything down but it is necessary for code coverage
# https://doc.rust-lang.org/rustc/instrument-coverage.html
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings -Cinstrument-coverage"
LLVM_PROFILE_FILE: "/__w/pezkuwi-sdk/pezkuwi-sdk/target/coverage/cargo-test-${{ matrix.ci_node_index }}-%p-%m.profraw"
strategy:
fail-fast: false
matrix:
ci_node_index: [1, 2, 3, 4, 5]
ci_node_total: [5]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- run: rustup component add llvm-tools-preview
- run: cargo install cargo-llvm-cov
- run: mkdir -p target/coverage
# Some tests are excluded because they run very slowly or fail with -Cinstrument-coverage
- name: run tests
run: >
time cargo llvm-cov nextest
--no-report --release
--workspace
--locked --no-fail-fast
--features try-runtime,ci-only-tests,experimental
--filter-expr "
!test(/.*benchmark.*/)
- test(/recovers_from_only_chunks_if_pov_large::case_1/)
- test(/participation_requests_reprioritized_for_newly_included/)
- test(/availability_is_recovered_from_chunks_if_no_group_provided::case_1/)
- test(/rejects_missing_inherent_digest/)
- test(/availability_is_recovered_from_chunks_even_if_backing_group_supplied_if_chunks_only::case_1/)
- test(/availability_is_recovered_from_chunks_if_no_group_provided::case_2/)
- test(/all_security_features_work/)
- test(/nonexistent_cache_dir/)
- test(/recovers_from_only_chunks_if_pov_large::case_3/)
- test(/recovers_from_only_chunks_if_pov_large::case_2/)
- test(/authoring_blocks/)
- test(/rejects_missing_seals/)
- test(/generate_chain_spec/)
- test(/get_preset/)
- test(/list_presets/)
- test(/tests::receive_rate_limit_is_enforced/)
- test(/pezkuwi-availability-recovery/)
"
--partition count:${{ matrix.ci_node_index }}/${{ matrix.ci_node_total }}
- name: generate report
run: cargo llvm-cov report --release --codecov --output-path coverage-${{ matrix.ci_node_index }}.lcov
- name: upload report
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: coverage-report-${{ matrix.ci_node_index }}.lcov
path: coverage-${{ matrix.ci_node_index }}.lcov
#
#
# Upload to codecov
upload-reports:
needs: [test-linux-stable-coverage]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
path: reports
pattern: coverage-report-*
merge-multiple: true
- run: ls -al reports/
- name: Upload to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
directory: reports
root_dir: /__w/pezkuwi-sdk/pezkuwi-sdk/
#
#
#
remove-label:
runs-on: ubuntu-latest
needs: [upload-reports]
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0
with:
labels: GHA-coverage
@@ -1,92 +0,0 @@
# GHA for test-linux-stable-int, test-linux-stable, test-linux-stable-oldkernel with new runners
name: tests linux stable experimental
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
if: false
uses: ./.github/workflows/reusable-preflight.yml
# No filter for 'all_security_features_work' and 'nonexistent_cache_dir'
# run all tests on cattery runners
test-linux-stable-no-try-runtime:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_rust }}
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
options: --privileged
strategy:
fail-fast: false
matrix:
partition: [1/2, 2/2]
env:
RUST_TOOLCHAIN: stable
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: script
id: required
run: |
cargo nextest run --workspace \
--locked \
--release \
--no-fail-fast \
--features experimental,ci-only-tests \
--partition count:${{ matrix.partition }}
test-linux-stable:
needs: [preflight]
runs-on: ${{ matrix.runners }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
partition: [1/3, 2/3, 3/3]
runners: [ubuntu-latest]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
# needed for tests that use unshare syscall
options: --privileged
env:
RUST_TOOLCHAIN: stable
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: script
id: required
run: |
# Fixes "detected dubious ownership" error in the ci
git config --global --add safe.directory '*'
cargo nextest run \
--workspace \
--locked \
--release \
--no-fail-fast \
--cargo-quiet \
--features try-runtime,experimental,ci-only-tests \
--partition count:${{ matrix.partition }}
# run runtime-api tests with `enable-pez-staging-api` feature on the 1st node
- name: runtime-api tests
if: ${{ matrix.partition == '1/3' }}
run: cargo nextest run -p pezsp-api-test --features enable-pez-staging-api --cargo-quiet
-169
View File
@@ -1,169 +0,0 @@
# GHA for test-linux-stable-int, test-linux-stable, test-linux-stable-oldkernel
# DISABLED: Infrastructure issues (Docker network pool, serde_core WASM bug)
# Re-enable after mainnet launch when CI infrastructure is stabilized
name: tests linux stable
on:
workflow_dispatch: # Manual trigger only
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
test-linux-stable-int:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_rust }}
runs-on: ${{ needs.preflight.outputs.RUNNER_NEW }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
volumes:
- /cache/cargo-target/pezkuwi-sdk:/cache/target
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
RUST_BACKTRACE: 1
WASM_BUILD_NO_COLOR: 1
WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings"
# Ensure we run the UI tests.
RUN_UI_TESTS: 1
CARGO_TARGET_DIR: /cache/target
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: script
id: required
run: |
git config --global --add safe.directory '*'
WASM_BUILD_NO_COLOR=1 cargo test -p pezstaging-node-cli --release --locked -- --ignored
# https://github.com/pezkuwichain/ci_cd/issues/864
test-linux-stable-runtime-benchmarks:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_rust }}
runs-on: ${{ needs.preflight.outputs.RUNNER_NEW }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
volumes:
- /cache/cargo-target/pezkuwi-sdk:/cache/target
env:
RUST_TOOLCHAIN: stable
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
CARGO_TARGET_DIR: /cache/target
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: script
id: required
run: |
git config --global --add safe.directory '*'
cargo nextest run --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet --cargo-quiet
test-linux-stable:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_rust }}
runs-on: ${{ needs.preflight.outputs.RUNNER_NEW }}
timeout-minutes: 75
strategy:
fail-fast: false
matrix:
# Reduced from 3x2=6 jobs to 3 jobs (single runner type)
partition: [1/3, 2/3, 3/3]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
options: --privileged
volumes:
- /cache/cargo-target/pezkuwi-sdk:/cache/target
env:
RUST_TOOLCHAIN: stable
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
CARGO_INCREMENTAL: 0
CARGO_TARGET_DIR: /cache/target
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: script
id: required
run: |
git config --global --add safe.directory '*'
cargo nextest run \
--workspace \
--locked \
--release \
--no-fail-fast \
--cargo-quiet \
--features try-runtime,experimental,ci-only-tests \
--partition count:${{ matrix.partition }}
- name: runtime-api tests
if: ${{ matrix.partition == '1/3' }}
run: cargo nextest run -p pezsp-api-test --features enable-pez-staging-api --cargo-quiet
# some tests do not run with `try-runtime` feature enabled
# https://github.com/pezkuwichain/pezkuwi-sdk/pull/4251#discussion_r1624282143
test-linux-stable-no-try-runtime:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_rust }}
runs-on: ${{ needs.preflight.outputs.RUNNER_NEW }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
options: --privileged
volumes:
- /cache/cargo-target/pezkuwi-sdk:/cache/target
strategy:
fail-fast: false
matrix:
partition: [1/2, 2/2]
env:
RUST_TOOLCHAIN: stable
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
CARGO_TARGET_DIR: /cache/target
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: script
id: required
run: |
git config --global --add safe.directory '*'
cargo nextest run --workspace \
--locked \
--release \
--no-fail-fast \
--cargo-quiet \
--features experimental,ci-only-tests \
--partition count:${{ matrix.partition }}
confirm-required-jobs-passed:
runs-on: ubuntu-latest
name: All tests passed
# If any new job gets added, be sure to add it to this array
needs:
[
test-linux-stable-int,
test-linux-stable-runtime-benchmarks,
test-linux-stable,
test-linux-stable-no-try-runtime,
]
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
-526
View File
@@ -1,526 +0,0 @@
name: tests misc
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# Jobs in this workflow depend on each other, only for limiting peak amount of spawned workers
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
# more information about this job can be found here:
# https://github.com/pezkuwichain/bizinikiwi/pull/3778
test-full-crypto-feature:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-C debug-assertions"
RUST_BACKTRACE: 1
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: script
run: |
cd bizinikiwi/primitives/core/
cargo build --locked --no-default-features --features full_crypto
cd ../application-crypto
cargo build --locked --no-default-features --features full_crypto
test-pezframe-examples-compile-to-wasm:
timeout-minutes: 45
# into one job
needs: [preflight, test-full-crypto-feature]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-C debug-assertions"
RUST_BACKTRACE: 1
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: script
run: |
cd bizinikiwi/pezframe/examples/offchain-worker/
RUSTFLAGS="--cfg bizinikiwi_runtime" cargo build --locked --target=wasm32v1-none --no-default-features
cd ../basic
RUSTFLAGS="--cfg bizinikiwi_runtime" cargo build --locked --target=wasm32v1-none --no-default-features
test-pezframe-ui:
timeout-minutes: 150
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
RUST_BACKTRACE: 1
RUN_UI_TESTS: 1
CARGO_INCREMENTAL: 0
WASM_BUILD_WORKSPACE_HINT: ${{ github.workspace }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: Rust Cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
shared-key: pezframe-ui
cache-on-failure: true
- name: script
run: |
cargo version
cargo test --locked -q --profile testnet -p pezframe-support-test --features=frame-feature-testing,no-metadata-docs,try-runtime,experimental ui
cargo test --locked -q --profile testnet -p pezframe-support-test --features=frame-feature-testing,frame-feature-testing-2,no-metadata-docs,try-runtime,experimental ui
cargo test --locked -q --profile testnet -p xcm-pez-procedural ui
cargo test --locked -q --profile testnet -p pezframe-election-provider-solution-type ui
cargo test --locked -q --profile testnet -p pezsp-api-test ui
cargo test --locked -q --profile testnet --manifest-path bizinikiwi/primitives/runtime-interface/Cargo.toml ui
test-deterministic-wasm:
timeout-minutes: 180
needs: [preflight, test-full-crypto-feature]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
WASM_BUILD_NO_COLOR: 1
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: Clean cargo cache to free disk space
run: |
cargo clean 2>/dev/null || true
rm -rf ~/.cargo/registry/cache 2>/dev/null || true
rm -rf ~/.cargo/git/db 2>/dev/null || true
- name: script
run: |
# build runtime
cargo build -q --locked --release -p zagros-runtime -p pezkuwichain-runtime
# make checksum — find wasm blobs regardless of target triple
find target/release/wbuild/ -name '*.wasm' -path '*/release/*' | sort | xargs sha256sum > checksum.sha256
cargo clean
# build again
cargo build -q --locked --release -p zagros-runtime -p pezkuwichain-runtime
# confirm checksum
sha256sum -c checksum.sha256
cargo-check-benches:
needs: [preflight]
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
timeout-minutes: 60
strategy:
matrix:
branch: [main, current]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# if branch is main, use the branch, otherwise set empty string, so it uses the current context
# either PR (including forks) or merge group (main repo)
ref: ${{ matrix.branch == 'main' && matrix.branch || '' }}
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: script
shell: bash
run: |
# Fail the step if any command in a pipeline errors out.
set -euo pipefail
ARTIFACTS_DIR=./artifacts
BENCH_TRIE_READ=::trie::read::small
BENCH_NODE_IMPORT=::node::import::sr25519::transfer_keep_alive::paritydb::small
mkdir -p $ARTIFACTS_DIR
# Exclude packages with feature unification issues with --benches flag
# (pezframe-support/runtime-benchmarks gets enabled but the package's runtime-benchmarks doesn't)
# pezpallet-tiki and all its dependents need to be excluded due to EnsureOrigin trait issues
SKIP_WASM_BUILD=1 cargo check --locked --benches --workspace \
--exclude pezpallet-tiki \
--exclude pezpallet-trust \
--exclude pezpallet-welati \
--exclude pezpallet-pez-rewards \
--exclude people-pezkuwichain-runtime \
--exclude pezkuwi-teyrchain-bin \
--exclude asset-hub-zagros-runtime \
--exclude asset-hub-pezkuwichain-runtime \
--exclude collectives-zagros-runtime;
cargo run --locked --release -p pez-node-bench -- $BENCH_TRIE_READ --json | tee $ARTIFACTS_DIR/bench_trie_read_small.json;
cargo run --locked --release -p pez-node-bench -- $BENCH_NODE_IMPORT --json | tee $ARTIFACTS_DIR/bench_transfer_keep_alive.json
- name: Upload artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
path: ./artifacts
name: cargo-check-benches-${{ matrix.branch }}-${{ github.sha }}
retention-days: 1
pez-node-bench-regression-guard:
timeout-minutes: 20
# Only run on PR/merge_group where cargo-check-benches produces artifacts
if: always() && !cancelled() && (github.event_name == 'pull_request' || github.event_name == 'merge_group')
runs-on: ubuntu-latest
needs: [preflight, cargo-check-benches]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Download artifact (main run)
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
continue-on-error: true
with:
name: cargo-check-benches-main-${{ github.sha }}
path: ./artifacts/main
- name: Download artifact (current run)
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
continue-on-error: true
with:
name: cargo-check-benches-current-${{ github.sha }}
path: ./artifacts/current
- name: script
id: compare
run: |
if [ "${{ github.ref_name }}" = "main" ]; then
echo -e "Exiting on main branch"
exit 0
fi
# fail if no artifacts
if [ ! -d ./artifacts/main ] || [ ! -d ./artifacts/current ]; then
echo "No artifacts found"
exit 1
fi
# NOTE: Using echo instead of docker - pezkuwichain/pez-node-bench-regression-guard not available for Pezkuwi
# If benchmark regression guard is needed, fork the tool to pezkuwichain
echo "::notice::Benchmark regression guard check skipped - tool not available for Pezkuwi SDK"
echo "Comparing artifacts from main and current..."
if [ -d "$PWD/artifacts/main" ] && [ -d "$PWD/artifacts/current" ]; then
echo "Both artifact directories exist"
ls -la $PWD/artifacts/main/ || true
ls -la $PWD/artifacts/current/ || true
fi
if [ $? -ne 0 ]; then
FAILED_MSG='### pez-node-bench-regression-guard failed ❌, check the regression in *cargo-check-benches* job'
echo $FAILED_MSG
echo $FAILED_MSG >> $GITHUB_STEP_SUMMARY
exit 1
else
echo "### pez-node-bench-regression-guard passed ✅" >> $GITHUB_STEP_SUMMARY
fi
test-node-metrics:
needs: [preflight]
timeout-minutes: 180
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: Clean cargo cache to free disk space
run: |
cargo clean 2>/dev/null || true
rm -rf ~/.cargo/registry/cache 2>/dev/null || true
rm -rf ~/.cargo/git/db 2>/dev/null || true
- name: Run tests
id: tests
env:
RUST_TOOLCHAIN: stable
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
run: |
cargo build --bin pezkuwi-execute-worker --bin pezkuwi-prepare-worker --profile testnet --verbose --locked
mkdir -p ./artifacts
cargo test --profile testnet --locked --features=runtime-metrics -p pezkuwi-node-metrics > ./artifacts/log.txt
echo "Metrics test passed"
- name: Upload artifacts if failed
if: ${{ steps.tests.outcome != 'success' }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: node-metrics-failed
path: ./artifacts
# more information about this job can be found here:
# https://github.com/pezkuwichain/bizinikiwi/pull/6916
check-tracing:
timeout-minutes: 45
needs: [preflight, test-node-metrics]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: script
run: |
cargo test --locked --manifest-path ./bizinikiwi/primitives/tracing/Cargo.toml --no-default-features
cargo test --locked --manifest-path ./bizinikiwi/primitives/tracing/Cargo.toml --no-default-features --features=with-tracing
check-metadata-hash:
timeout-minutes: 45
needs: [preflight, check-tracing]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: script
run: |
cargo build --locked -p zagros-runtime --features metadata-hash
# disabled until https://github.com/pezkuwichain/pezkuwi-sdk/issues/5812 is resolved
# cargo-hfuzz:
# timeout-minutes: 20
# needs: [preflight, check-metadata-hash]
# runs-on: ${{ needs.preflight.outputs.RUNNER }}
# container:
# image: ${{ needs.preflight.outputs.IMAGE }}
# env:
# # max 10s per iteration, 60s per file
# HFUZZ_RUN_ARGS: |
# --exit_upon_crash
# --exit_code_upon_crash 1
# --timeout 10
# --run_time 60
# # use git version of honggfuzz-rs until v0.5.56 is out, we need a few recent changes:
# # https://github.com/rust-fuzz/honggfuzz-rs/pull/75 to avoid breakage on debian
# # https://github.com/rust-fuzz/honggfuzz-rs/pull/81 fix to the above pr
# # https://github.com/rust-fuzz/honggfuzz-rs/pull/82 fix for handling absolute CARGO_TARGET_DIR
# HFUZZ_BUILD_ARGS: |
# --config=patch.crates-io.honggfuzz.git="https://github.com/altaua/honggfuzz-rs"
# --config=patch.crates-io.honggfuzz.rev="205f7c8c059a0d98fe1cb912cdac84f324cb6981"
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Run honggfuzz
# run: |
# cd bizinikiwi/primitives/arithmetic/fuzzer
# cargo hfuzz build
# for target in $(cargo read-manifest | jq -r '.targets | .[] | .name');
# do
# cargo hfuzz run "$target" || { printf "fuzzing failure for %s\n" "$target"; exit 1; };
# done
# - name: Upload artifacts
# uses: actions/upload-artifact@v4.3.6
# with:
# path: bizinikiwi/primitives/arithmetic/fuzzer/hfuzz_workspace/
# name: hfuzz-${{ github.sha }}
cargo-check-each-crate:
timeout-minutes: 300
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
RUSTFLAGS: "-D warnings"
CI_JOB_NAME: cargo-check-each-crate
CARGO_INCREMENTAL: 0
SKIP_WASM_BUILD: 1
strategy:
fail-fast: false
matrix:
index: [1, 2, 3, 4] # Reduced from 7 to 4 parallel jobs to lower system load
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Rust Cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
shared-key: check-each-crate-${{ matrix.index }}
cache-on-failure: true
- name: script
run: |
PYTHONUNBUFFERED=x .github/scripts/check-each-crate.py ${{ matrix.index }} ${{ strategy.job-total }}
cargo-check-all-crate-macos:
timeout-minutes: 150
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER_MACOS }}
if: ${{ needs.preflight.outputs.changes_rust }}
# Informational: macOS runner disk space issues cause sporadic failures.
# Remove continue-on-error once runner infrastructure is stable.
continue-on-error: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Free disk space
run: |
echo "Disk space before cleanup:"
df -h /
# Remove large pre-installed tools to free disk space
sudo rm -rf /Library/Developer/CommandLineTools/SDKs 2>/dev/null || true
sudo rm -rf /Users/runner/Library/Android 2>/dev/null || true
sudo rm -rf /usr/local/share/powershell 2>/dev/null || true
sudo rm -rf /usr/local/lib/node_modules 2>/dev/null || true
brew cleanup --prune=all 2>/dev/null || true
echo "Disk space after cleanup:"
df -h /
- name: Set rust version from env file
run: |
RUST_VERSION=$(cat .github/env | sed -E 's/.*ci-unified:([^-]+)-([^-]+).*/\2/')
echo $RUST_VERSION
echo "RUST_VERSION=${RUST_VERSION}" >> $GITHUB_ENV
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@1ccc07ccd54b6048295516a3eb89b192c35057dc # master from 12.09.2024
# Is broken because of different bash versions
# - name: Install rust ${{ env.RUST_VERSION }}
# uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
# with:
# cache: false
# toolchain: ${{ env.RUST_VERSION }}
# target: wasm32-unknown-unknown
# components: cargo, clippy, rust-docs, rust-src, rustfmt, rustc, rust-std
- name: Install rust ${{ env.RUST_VERSION }}
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUST_VERSION
source $HOME/.cargo/env
rustup target add wasm32v1-none
rustup component add clippy rust-docs rust-src rustfmt rustc rust-std
- name: Install protobuf
run: brew install protobuf
- name: install solc
run: |
# Install solc-select to manage solc versions
# Use --break-system-packages for macOS externally-managed Python
pip3 install --break-system-packages solc-select
# Install and use solc 0.8.30 (revive only supports up to 0.8.30)
solc-select install 0.8.30
solc-select use 0.8.30
solc --version
- name: Install resolc
# NOTE: resolc is an upstream shared tool from paritytech/revive (EVM compiler)
run: |
source $HOME/.cargo/env
VERSION="0.5.0"
ASSET_URL="https://github.com/paritytech/revive/releases/download/v$VERSION/resolc-universal-apple-darwin"
echo "Downloading resolc v$VERSION from $ASSET_URL"
curl -Lsf --show-error -o $HOME/.cargo/bin/resolc "$ASSET_URL"
chmod +x $HOME/.cargo/bin/resolc
xattr -c $HOME/.cargo/bin/resolc
resolc --version
- name: Install llvm
run: |
brew install llvm@20
brew link llvm@20
- name: cargo info
run: |
source $HOME/.cargo/env
echo "######## rustup show ########"
rustup show
echo "######## cargo --version ########"
cargo --version
- name: Run cargo check
run: |
source $HOME/.cargo/env
cargo check --workspace --locked
confirm-required-test-misc-jobs-passed:
runs-on: ubuntu-latest
name: All test misc tests passed
# If any new job gets added, be sure to add it to this array
needs:
- test-full-crypto-feature
- test-pezframe-examples-compile-to-wasm
- test-pezframe-ui
- test-deterministic-wasm
- cargo-check-benches
- pez-node-bench-regression-guard
- test-node-metrics
- check-tracing
- cargo-check-each-crate
# - cargo-hfuzz remove from required for now, as it's flaky
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
-107
View File
@@ -1,107 +0,0 @@
name: tests
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
# This job runs all benchmarks defined in the `/bin/node/runtime` once to check that there are no errors.
quick-benchmarks:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_rust }}
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 180
# pezpallet_revive excluded: requires PolkaVM toolchain for fixture compilation.
# Track via: https://github.com/pezkuwichain/pezkuwi-sdk/issues/TBD
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
RUST_BACKTRACE: "full"
WASM_BUILD_NO_COLOR: 1
WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings"
CARGO_INCREMENTAL: 0
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Rust Cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
shared-key: quick-benchmarks
cache-on-failure: true
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: script
run: cargo run --locked --release -p pezstaging-node-cli --bin bizinikiwi-node --features runtime-benchmarks --quiet -- benchmark pezpallet --chain dev --pezpallet "*" --extrinsic "*" --exclude-pezpallets pezpallet_revive --steps 2 --repeat 1 --quiet
# cf https://github.com/pezkuwichain/pezkuwi-sdk/issues/1652
test-syscalls:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_rust }}
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 120
container:
image: ${{ needs.preflight.outputs.IMAGE }}
continue-on-error: true # this rarely triggers in practice
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none
- name: script
id: test
run: |
cargo build --locked --profile production --target x86_64-unknown-linux-musl --bin pezkuwi-execute-worker --bin pezkuwi-prepare-worker --quiet
cd pezkuwi/scripts/list-syscalls
./list-syscalls.rb ../../../target/x86_64-unknown-linux-musl/production/pezkuwi-execute-worker --only-used-syscalls | diff -u execute-worker-syscalls -
./list-syscalls.rb ../../../target/x86_64-unknown-linux-musl/production/pezkuwi-prepare-worker --only-used-syscalls | diff -u prepare-worker-syscalls -
- name: on_failure
if: failure() && steps.test.outcome == 'failure'
run: |
echo "The x86_64 syscalls used by the worker binaries have changed. Please review if this is expected and update pezkuwi/scripts/list-syscalls/*-worker-syscalls as needed." >> $GITHUB_STEP_SUMMARY
cargo-check-all-benches:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_rust }}
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 75
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
SKIP_WASM_BUILD: 1
CARGO_INCREMENTAL: 0
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Disable forklift cache wrapper
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
- name: Rust Cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
shared-key: check-all-benches
cache-on-failure: true
- name: script
run: |
cargo check --workspace --locked --benches --features runtime-benchmarks --quiet
+20 -120
View File
@@ -1,125 +1,25 @@
!pezkuwi.service
.cargo-remote.toml
.direnv/
.DS_Store
.env*
chainspecs/
# Rust / Cargo
/target
**/target
*.rs.bk
Cargo.lock.bak
# Simulation scripts and data (local mainnet sim)
vendor/pezkuwi-subxt/subxt/examples/sim_*
vendor/pezkuwi-subxt/subxt/examples/local_sim_*
vendor/pezkuwi-subxt/subxt/examples/fix_*
vendor/pezkuwi-subxt/subxt/examples/init_ah_staking.rs
# WASM build artifacts
**/wbuild
# Operational/diagnostic scripts (contain hardcoded VPS IPs)
vendor/pezkuwi-subxt/subxt/examples/burn_xcm_check_account.rs
vendor/pezkuwi-subxt/subxt/examples/check_tx.rs
vendor/pezkuwi-subxt/subxt/examples/check_validator_balances.rs
vendor/pezkuwi-subxt/subxt/examples/diagnose_balances.rs
vendor/pezkuwi-subxt/subxt/examples/list_validators.rs
vendor/pezkuwi-subxt/subxt/examples/people_diag.rs
vendor/pezkuwi-subxt/subxt/examples/people_upgrade_step2.rs
vendor/pezkuwi-subxt/subxt/examples/trace_transfers.rs
vendor/pezkuwi-subxt/subxt/examples/watch_teleport.rs
.idea
.local
.lycheecache
.vscode
.zed
.wasm-binaries
*.adoc
*.bin
# Exception: sassafras benchmark data (required for CI)
!bizinikiwi/pezframe/sassafras/src/data/*.bin
*.iml
*.orig
*.rej
# Editor / OS
.vscode/
.idea/
*.swp
*.wasm
**/._*
**/.criterion/
**/*.rs.bk
**/hfuzz_target/
**/hfuzz_workspace/
**/node_modules
**/target/
**/wip/*.stderr
**/__pycache__/
/.cargo/config
/.envrc
artifacts
!vendor/pezkuwi-subxt/artifacts/
bin/node-template/Cargo.lock
nohup.out
pezkuwi_argument_parsing
!docs/sdk/src/pezkuwi_sdk/pezkuwi.rs
pwasm-alloc/Cargo.lock
pwasm-libc/Cargo.lock
release-artifacts
release.json
rls*.log
runtime/wasm/target/
pezkuwi.code-workspace
target/
*.scale
rustc-ice-*
.DS_Store
# AI coordination files (private)
.ai-coordination/
head.rs
# Local env / secrets — never commit
.env
*.key
*.pem
secrets/
# Claude Code / AI tooling — never commit
.claude/
CLAUDE.md
# Regenerable artifacts (do not commit)
chain_spec.json
publish.log
pezkuwi.gbp
# Zombienet binaries
zombienet-linux
zombienet-macos
# Vendored lock files
vendor/*/Cargo.lock
# Generated chain specs
chain-specs/
# Sensitive wallet data - NEVER commit
/res/
tools/usdt-bridge/secrets/
*.seed
*wallet*.json
founder_validators.json
founder_governance.json
mainnet/
relay-mainnet.json
relay-mainnet-raw.json
asset-hub-plain.json
asset-hub-raw.json
people-chain.json
people-chain-raw.json
# Mainnet operation scripts (may contain sensitive data)
vendor/pezkuwi-subxt/subxt/examples/check_staking.rs
vendor/pezkuwi-subxt/subxt/examples/comprehensive_test.rs
vendor/pezkuwi-subxt/subxt/examples/create_nft_collection.rs
vendor/pezkuwi-subxt/subxt/examples/debug_transfer.rs
vendor/pezkuwi-subxt/subxt/examples/register_teyrchain.rs
vendor/pezkuwi-subxt/subxt/examples/transfer_mainnet.rs
# Local tools (not part of SDK)
tools/asset-creator/
tools/build-mainnet-chainspec.sh
tools/runtime-upgrade/
tools/wasm-crypto/
tools/usdt-bridge/bridge_db.json
# Internal operational/rebranding scripts (not for public)
docs/rebrand_project.py
docs/scan_old_words.py
docs/workflow_rebranding.md
docs/reserve_crate_names_v2.py
docs/publish_crates_slow.py
# Logs & local chain data
*.log
/chains
/data
+2 -2
View File
@@ -39,6 +39,6 @@ See [NOTICE](./NOTICE) for full attribution.
---
[Unreleased]: https://git.pezkuwichain.io/pezkuwichain/pezkuwi-sdk/compare/v0.44.0...HEAD
[0.44.0]: https://git.pezkuwichain.io/pezkuwichain/pezkuwi-sdk/releases/tag/v0.44.0
[Unreleased]: https://github.com/pezkuwichain/pezkuwi-DKS/compare/v0.44.0...HEAD
[0.44.0]: https://github.com/pezkuwichain/pezkuwi-DKS/releases/tag/v0.44.0
+11 -32
View File
@@ -1,35 +1,14 @@
# CODEOWNERS — auto-assigns reviewers for merge requests
# Syntax: <pattern> <@user or @group>
# Docs: https://docs.gitlab.com/ee/user/project/code_owners.html
# Default owners for everything in the repo
* @pezkuwichain/core
# Default: all changes require pezkuwichain org review
* @pezkuwichain
# Runtimes
/relay/ @pezkuwichain/runtime
/system-parachains/ @pezkuwichain/runtime
# Runtime & consensus — critical paths
/pezkuwi/runtime/ @pezkuwichain
/pezkuwi/primitives/ @pezkuwichain
/bizinikiwi/primitives/consensus/ @pezkuwichain
# CI/CD & build infrastructure
/.gitlab-ci.yml @pezkuwichain
/.gitlab/ @pezkuwichain
/.github/ @pezkuwichain
/rust-toolchain.toml @pezkuwichain
/deny.toml @pezkuwichain
# Asset Hub & staking (financial critical)
/pezkuwi/asset-hub/ @pezkuwichain
# People Chain & identity
/pezkuwi/people/ @pezkuwichain
# Parachain / cumulus
/pezcumulus/ @pezkuwichain
# XCM
/pezkuwi/xcm/ @pezkuwichain
# Documentation
/docs/ @pezkuwichain
*.md @pezkuwichain
# Original pallets
/pallets/ @pezkuwichain/runtime
# Licensing & compliance — must be reviewed on any change
/NOTICE @pezkuwichain/core
/LICENSE-APACHE @pezkuwichain/core
/LICENSE-GPL3 @pezkuwichain/core
Generated
+471 -438
View File
File diff suppressed because it is too large. Load diff
+9 -8
View File
@@ -8,7 +8,7 @@ version = "0.44.0"
rust-version = "1.81"
homepage = "https://pezkuwichain.io/"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
repository = "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-sdk.git"
repository = "https://github.com/pezkuwichain/pezkuwi-DKS.git"
documentation = "https://docs.pezkuwichain.io/"
[workspace]
@@ -650,8 +650,8 @@ unexpected_cfgs = { level = "warn", check-cfg = [
all = { level = "allow", priority = 0 }
bind_instead_of_map = { level = "allow", priority = 2 } # stylistic
borrowed-box = { level = "allow", priority = 2 } # Reasonable to fix this one
complexity = { level = "warn", priority = 1 }
correctness = { level = "warn", priority = 1 }
complexity = { level = "warn", priority = 1 } # style/advisory (upstream-curated level)
correctness = { level = "deny", priority = 1 } # real-bug lints: HARD gate, never ignored (fund-critical)
default_constructed_unit_structs = { level = "allow", priority = 2 } # stylistic
derivable_impls = { level = "allow", priority = 2 } # false positives
eq_op = { level = "allow", priority = 2 } # In tests we test equality.
@@ -1703,8 +1703,9 @@ zeroize = { opt-level = 3 }
serde = { git = "https://github.com/pezkuwichain/serde.git", branch = "fix-wasm32v1-none" }
serde_core = { git = "https://github.com/pezkuwichain/serde.git", branch = "fix-wasm32v1-none" }
# arrayvec 0.7.6 fails on wasm32v1-none: E0223 Self::Target/Self::IntoIter ambiguity
# (Rust 1.87+ Receiver trait) + missing prelude in char.rs on target_os=none
arrayvec = { git = "https://git.pezkuwichain.io/pezkuwichain/arrayvec.git", branch = "main" }
# core2 0.4.0 was yanked from crates.io; wasm sub-builds resolve deps without --locked
# and fail to select a version. Mirror provides a non-yanked source for resolution.
core2 = { git = "https://git.pezkuwichain.io/pezkuwichain/core2.git", branch = "master" }
# (Rust 1.87+ Receiver trait) + missing prelude in char.rs on target_os=none.
# Vendored in-tree for a fully self-contained, reproducible build.
arrayvec = { path = "vendor/arrayvec" }
# core2 0.4.0 was yanked from crates.io; wasm sub-builds resolve deps without --locked.
# Vendored in-tree for a fully self-contained, reproducible build.
core2 = { path = "vendor/core2" }
+3 -3
View File
@@ -1,7 +1,7 @@
# Development Guide
Quick reference for building and running Pezkuwi SDK locally.
For full documentation see the [Development Guide wiki](https://gitlab.com/pezkuwichain/pezkuwi-sdk/-/wikis/Development-Guide).
For full documentation see the [Development Guide wiki](https://docs.pezkuwichain.io/).
## System Requirements
@@ -86,7 +86,7 @@ cargo doc --workspace --no-deps --open
## More
- [Architecture](https://gitlab.com/pezkuwichain/pezkuwi-sdk/-/wikis/Architecture)
- [Custom Pallets](https://gitlab.com/pezkuwichain/pezkuwi-sdk/-/wikis/Custom-Pallets)
- [Architecture](https://docs.pezkuwichain.io/)
- [Custom Pallets](https://docs.pezkuwichain.io/)
- [Contributing](./CONTRIBUTING.md)
+81 -280
View File
@@ -1,327 +1,128 @@
# Pezkuwi SDK — Sovereign Blockchain Infrastructure
<div align="center">
**Developed and maintained by Kurdistan Tech Institute**
<img src="./docs/images/pezkuwichain_logo.png" alt="PezkuwiChain" height="120" />
Pezkuwi SDK is a fully independent blockchain development framework, providing all the tools needed to build sovereign, interoperable blockchain networks for stateless nations and distributed communities.
# Pezkuwi DKS — Digital Kurdistan State
**Sovereign blockchain infrastructure · maintained by Kurdistan Tech Institute**
[![check](https://github.com/pezkuwichain/pezkuwi-DKS/actions/workflows/check.yml/badge.svg)](https://github.com/pezkuwichain/pezkuwi-DKS/actions/workflows/check.yml)
[![license](https://img.shields.io/badge/license-Apache--2.0%20%7C%20GPL--3.0-blue.svg)](#license--attribution)
[![rust](https://img.shields.io/badge/rust-1.96-orange.svg)](./rust-toolchain.toml)
[![website](https://img.shields.io/badge/web-pezkuwichain.io-018000.svg)](https://pezkuwichain.io)
[![exchange](https://img.shields.io/badge/exchange-pex.network-C8102E.svg)](https://pex.network)
<img src="./docs/images/DijitalKurdistan.png" alt="Digital Kurdistan State" width="640" />
</div>
> **DKS — Digital Kurdistan State.** This repository is the complete, self-contained blockchain
> stack of PezkuwiChain: the framework, the relay-chain and system-parachain runtimes, and the
> original FRAME pallets that encode the state's citizenship, governance, treasury, and identity.
PezkuwiChain is the sovereign blockchain of the **Digital Kurdistan State** — a digital home for
the Kurdish nation and for other stateless and distributed communities. This is a **self-contained
monorepo**: the framework, runtimes, and pallets all live here and build from source, with no
dependency on any external package registry. That independence is deliberate — the chain must
remain buildable and verifiable no matter what happens to any third-party platform.
---
## Origin
## Layout
Pezkuwi SDK originated as a fork of Polkadot SDK (stable2512). It has since been completely rebranded and restructured as an independent project under Kurdistan Tech Institute stewardship. All crate names, dependencies, and documentation have been updated to reflect this independence.
---
## Architecture
```
┌─────────────────────────────────────────────────────────────┐
│ Pezkuwi SDK Ecosystem │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────┐ ┌─────────────────────────┐ │
│ │ Bizinikiwi │ │ PezCumulus │ │
│ │ (Core Framework) │ │ (TeyrChain SDK) │ │
│ │ │ │ │ │
│ │ • Runtime Engine │ │ • Collator Framework │ │
│ │ • Consensus │ │ • XCM Integration │ │
│ │ • Networking │ │ • Relay Chain Bridge │ │
│ └─────────────────────┘ └─────────────────────────┘ │
│ │ │ │
│ └──────────┬───────────────┘ │
│ │ │
│ ┌──────────▼───────────┐ │
│ │ PezkuwiChain │ │
│ │ (Reference Impl) │ │
│ │ • TeyrChain │ │
│ │ • Zagros Runtime │ │
│ └──────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
```
---
## Crate Naming Convention
Pezkuwi SDK uses a distinct naming scheme to ensure complete independence:
| Component | Prefix | Example |
| Component | Path | Description |
| --- | --- | --- |
| Core Framework | `bizinikiwi-` | `bizinikiwi-runtime` |
| TeyrChain SDK | `pezcumulus-` | `pezcumulus-client` |
| Client Crates | `pezsc-` | `pezsc-network`, `pezsc-consensus` |
| Primitives | `pezsp-` | `pezsp-runtime`, `pezsp-core` |
| Framework | `pezframe-` | `pezframe-support`, `pezframe-system` |
| Pallets | `pezpallet-` | `pezpallet-balances`, `pezpallet-staking` |
| Staging | `pezstaging-` | `pezstaging-xcm` |
| **Bizinikiwi** | `bizinikiwi/` | Core framework (runtime engine, primitives, FRAME, client) |
| **Relay chain** | `pezkuwi/` | PezkuwiChain relay chain (`pezkuwichain-runtime`) + node |
| **PezCumulus** | `pezcumulus/` | Parachain framework + system-parachain runtimes (Asset Hub, People) |
| **Bridges** | `pezbridges/` | Cross-chain bridge primitives and pallets |
### Networks
- **PezkuwiChain** — mainnet (`pezkuwichain-runtime`, Asset Hub & People parachains)
- **Zagros** — test network (`zagros-runtime` and its system parachains)
### Original pallets
PezkuwiChain's sovereign logic — with no upstream equivalent — lives in
`pezcumulus/teyrchains/pezpallets/`: `tiki` (citizenship), `welati` (governance),
`perwerde` (education), `pez-treasury`, `pez-rewards`, `trust`, `identity-kyc`,
`presale`, `referral`, `staking-score`, `token-wrapper`, `messaging`.
---
## PezkuwiChain — Reference Implementation
## Tokens
PezkuwiChain is the flagship blockchain built on Pezkuwi SDK, designed for Kurdish digital sovereignty.
### Token Economics
**HEZ — Native Gas Token**
- Purpose: Transaction fees, staking, network security
- Model: Inflationary with staking rewards
- Distribution: 85% staking rewards, 15% treasury
**PEZ — Governance Token**
- Total Supply: 5,000,000,000 PEZ
- Model: Fixed supply with halving cycles
- Access: Citizenship-gated rewards
### Custom Pallets
| Pallet | Purpose |
| --- | --- |
| `pezpallet-presale` | Multi-round token launches with vesting |
| `pezpallet-identity-kyc` | Decentralized identity verification |
| `pezpallet-welati` | Democratic governance and voting |
| `pezpallet-perwerde` | Educational platform and certificates |
| `pezpallet-pez-treasury` | Community treasury with halving |
| `pezpallet-pez-rewards` | Trust-based staking rewards |
| `pezpallet-validator-pool` | Validator participation |
| `pezpallet-staking-score` | Reputation-based metrics |
| `pezpallet-trust` | Peer-to-peer trust system |
| `pezpallet-referral` | Referral incentives |
| `pezpallet-tiki` | NFT-based citizenship |
| `pezpallet-token-wrapper` | Asset wrapping |
### TNPoS Consensus
Trust-enhanced Nominated Proof-of-Stake combines:
- Economic Stake (HEZ)
- Social Trust metrics
- Performance scoring
<table>
<tr>
<td align="center" width="160"><img src="./docs/images/hez_token_512.png" alt="HEZ" width="110" /><br/><b>HEZ</b></td>
<td>Native gas token (relay chain) — transaction fees, staking, network security.</td>
</tr>
<tr>
<td align="center" width="160"><img src="./docs/images/pez_token_512.png" alt="PEZ" width="110" /><br/><b>PEZ</b></td>
<td>Governance token (Asset Hub) — citizenship-gated, fixed supply.</td>
</tr>
</table>
---
## TNPoS Consensus — World's First Trust-Augmented PoS
**Trust-enhanced Nominated Proof-of-Stake** combines:
- **Economic Stake**: Traditional staking (HEZ)
- **Social Trust**: Peer endorsements, citizenship level, governance participation
- **Performance Metrics**: Uptime, finality participation, historical behavior
**Key Innovations**:
- First implementation of social trust in consensus (academic contribution)
- Parliamentary NFT System: 201 non-transferable governance seats
- Sybil-resistant via citizenship verification (Tiki pallet)
- Multi-dimensional validator scoring
---
## Cross-Chain Integration (XCM v5)
```
Polkadot Asset Hub (USDT)
│
│ XCM Reserve Transfer
▼
TeyrChain (Parachain)
│
├─► Presale contributions
├─► DEX trading (future)
└─► Withdraw back to Asset Hub
```
- Full XCM v5 implementation
- Reserve-backed wUSDT bridge
- HRMP channels for system teyrchains
- Future bridges: wETH, wBTC, Ethereum, Tron, BSC
---
## Network Roadmap
| Stage | Validators | Status |
| --- | --- | --- |
| Dev Mode | 1 | ✅ |
| Local Testnet | 2 | ✅ |
| **Alfa Testnet** | 4 | ✅ |
| Beta Testnet | 8 | Q1 2026 |
| Staging | 20 | Q1 2026 |
| **Mainnet** | 100 | Q2 2026 |
---
## Multi-Nation Platform Vision
PezkuwiChain is designed to host **multiple digital nations** simultaneously:
| Nation Type | Example | Target Population |
| --- | --- | --- |
| **Ethnic** | Kurdish (PEZ) | 40M+ globally |
| **Ethnic** | Catalan | 10M+ |
| **Ethnic** | Tibetan | 6M+ diaspora |
| **Ethnic** | Uyghur | 12M+ |
| **Ethnic** | Basque | 3M+ |
| **Cultural** | Armenian diaspora | 8M+ |
| **Cultural** | Romani | 10M+ worldwide |
| **Indigenous** | Various tribes | Land rights, heritage |
**Shared Infrastructure**: All nations use HEZ for transactions
**Nation-Specific Tokens**: Each group issues citizenship-gated tokens (PEZ model)
**Interoperable Governance**: Cross-nation commerce, diplomacy on single blockchain
---
## Use Cases
1. **Digital Governance** — Parliamentary NFTs, on-chain voting, treasury management
2. **Token Launches** — Compliant multi-round presales with vesting
3. **Education** — Blockchain-verified certificates (Perwerde)
4. **Identity** — Self-sovereign KYC and citizenship verification
5. **Cross-Chain Finance** — wUSDT bridge, DeFi primitives
6. **Cultural Preservation** — Language, heritage, oral tradition on-chain
7. **Remittance** — Low-cost diaspora→homeland transfers ($20B+ Kurdish annual flows)
---
## Quick Start
## Building
```bash
# Clone repository
git clone https://git.pezkuwichain.io/pezkuwichain/pezkuwi-sdk.git
cd pezkuwi-sdk
# Check a runtime
cargo check -p pezkuwichain-runtime
# Build release
# Build all runtime WASM (release)
cargo build --release
# Build with benchmarks
# Build with benchmarks / try-runtime
cargo build --release --features runtime-benchmarks
# Run local testnet
./target/release/pezkuwi-node --dev
```
The pinned toolchain is declared in [`rust-toolchain.toml`](./rust-toolchain.toml). Builds are
reproducible from a tagged commit together with the committed `Cargo.lock`.
---
## Links
## Ecosystem
<table>
<tr>
<td align="center"><img src="./docs/images/marquee-promo.png" alt="Pezkuwi Extension" width="320" /><br/><b>Pezkuwi Extension</b><br/>Accounts &amp; transaction signing</td>
<td align="center"><img src="./docs/images/pezkuwi-wallet.png" alt="Pezkuwi Wallet" width="180" /><br/><b>Pezkuwi Wallet</b><br/>Mobile wallet for the network</td>
</tr>
</table>
| Resource | URL |
| --- | --- |
| Website | [pezkuwichain.io](https://pezkuwichain.io) |
| Exchange (PEX) | [pex.network](https://pex.network) |
| App | [app.pezkuwichain.io](https://app.pezkuwichain.io) |
| Explorer | [explorer.pezkuwichain.io](https://explorer.pezkuwichain.io) |
| Documentation | [docs.pezkuwichain.io](https://docs.pezkuwichain.io) |
| RPC Endpoint | `wss://rpc.pezkuwichain.io` |
## Community
| Platform | Link |
| --- | --- |
| Telegram | [@pezkuwichain](https://t.me/pezkuwichain) |
| Discord | [discord.gg/pezkuwichain](https://discord.gg/pezkuwichain) |
| Twitter | [@pezkuwichain](https://twitter.com/pezkuwichain) |
| Gitea | [git.pezkuwichain.io/pezkuwichain](https://git.pezkuwichain.io/pezkuwichain) |
| Medium | [@pezkuwichain](https://medium.com/@pezkuwichain) |
| Facebook | [PezkuwiChain](https://www.facebook.com/profile.php?id=61582484611719) |
---
<div align="center">
## License & Attribution
![SDK Logo](./docs/images/Pezkuwi_Logo_Horizontal_Pink_White.png#gh-dark-mode-only)
![SDK Logo](./docs/images/Pezkuwi_Logo_Horizontal_Pink_Black.png#gh-light-mode-only)
The code in this repository is a derivative work based on
[Polkadot SDK](https://github.com/paritytech/polkadot-sdk) (snapshot `stable2512`) by
[Parity Technologies (UK) Ltd.](https://www.parity.io), used under **Apache-2.0** and **GPL-3.0**.
# Pezkuwi SDK
[![GitLab stars](https://img.shields.io/gitlab/stars/pezkuwichain%2Fpezkuwi-sdk?gitlab_url=https%3A%2F%2Fgitlab.com&logo=gitlab)](https://gitlab.com/pezkuwichain/pezkuwi-sdk)&nbsp;&nbsp;[![GitLab forks](https://img.shields.io/gitlab/forks/pezkuwichain%2Fpezkuwi-sdk?gitlab_url=https%3A%2F%2Fgitlab.com&logo=gitlab)](https://gitlab.com/pezkuwichain/pezkuwi-sdk)
<!-- markdownlint-disable-next-line MD013 -->
[![StackExchange](https://img.shields.io/badge/StackExchange-Community%20&%20Support-222222?logo=stackexchange)](https://pezkuwichain.io/community)&nbsp;&nbsp;[![GitLab contributors](https://img.shields.io/gitlab/contributors/pezkuwichain%2Fpezkuwi-sdk?gitlab_url=https%3A%2F%2Fgitlab.com)](https://gitlab.com/pezkuwichain/pezkuwi-sdk/-/graphs/main)&nbsp;&nbsp;[![GitLab last commit](https://img.shields.io/gitlab/last-commit/pezkuwichain%2Fpezkuwi-sdk?gitlab_url=https%3A%2F%2Fgitlab.com)](https://gitlab.com/pezkuwichain/pezkuwi-sdk/-/commits/main)
> The Pezkuwi SDK repository provides all the components needed to start building on the
> [PezkuwiChain](https://pezkuwichain.io/) network, a multi-chain blockchain platform that enables
> different blockchains to interoperate and share information in a secure and scalable way.
</div>
## Quickstart
If you want to get an example node running quickly you can execute the following getting started script:
```bash
curl --proto '=https' --tlsv1.2 -sSf https://gitlab.com/pezkuwichain/pezkuwi-sdk/-/raw/main/scripts/getting-started.sh | bash
```
## Building
In order to build this project you need to install some dependencies, follow the instructions in [this guide](https://docs.pezkuwichain.io/develop/teyrchains/install-pezkuwi-sdk).
## Documentation
- [Pezkuwi Documentation Portal](https://docs.pezkuwichain.io)
- [rust-docs](https://pezkuwichain.gitlab.io/pezkuwi-sdk/pezkuwi_sdk_docs/index.html): Where we keep track of the API docs of our Rust crates. Includes:
- [Introduction](https://pezkuwichain.gitlab.io/pezkuwi-sdk/pezkuwi_sdk_docs/pezkuwi_sdk/index.html) to each component of the Pezkuwi SDK: Bizinikiwi, FRAME, PezCumulus, and XCM
- [Guides](https://pezkuwichain.gitlab.io/pezkuwi-sdk/pezkuwi_sdk_docs/guides/index.html), namely how to build your first FRAME pallet
- [Templates](https://pezkuwichain.gitlab.io/pezkuwi-sdk/pezkuwi_sdk_docs/pezkuwi_sdk/templates/index.html) for starting a new project.
- [External Resources](https://pezkuwichain.gitlab.io/pezkuwi-sdk/pezkuwi_sdk_docs/external_resources/index.html)
- Have a question? You can ask in the Pezkuwi SDK Developers Chat.
- [Telegram](https://t.me/DKSPezkuwiChain)
- [Matrix](https://matrix.to/#/#pezkuwidevs:matrix.org)
- [Discord](https://discord.gg/Y3VyEC6h8W)
- [Pezkuwi StackExchange](https://pezkuwichain.io/forum)
## Releases
<!-- markdownlint-disable-next-line MD013 -->
The Pezkuwi SDK is released every three months as a `Pezkuwi stableYYMM` release. Each stable release is supported for one year with patches. See the release history in [CHANGELOG.md](./CHANGELOG.md) and release documentation in [RELEASE.md](./docs/RELEASE.md).
You can use [`psvm`](https://git.pezkuwichain.io/pezkuwichain/psvm) to update all dependencies to a specific version without needing to manually select the correct version for each crate.
## Tooling
[Pezkuwi SDK Version Manager](https://git.pezkuwichain.io/pezkuwichain/psvm): A simple tool to manage and update the Pezkuwi SDK dependencies in any Cargo.toml file. It will automatically update the Pezkuwi SDK dependencies to their correct crates.io version.
## Security
The security policy and procedures can be found in [docs/contributor/SECURITY.md](./docs/contributor/SECURITY.md).
## Contributing & Code of Conduct
Ensure you follow our [contribution guidelines](./docs/contributor/CONTRIBUTING.md). In every interaction and contribution, this project adheres to the [Contributor Covenant Code of Conduct](./docs/contributor/CODE_OF_CONDUCT.md).
### Ready to Contribute?
Take a look at the issues labeled with [`mentor`](https://gitlab.com/pezkuwichain/pezkuwi-sdk/-/issues?label_name=C1-mentor) to get started! We always recognize valuable contributions by proposing an on-chain tip to the PezkuwiChain network as a token of our appreciation.
## Pezkuwi Fellowship
Development in this repo usually goes hand in hand with the `fellowship` organization. In short, this repository provides all the SDK pieces needed to build both PezkuwiChain and its teyrchains. But, the actual PezkuwiChain runtime lives in the `fellowship/runtimes` repository. Read more about the fellowship, this separation, and the RFC process in the [Pezkuwi Fellows repository](https://git.pezkuwichain.io/pezkuwichain/pezkuwi-fellows).
## History
This repository is the amalgamation of 3 separate repositories that used to make up Pezkuwi SDK, namely Bizinikiwi, Pezkuwi and PezCumulus. Read more about the SDK in the [Pezkuwi SDK Documentation](https://docs.pezkuwichain.io/pezkuwi_sdk_docs/index.html).
---
## License
Pezkuwi SDK is a derivative work based on [Polkadot SDK](https://github.com/paritytech/polkadot-sdk)
by [Parity Technologies (UK) Ltd.](https://www.parity.io), used under Apache-2.0 and GPL-3.0-only.
Individual crates in this repository are licensed under one of:
Individual crates are licensed under one of:
- **Apache License, Version 2.0** — see [LICENSE-APACHE](./LICENSE-APACHE)
- **GNU General Public License v3 or later WITH Classpath-exception-2.0** — see [LICENSE-GPL3](./LICENSE-GPL3)
- **MIT No Attribution (MIT-0)** — see [LICENSE-MIT0](./LICENSE-MIT0)
- **The Unlicense** — see [LICENSE-UNLICENSE](./LICENSE-UNLICENSE)
See each crate's `Cargo.toml` `license` field and each source file's `SPDX-License-Identifier` header for the applicable license.
See each crate's `Cargo.toml` `license` field and each source file's `SPDX-License-Identifier`
header. Full attribution and the list of significant changes are in [NOTICE](./NOTICE).
For full attribution, significant changes, and third-party component notices, see [NOTICE](./NOTICE).
Brand heritage and visual identity: [`docs/BRAND_HERITAGE.md`](./docs/BRAND_HERITAGE.md),
[`docs/VISUAL_IDENTITY.md`](./docs/VISUAL_IDENTITY.md).
---
<div align="center">
**Kurdistan Tech Institute**
*Building sovereign infrastructure for stateless nations*
**Kurdistan Tech Institute** · *Sovereign infrastructure for stateless nations*
</div>
+11 -30
View File
@@ -1,39 +1,20 @@
# Security Policy
## Supported Versions
| Version | Supported |
|---------|-----------|
| latest (mainnet) | ✅ |
| older releases | ❌ |
## Reporting a Vulnerability
**Do NOT open a public issue for security vulnerabilities.**
If you discover a security vulnerability in a PezkuwiChain runtime or pallet,
please report it **privately**. Do not open a public issue.
Please report security vulnerabilities by emailing:
- Email: security@pezkuwichain.io
- Encrypted reports welcome (PGP key on request).
📧 **security@pezkuwichain.io**
Please include a description, affected crate(s)/runtime(s), and reproduction steps
where possible. We aim to acknowledge reports within 72 hours.
Include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (optional)
## Scope
We will acknowledge receipt within **48 hours** and provide a detailed response within **7 days**.
## Disclosure Policy
We follow [coordinated disclosure](https://en.wikipedia.org/wiki/Coordinated_vulnerability_disclosure).
Once a fix is ready, we will:
1. Notify the reporter
2. Release a patched version
3. Publish a security advisory
## Bug Bounty
There is currently no formal bug bounty program.
Significant vulnerability reporters will be acknowledged in release notes.
This repository contains on-chain runtimes and FRAME pallets. Consensus, networking
and client-level issues belong to the framework project and the node release.
Bridge functionality (where present) handles cross-chain value; proof-verification,
message-replay and weight-accounting issues are treated as highest severity.
@@ -1,23 +1,12 @@
{
"name": "Custom",
"id": "custom",
"chainType": "Live",
"bootNodes": [],
"telemetryEndpoints": null,
"protocolId": null,
"properties": {
"tokenDecimals": 12,
"tokenSymbol": "UNIT"
},
"relay_chain": "pezkuwichain-local",
"custom_field": "custom_value",
"chainType": "Live",
"codeSubstitutes": {},
"custom_field": "custom_value",
"genesis": {
"raw": {
"childrenDefault": {},
"top": {
"0x00771836bebdd29870ff246d305c578c4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x00771836bebdd29870ff246d305c578c5e0621c4869aa60c02be9adcc98a0d1d": "0x00",
"0x1cb6f36e027abb2091cfb5110ab5087f4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x1cb6f36e027abb2091cfb5110ab5087f66e8f035c8adbe7f1547b43c51e6f8a4": "0x00000000",
"0x1cb6f36e027abb2091cfb5110ab5087fdc6b171b77304263c292cc3ea5ed31ef": "0x0100000000000000040000000000000002",
@@ -30,8 +19,20 @@
"0x3a636f6465": "0x010203",
"0x3a65787472696e7369635f696e646578": "0x00000000",
"0xc2261276cc9d1f8598ea4b6a74b15c2f4e7b9012096b41c4eb3aaf947f6ea429": "0x0100",
"0xc2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80": "0x0000000000000000"
"0xc2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80": "0x0000000000000000",
"0xd5e1a2fa16732ce6906189438c0a82c64e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0xd98085a84eac4903081fb752c3d8ecde4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0xd98085a84eac4903081fb752c3d8ecde5e0621c4869aa60c02be9adcc98a0d1d": "0x00"
}
}
}
},
"id": "custom",
"name": "Custom",
"properties": {
"tokenDecimals": 12,
"tokenSymbol": "UNIT"
},
"protocolId": null,
"relay_chain": "pezkuwichain-local",
"telemetryEndpoints": null
}
@@ -13,8 +13,8 @@
"genesis": {
"raw": {
"top": {
"0x00771836bebdd29870ff246d305c578c4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x00771836bebdd29870ff246d305c578c5e0621c4869aa60c02be9adcc98a0d1d": "0x0cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c186e1bafbb1430668c95d89b77217a402a74f64c3e103137b69e95e4b6e06b1e",
"0xd98085a84eac4903081fb752c3d8ecde4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0xd98085a84eac4903081fb752c3d8ecde5e0621c4869aa60c02be9adcc98a0d1d": "0x0cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c186e1bafbb1430668c95d89b77217a402a74f64c3e103137b69e95e4b6e06b1e",
"0x1cb6f36e027abb2091cfb5110ab5087f4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x1cb6f36e027abb2091cfb5110ab5087f66e8f035c8adbe7f1547b43c51e6f8a4": "0x00000000",
"0x1cb6f36e027abb2091cfb5110ab5087fdc6b171b77304263c292cc3ea5ed31ef": "0x0100000000000000040000000000000002",
@@ -13,8 +13,8 @@
"genesis": {
"raw": {
"top": {
"0x00771836bebdd29870ff246d305c578c4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x00771836bebdd29870ff246d305c578c5e0621c4869aa60c02be9adcc98a0d1d": "0x0cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c186e1bafbb1430668c95d89b77217a402a74f64c3e103137b69e95e4b6e06b1e",
"0xd98085a84eac4903081fb752c3d8ecde4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0xd98085a84eac4903081fb752c3d8ecde5e0621c4869aa60c02be9adcc98a0d1d": "0x0cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c186e1bafbb1430668c95d89b77217a402a74f64c3e103137b69e95e4b6e06b1e",
"0x1cb6f36e027abb2091cfb5110ab5087f4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x1cb6f36e027abb2091cfb5110ab5087f5e0621c4869aa60c02be9adcc98a0d1d": "0x0cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01000000000000001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c0100000000000000186e1bafbb1430668c95d89b77217a402a74f64c3e103137b69e95e4b6e06b1e0100000000000000",
"0x1cb6f36e027abb2091cfb5110ab5087f66e8f035c8adbe7f1547b43c51e6f8a4": "0x00000000",
@@ -13,8 +13,8 @@
"genesis": {
"raw": {
"top": {
"0x00771836bebdd29870ff246d305c578c4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x00771836bebdd29870ff246d305c578c5e0621c4869aa60c02be9adcc98a0d1d": "0x0cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c186e1bafbb1430668c95d89b77217a402a74f64c3e103137b69e95e4b6e06b1e",
"0xd98085a84eac4903081fb752c3d8ecde4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0xd98085a84eac4903081fb752c3d8ecde5e0621c4869aa60c02be9adcc98a0d1d": "0x0cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c186e1bafbb1430668c95d89b77217a402a74f64c3e103137b69e95e4b6e06b1e",
"0x1cb6f36e027abb2091cfb5110ab5087f4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x1cb6f36e027abb2091cfb5110ab5087f66e8f035c8adbe7f1547b43c51e6f8a4": "0x00000000",
"0x1cb6f36e027abb2091cfb5110ab5087fdc6b171b77304263c292cc3ea5ed31ef": "0x0100000000000000040000000000000002",
@@ -13,8 +13,8 @@
"genesis": {
"raw": {
"top": {
"0x00771836bebdd29870ff246d305c578c4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x00771836bebdd29870ff246d305c578c5e0621c4869aa60c02be9adcc98a0d1d": "0x0cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c186e1bafbb1430668c95d89b77217a402a74f64c3e103137b69e95e4b6e06b1e",
"0xd98085a84eac4903081fb752c3d8ecde4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0xd98085a84eac4903081fb752c3d8ecde5e0621c4869aa60c02be9adcc98a0d1d": "0x0cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c186e1bafbb1430668c95d89b77217a402a74f64c3e103137b69e95e4b6e06b1e",
"0x1cb6f36e027abb2091cfb5110ab5087f4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x1cb6f36e027abb2091cfb5110ab5087f66e8f035c8adbe7f1547b43c51e6f8a4": "0x00000000",
"0x1cb6f36e027abb2091cfb5110ab5087fdc6b171b77304263c292cc3ea5ed31ef": "0x0100000000000000040000000000000002",
@@ -14,7 +14,7 @@
"codeSubstitutes": {},
"genesis": {
"runtimeGenesis": {
"code": "0x0061736d0100000001b4033b60017f0060017f017f60037f7f7f017f60027f7f017f60027f7f0060037f7f7f0060047f7f7f7f0060057f7f7f7f7f0060000060047f7f7f7f017f60067f7f7f7f7f7f0060087f7f7f7f7f7f7f7f006000017f60047f7e7e7e0060027e7e0060017e0060027e7e017e60017e017e60037e7e7f017e60017f017e60017e017f60027f7e017f60037f7f7e017e60037f7e7f017f60037f7e7e0060047e7e7e7f017e60037e7e7e0060027e7f017f60047f7f7e7e0060037e7f7f0060047e7e7f7f017f60067f7f7f7f7f7f017f60057f7f7f7f7f017f600f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f017f60077f7f7f7f7f7f7f0060047f7c7f7f017f60037f7c7f017f60037e7f7f017f60077f7f7f7f7f7f7f017f60097f7f7f7f7f7f7e7e7e0060067f7f7f7e7e7f0060097f7f7f7e7e7f7f7f7f0060027e7f0060027c7f017f60067f7f7e7e7f7f0060027f7e00600a7f7f7f7f7f7f7f7f7f7f006000017e60067f7f7e7f7f7f0060057f7f7f7e7f0060047f7f7f7e0060027f7f017e60057f7f7e7f7f0060037f7f7e0060027f7e017e600b7f7f7f7f7f7f7f7f7f7f7f0060037f7f7c0060057f7e7e7e7e0060047f7e7e7f0002800d2a03656e76066d656d6f727902001203656e761c6578745f73746f726167655f617070656e645f76657273696f6e5f31000e03656e761b6578745f73746f726167655f636c6561725f76657273696f6e5f31000f03656e76226578745f73746f726167655f636c6561725f7072656669785f76657273696f6e5f32001003656e76286578745f73746f726167655f636f6d6d69745f7472616e73616374696f6e5f76657273696f6e5f31000803656e76196578745f73746f726167655f6765745f76657273696f6e5f31001103656e761e6578745f73746f726167655f6e6578745f6b65795f76657273696f6e5f31001103656e761a6578745f73746f726167655f726561645f76657273696f6e5f31001203656e762a6578745f73746f726167655f726f6c6c6261636b5f7472616e73616374696f6e5f76657273696f6e5f31000803656e761a6578745f73746f726167655f726f6f745f76657273696f6e5f32001303656e76196578745f73746f726167655f7365745f76657273696f6e5f31000e03656e76276578745f73746f726167655f73746172745f7472616e73616374696f6e5f76657273696f6e5f31000803656e76206578745f68617368696e675f626c616b65325f3132385f76657273696f6e5f31001403656e76206578745f68617368696e675f626c616b65325f3235365f76657273696f6e5f31001403656e761e6578745f68617368696e675f74776f785f3132385f76657273696f6e5f31001403656e761d6578745f68617368696e675f74776f785f36345f76657273696f6e5f31001403656e76226578745f6f6666636861696e5f696e6465785f636c6561725f76657273696f6e5f31000f03656e76206578745f6f6666636861696e5f696e6465785f7365745f76657273696f6e5f31000e03656e76236578745f63727970746f5f65636473615f67656e65726174655f76657273696f6e5f31001503656e76266578745f63727970746f5f65636473615f7075626c69635f6b6579735f76657273696f6e5f31001303656e761f6578745f63727970746f5f65636473615f7369676e5f76657273696f6e5f31001603656e76216578745f63727970746f5f65636473615f7665726966795f76657273696f6e5f32001703656e76256578745f63727970746f5f656432353531395f67656e65726174655f76657273696f6e5f31001503656e76286578745f63727970746f5f656432353531395f7075626c69635f6b6579735f76657273696f6e5f31001303656e76216578745f63727970746f5f656432353531395f7369676e5f76657273696f6e5f31001603656e76236578745f63727970746f5f656432353531395f7665726966795f76657273696f6e5f31001703656e76256578745f63727970746f5f737232353531395f67656e65726174655f76657273696f6e5f31001503656e76286578745f63727970746f5f737232353531395f7075626c69635f6b6579735f76657273696f6e5f31001303656e76216578745f63727970746f5f737232353531395f7369676e5f76657273696f6e5f31001603656e76236578745f63727970746f5f737232353531395f7665726966795f76657273696f6e5f32001703656e76296578745f6f6666636861696e5f7375626d69745f7472616e73616374696f6e5f76657273696f6e5f31001103656e76256578745f7472616e73616374696f6e5f696e6465785f696e6465785f76657273696f6e5f31000503656e76196578745f6c6f6767696e675f6c6f675f76657273696f6e5f31001803656e761f6578745f6c6f6767696e675f6d61785f6c6576656c5f76657273696f6e5f31000c03656e761c6578745f616c6c6f6361746f725f667265655f76657273696f6e5f31000003656e761e6578745f616c6c6f6361746f725f6d616c6c6f635f76657273696f6e5f31000103656e76286578745f64656661756c745f6368696c645f73746f726167655f726561645f76657273696f6e5f31001903656e76276578745f64656661756c745f6368696c645f73746f726167655f7365745f76657273696f6e5f31001a03656e762a6578745f747269655f626c616b65325f3235365f6f7264657265645f726f6f745f76657273696f6e5f32001b03656e761c6578745f6d6973635f7072696e745f6865785f76657273696f6e5f31000f03656e761d6578745f6d6973635f7072696e745f757466385f76657273696f6e5f31000f03656e76226578745f6d6973635f72756e74696d655f76657273696f6e5f76657273696f6e5f31001103e40de20d0403000203080506040400000303040402031c0a00030406060105060a060605060605010606010508061d1e0300050302031f20020302210302030303030304030302222323240303070100000405050507220503250303030300030303000007020320020203030607030505050707260103030607270005050405040505050404040405040505040404040304040500040404040404040406050504040404000004040428050404040404040404010505040504000029050505010404040400060406040404050505050000000003030c00070004040404000000040400030100010004040400000000060404050505060604000304000703000604050707060404000000030605040205030004040506002a2b2c07040404040404040404060405050504040407060000000703220303031c03050500000000000000030007040303030300030303030203020000030303020c03030301010203020c06040005040304010604050300030203030304000006Line truncated
"code": "0x0061736d01000000019d033960017f0060017f017f60027f7f0060037f7f7f017f60037f7f7f0060047f7f7f7f0060027f7f017f60000060057f7f7f7f7f0060067f7f7f7f7f7f006000017f60027f7f017e60047f7f7f7f017f60077f7f7f7f7f7f7f0060027f7e0060057f7f7f7f7f017f60087f7f7f7f7f7f7f7f0060017e0060017e017e60017e017f60057f7f7f7e7f0060027e7e0060027f7e017f60017f017e6000017e60037f7f7e017e60037f7e7f017f60047f7e7f7f0060047f7e7e7e00600a7f7f7f7f7f7f7f7f7f7f0060037f7f7e0060047f7f7e7e0060057f7e7e7e7e0060027e7f017f60067f7f7e7f7f7f0060037f7f7f017e60047f7c7f7f017f60047f7e7e7f0060037e7e7e0060047e7e7e7f017e60037f7e7e0060027e7e017e60037e7e7f017e60037f7f7e017f600b7f7f7f7f7f7f7f7f7f7f7f0060057f7f7e7f7f0060027f7e017e60047f7f7f7e0060097f7f7f7f7e7e7f7f7f0060037f7c7f017f60047e7e7f7f017f60067f7f7f7f7f7f017f60077f7f7f7f7f7f7f017f60097f7f7f7f7f7f7e7e7e0060077f7f7e7e7e7e7e017e60037f7f7c0060027c7f017f02800d2a03656e76206578745f6f6666636861696e5f696e6465785f7365745f76657273696f6e5f31001503656e76226578745f6f6666636861696e5f696e6465785f636c6561725f76657273696f6e5f31001103656e76276578745f64656661756c745f6368696c645f73746f726167655f7365745f76657273696f6e5f31002603656e76286578745f64656661756c745f6368696c645f73746f726167655f726561645f76657273696f6e5f31002703656e761d6578745f6d6973635f7072696e745f757466385f76657273696f6e5f31001103656e76226578745f6d6973635f72756e74696d655f76657273696f6e5f76657273696f6e5f31001203656e761c6578745f6d6973635f7072696e745f6865785f76657273696f6e5f31001103656e76206578745f68617368696e675f626c616b65325f3132385f76657273696f6e5f31001303656e76206578745f68617368696e675f626c616b65325f3235365f76657273696f6e5f31001303656e761d6578745f68617368696e675f74776f785f36345f76657273696f6e5f31001303656e761e6578745f68617368696e675f74776f785f3132385f76657273696f6e5f31001303656e76256578745f7472616e73616374696f6e5f696e6465785f696e6465785f76657273696f6e5f31000403656e76196578745f6c6f6767696e675f6c6f675f76657273696f6e5f31002803656e761f6578745f6c6f6767696e675f6d61785f6c6576656c5f76657273696f6e5f31000a03656e76296578745f6f6666636861696e5f7375626d69745f7472616e73616374696f6e5f76657273696f6e5f31001203656e761c6578745f616c6c6f6361746f725f667265655f76657273696f6e5f31000003656e761e6578745f616c6c6f6361746f725f6d616c6c6f635f76657273696f6e5f31000103656e762a6578745f747269655f626c616b65325f3235365f6f7264657265645f726f6f745f76657273696f6e5f32002103656e761f6578745f63727970746f5f65636473615f7369676e5f76657273696f6e5f31001903656e76216578745f63727970746f5f65636473615f7665726966795f76657273696f6e5f32001a03656e76216578745f63727970746f5f656432353531395f7369676e5f76657273696f6e5f31001903656e76216578745f63727970746f5f737232353531395f7369676e5f76657273696f6e5f31001903656e76236578745f63727970746f5f65636473615f67656e65726174655f76657273696f6e5f31001603656e76236578745f63727970746f5f656432353531395f7665726966795f76657273696f6e5f31001a03656e76236578745f63727970746f5f737232353531395f7665726966795f76657273696f6e5f32001a03656e76256578745f63727970746f5f656432353531395f67656e65726174655f76657273696f6e5f31001603656e76256578745f63727970746f5f737232353531395f67656e65726174655f76657273696f6e5f31001603656e76266578745f63727970746f5f65636473615f7075626c69635f6b6579735f76657273696f6e5f31001703656e76286578745f63727970746f5f656432353531395f7075626c69635f6b6579735f76657273696f6e5f31001703656e76286578745f63727970746f5f737232353531395f7075626c69635f6b6579735f76657273696f6e5f31001703656e76226578745f73746f726167655f636c6561725f7072656669785f76657273696f6e5f32002903656e76276578745f73746f726167655f73746172745f7472616e73616374696f6e5f76657273696f6e5f31000703656e76286578745f73746f726167655f636f6d6d69745f7472616e73616374696f6e5f76657273696f6e5f31000703656e762a6578745f73746f726167655f726f6c6c6261636b5f7472616e73616374696f6e5f76657273696f6e5f31000703656e76196578745f73746f726167655f6765745f76657273696f6e5f31001203656e76196578745f73746f726167655f7365745f76657273696f6e5f31001503656e761a6578745f73746f726167655f726561645f76657273696f6e5f31002a03656e761a6578745f73746f726167655f726f6f745f76657273696f6e5f32001703656e761b6578745f73746f726167655f636c6561725f76657273696f6e5f31001103656e761c6578745f73746f726167655f617070656e645f76657273696f6e5f31001503656e761e6578745f73746f726167655f6e6578745f6b65795f76657273696f6e5f31001203656e76066d656d6f727902001503c30fc10f0200040205020002070406060306030606020401020404090d000906060f040204040405080404040404040404040404040404040404040404040405040405050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050a0202020000020000000006080504040805040404040505080805050808080408020209090205050d050d0d0d050508040808080808000009090505020202020202020202020400000000000000000000000000000000000000000000000000020202020202020200000000000000020204080606020202020200000000080202020202020202020202020204020202020202020202082b0222020008050306030202050802090f0f0f0f090909090909090604040902040405050308050805041b04041b03050311040808080805051b0808230b0b0b0b0b0b0b0b0b0b040b0b00020b0b06000b06010b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0bLine truncated
"config": {
"babe": {
"authorities": [],
@@ -36,4 +36,4 @@
}
}
}
}
}
@@ -13,8 +13,8 @@
"genesis": {
"raw": {
"top": {
"0x00771836bebdd29870ff246d305c578c4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x00771836bebdd29870ff246d305c578c5e0621c4869aa60c02be9adcc98a0d1d": "0x0cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c186e1bafbb1430668c95d89b77217a402a74f64c3e103137b69e95e4b6e06b1e",
"0xd98085a84eac4903081fb752c3d8ecde4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0xd98085a84eac4903081fb752c3d8ecde5e0621c4869aa60c02be9adcc98a0d1d": "0x0cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c186e1bafbb1430668c95d89b77217a402a74f64c3e103137b69e95e4b6e06b1e",
"0x1cb6f36e027abb2091cfb5110ab5087f4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x1cb6f36e027abb2091cfb5110ab5087f66e8f035c8adbe7f1547b43c51e6f8a4": "0x00000000",
"0x1cb6f36e027abb2091cfb5110ab5087fdc6b171b77304263c292cc3ea5ed31ef": "0x0100000000000000040000000000000002",
@@ -34,8 +34,8 @@ const OUTPUT_FILE: &str = "/tmp/chain_spec_builder.test_output_file.json";
// Get the chain-spec-builder binary path from environment
fn get_chain_spec_builder_bin() -> String {
std::env::var("CARGO_BIN_EXE_chain-spec-builder")
.expect("CARGO_BIN_EXE_chain-spec-builder must be set - run with `cargo test`")
std::env::var("CARGO_BIN_EXE_pezstaging-chain-spec-builder")
.expect("CARGO_BIN_EXE_pezstaging-chain-spec-builder must be set - run with `cargo test`")
}
// Used for running commands visually pleasing in doc tests.
@@ -10,8 +10,8 @@
"genesis": {
"raw": {
"top": {
"0x00771836bebdd29870ff246d305c578c4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x00771836bebdd29870ff246d305c578c5e0621c4869aa60c02be9adcc98a0d1d": "0x0cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4890b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22",
"0xd98085a84eac4903081fb752c3d8ecde4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0xd98085a84eac4903081fb752c3d8ecde5e0621c4869aa60c02be9adcc98a0d1d": "0x0cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4890b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22",
"0x1cb6f36e027abb2091cfb5110ab5087f4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x1cb6f36e027abb2091cfb5110ab5087f5e0621c4869aa60c02be9adcc98a0d1d": "0x0cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01000000000000008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48010000000000000090b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe220100000000000000",
"0x1cb6f36e027abb2091cfb5110ab5087f66e8f035c8adbe7f1547b43c51e6f8a4": "0x00000000",
@@ -10,8 +10,8 @@
"genesis": {
"raw": {
"top": {
"0x00771836bebdd29870ff246d305c578c4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x00771836bebdd29870ff246d305c578c5e0621c4869aa60c02be9adcc98a0d1d": "0x081cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0xd98085a84eac4903081fb752c3d8ecde4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0xd98085a84eac4903081fb752c3d8ecde5e0621c4869aa60c02be9adcc98a0d1d": "0x081cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"0x1cb6f36e027abb2091cfb5110ab5087f4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0x1cb6f36e027abb2091cfb5110ab5087f66e8f035c8adbe7f1547b43c51e6f8a4": "0x00000000",
"0x1cb6f36e027abb2091cfb5110ab5087fdc6b171b77304263c292cc3ea5ed31ef": "0x07000000000000000a0000000000000001",
+7 -3
View File
@@ -204,14 +204,18 @@ mod tests {
#[test]
fn test_score_100() {
let score = calculate_score("Pezkuwi", "5PezkuwiwHY5k9GpdTgpqs9xjuNvtv8EcwCFpEeyEf3KHim");
assert_eq!(score, 430);
// Full 7-char "Pezkuwi" match at position 1 (right after the ss58 prefix byte):
// (47 - 1) + (7 * 48) = 382. This is the best achievable score for this pattern.
assert_eq!(score, 382);
}
#[test]
fn test_score_50_2() {
// 50% for the position + 50% for the size
// Partial match: the address carries the first 4 chars of "Pezkuwi" ("Pezk") at
// position 1, so (47 - 1) + (4 * 48) = 238. (The original "5Polk…" was a Polkadot
// leftover that no longer matches the "Pezkuwi" pattern at all.)
assert_eq!(
calculate_score("Pezkuwi", "5PolkXXXXwHY5k9GpdTgpqs9xjuNvtv8EcwCFpEeyEf3KHim"),
calculate_score("Pezkuwi", "5PezkXXXXwHY5k9GpdTgpqs9xjuNvtv8EcwCFpEeyEf3KHim"),
238
);
}
+5 -2
View File
@@ -101,8 +101,11 @@ mod test {
use super::*;
const ALICE: &str = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const SIG1: &str = "0x4eb25a2285a82374888880af0024eb30c3a21ce086eae3862888d345af607f0ad6fb081312f11730932564f24a9f8ebcee2d46861413ae61307eca58db2c3e81";
const SIG2: &str = "0x026342225155056ea797118c1c8c8b3cc002aa2020c36f4217fa3c302783a572ad3dcd38c231cbaf86cadb93984d329c963ceac0685cc1ee4c1ed50fa443a68f";
// sr25519 signatures by Alice (//Alice) over the test messages under the sovereign
// `bizinikiwi` signing context. Regenerated from @pezkuwi crypto so they verify against
// our own Pair::verify (the upstream vectors were signed under the substrate context).
const SIG1: &str = "0xd212d24c63e78503cb2c76502686bfb3f0b1b5e6bf1f9a673ba881d83fec100f1fe15bd144834a408e98ff20d5e98f962a935ce9484a9783490f23051b8da98d";
const SIG2: &str = "0xac9a038bf4c0d71037a7e4b3b45423a67132b9bcce4cdb903c20b07135ce7d7d417d4acbe50d462e20facb62019bcaf1578e79890e561cb9efecbd56daf0758f";
// Verify work with `--message` argument.
#[test]
@@ -262,7 +262,10 @@ mod tests {
let request = r#"{"jsonrpc":"2.0","id":1,"method":"babe_epochAuthorship","params":[]}"#;
let (response, _) = api.raw_json_request(request, 1).await.unwrap();
let expected = r#"{"jsonrpc":"2.0","id":1,"result":{"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY":{"primary":[0],"secondary":[],"secondary_vrf":[1,2,4]}}}"#;
// Which slots are Primary vs SecondaryVRF for the authority depends on the sovereign
// b"bizinikiwi-babe-vrf" authoring-score context, so these slot lists are PezkuwiChain's,
// not upstream's ([0] / [1,2,4]).
let expected = r#"{"jsonrpc":"2.0","id":1,"result":{"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY":{"primary":[1,2],"secondary":[],"secondary_vrf":[4]}}}"#;
assert_eq!(response, expected);
}
+142 -59
View File
@@ -523,28 +523,38 @@ fn claim_epoch_slots() {
Some((PreDigest::SecondaryVRF(_), _)) => 3,
};
// With secondary mechanism we should be able to claim all slots.
let claims: Vec<_> = (0..EPOCH_DURATION)
.into_iter()
.map(|slot| claim_slot_wrap(slot, epoch.clone()))
.collect();
assert_eq!(claims, [1, 2, 2, 1, 2, 2, 2, 2, 2, 1]);
// With secondary with VRF mechanism we should be able to claim all the slots.
epoch.config.allowed_slots = AllowedSlots::PrimaryAndSecondaryVRFSlots;
let claims: Vec<_> = (0..EPOCH_DURATION)
.into_iter()
.map(|slot| claim_slot_wrap(slot, epoch.clone()))
.collect();
assert_eq!(claims, [1, 3, 3, 1, 3, 3, 3, 3, 3, 1]);
// Otherwise with only vrf-based primary slots we are able to claim a subset of the slots.
// Which slots resolve to a Primary claim depends on the VRF authoring-score context
// (PezkuwiChain's sovereign b"bizinikiwi-babe-vrf"), so the exact positions are not the
// upstream ones. Derive the primary set from PrimarySlots-only mode (only primaries are
// claimable there) and assert the secondary modes are consistent with it — this verifies
// the real invariant without pinning context-specific slot numbers.
epoch.config.allowed_slots = AllowedSlots::PrimarySlots;
let claims: Vec<_> = (0..EPOCH_DURATION)
.into_iter()
.map(|slot| claim_slot_wrap(slot, epoch.clone()))
.collect();
assert_eq!(claims, [1, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
let primary_only: Vec<_> =
(0..EPOCH_DURATION).map(|slot| claim_slot_wrap(slot, epoch.clone())).collect();
assert!(
primary_only.iter().all(|&c| c == 0 || c == 1),
"primary-only mode: each slot is either Primary or unclaimable"
);
assert!(primary_only.contains(&1), "expected at least one primary slot");
let is_primary: Vec<bool> = primary_only.iter().map(|&c| c == 1).collect();
// Secondary-plain mechanism: every slot is claimable — primaries stay Primary (1), the
// rest are SecondaryPlain (2).
epoch.config.allowed_slots = AllowedSlots::PrimaryAndSecondaryPlainSlots;
let plain: Vec<_> =
(0..EPOCH_DURATION).map(|slot| claim_slot_wrap(slot, epoch.clone())).collect();
for (i, &c) in plain.iter().enumerate() {
assert_eq!(c, if is_primary[i] { 1 } else { 2 });
}
// Secondary-VRF mechanism: every slot is claimable — primaries stay Primary (1), the rest
// are SecondaryVRF (3).
epoch.config.allowed_slots = AllowedSlots::PrimaryAndSecondaryVRFSlots;
let vrf: Vec<_> =
(0..EPOCH_DURATION).map(|slot| claim_slot_wrap(slot, epoch.clone())).collect();
for (i, &c) in vrf.iter().enumerate() {
assert_eq!(c, if is_primary[i] { 1 } else { 3 });
}
}
#[test]
@@ -567,50 +577,123 @@ fn claim_vrf_check() {
}
.into();
// We leverage the predictability of claim types given a constant randomness.
// PezkuwiChain's authoring-score VRF context (`AUTHORING_SCORE_VRF_CONTEXT`) is the
// sovereign `b"bizinikiwi-babe-vrf"`, not upstream's `b"substrate-babe-vrf"`. The score
// derived from that context decides Primary vs SecondaryVRF, so *which* slots resolve
// to each kind is specific to our context and is not upstream's hardcoded slots.
// Rather than pin brittle slot numbers, scan for one of each kind under the active
// context and assert the real invariant: the claim's VRF pre-output is deterministic,
// i.e. equal to a fresh keystore VRF sign over the same data (using the epoch index
// claim_slot signs against, which `clone_for_slot` reproduces for skipped epochs).
// This keeps the test correct regardless of the context value.
let mut saw_primary = false;
let mut saw_secondary_vrf = false;
for s in 0u64..256 {
let slot = Slot::from(s);
let Some((pre_digest, _)) = claim_slot(slot, &epoch, &keystore) else { continue };
let epoch_index = epoch.clone_for_slot(slot).epoch_index;
let data = make_vrf_sign_data(&epoch.randomness, slot, epoch_index);
let sign = keystore.sr25519_vrf_sign(AuthorityId::ID, &public, &data).unwrap().unwrap();
match &pre_digest {
PreDigest::Primary(d) => {
assert_eq!(d.vrf_signature.pre_output, sign.pre_output);
saw_primary = true;
},
PreDigest::SecondaryVRF(d) => {
assert_eq!(d.vrf_signature.pre_output, sign.pre_output);
saw_secondary_vrf = true;
},
PreDigest::SecondaryPlain(_) => {},
}
if saw_primary && saw_secondary_vrf {
break;
}
}
assert!(saw_primary, "expected at least one Primary claim within slots 0..256");
assert!(saw_secondary_vrf, "expected at least one SecondaryVRF claim within slots 0..256");
// We expect a Primary claim for slot 0
let pre_digest = match claim_slot(0.into(), &epoch, &keystore).unwrap().0 {
PreDigest::Primary(d) => d,
v => panic!("Unexpected pre-digest variant {:?}", v),
};
let data = make_vrf_sign_data(&epoch.randomness.clone(), 0.into(), epoch.epoch_index);
let sign = keystore.sr25519_vrf_sign(AuthorityId::ID, &public, &data).unwrap().unwrap();
assert_eq!(pre_digest.vrf_signature.pre_output, sign.pre_output);
// We expect a SecondaryVRF claim for slot 1
let pre_digest = match claim_slot(1.into(), &epoch, &keystore).unwrap().0 {
PreDigest::SecondaryVRF(d) => d,
v => panic!("Unexpected pre-digest variant {:?}", v),
};
let data = make_vrf_sign_data(&epoch.randomness.clone(), 1.into(), epoch.epoch_index);
let sign = keystore.sr25519_vrf_sign(AuthorityId::ID, &public, &data).unwrap().unwrap();
assert_eq!(pre_digest.vrf_signature.pre_output, sign.pre_output);
// Check that correct epoch index has been used if epochs are skipped (primary VRF)
// Epoch-index recomputation when epochs are skipped: a far-future slot must author
// against the recomputed epoch index (11), independent of the claim kind, and the VRF
// pre-output must still be deterministic against a sign using that fixed epoch index.
let slot = Slot::from(103);
let claim = match claim_slot(slot, &epoch, &keystore).unwrap().0 {
PreDigest::Primary(d) => d,
v => panic!("Unexpected claim variant {:?}", v),
};
let (pre_digest, _) = claim_slot(slot, &epoch, &keystore).expect("slot must be claimable");
let fixed_epoch = epoch.clone_for_slot(slot);
let data = make_vrf_sign_data(&epoch.randomness.clone(), slot, fixed_epoch.epoch_index);
let sign = keystore.sr25519_vrf_sign(AuthorityId::ID, &public, &data).unwrap().unwrap();
assert_eq!(fixed_epoch.epoch_index, 11);
assert_eq!(claim.vrf_signature.pre_output, sign.pre_output);
let data = make_vrf_sign_data(&epoch.randomness, slot, fixed_epoch.epoch_index);
let sign = keystore.sr25519_vrf_sign(AuthorityId::ID, &public, &data).unwrap().unwrap();
match &pre_digest {
PreDigest::Primary(d) => assert_eq!(d.vrf_signature.pre_output, sign.pre_output),
PreDigest::SecondaryVRF(d) => assert_eq!(d.vrf_signature.pre_output, sign.pre_output),
PreDigest::SecondaryPlain(_) => panic!("expected a VRF-based claim for slot 103"),
}
}
// Check that correct epoch index has been used if epochs are skipped (secondary VRF)
let slot = Slot::from(100);
let pre_digest = match claim_slot(slot, &epoch, &keystore).unwrap().0 {
PreDigest::SecondaryVRF(d) => d,
v => panic!("Unexpected claim variant {:?}", v),
#[test]
fn live_babe_vrf_context_matches_chain() {
// Empirical proof that our node's BABE VRF authoring-score context matches the live
// PezkuwiChain mainnet (consensus safety, not just an internal assumption).
//
// Relay block #1679722 is a BABE *Primary* block (authority #9, slot 297073892). A
// block is Primary iff its authoring score — `make_bytes` over the
// `AUTHORING_SCORE_VRF_CONTEXT` applied to the on-chain VRF pre-output — is below the
// primary threshold. We recompute that score for the on-chain pre-output under both our
// sovereign `b"bizinikiwi-babe-vrf"` and upstream's `b"substrate-babe-vrf"`. Since the
// live network already accepted the block as Primary, the context the live node uses
// MUST yield a score below the threshold — so this asserts our context is the match.
// All inputs are captured from chain state at that block (no network access here).
use codec::Decode;
use pezsp_core::sr25519::{vrf::VrfPreOutput, Public};
let pubkey: [u8; 32] = [
0x24, 0x1f, 0xa3, 0xbe, 0x1b, 0x57, 0xd3, 0xbe, 0x4f, 0xf6, 0xfc, 0x78, 0x08, 0xfa, 0xb4,
0x4d, 0x8d, 0xf9, 0x38, 0x56, 0x69, 0x9b, 0xcf, 0xe9, 0xd5, 0x76, 0x8c, 0x21, 0x90, 0x03,
0xc7, 0x0a,
];
let pre_output_bytes: [u8; 32] = [
0x44, 0xd5, 0x20, 0xc4, 0x00, 0x9f, 0x59, 0x1e, 0x47, 0x9f, 0x99, 0xab, 0x47, 0xe8, 0xf4,
0x15, 0xd9, 0x5e, 0x4b, 0xb6, 0x4d, 0x3e, 0x79, 0x63, 0x07, 0xf9, 0x50, 0xe2, 0x53, 0x9a,
0xee, 0x30,
];
let randomness: pezsp_consensus_babe::Randomness = [
0xd7, 0x75, 0x52, 0x68, 0x65, 0x64, 0xe0, 0xa0, 0xfa, 0x24, 0x90, 0xf7, 0x52, 0x1b, 0x68,
0xd5, 0x1a, 0x78, 0x17, 0x74, 0xc9, 0x26, 0xd1, 0xc4, 0xc9, 0x7b, 0xf7, 0x63, 0xa8, 0x11,
0xa9, 0x5b,
];
let slot = Slot::from(297073892u64);
let epoch_index = 3147u64;
let public = Public::from_raw(pubkey);
let pre_output = VrfPreOutput::decode(&mut &pre_output_bytes[..]).expect("valid pre-output");
let data = make_vrf_sign_data(&randomness, slot, epoch_index);
let score = |ctx: &[u8]| -> u128 {
u128::from_le_bytes(
public.make_bytes::<16>(ctx, data.as_ref(), &pre_output).expect("make_bytes"),
)
};
let fixed_epoch = epoch.clone_for_slot(slot);
let data = make_vrf_sign_data(&epoch.randomness.clone(), slot, fixed_epoch.epoch_index);
let sign = keystore.sr25519_vrf_sign(AuthorityId::ID, &public, &data).unwrap().unwrap();
assert_eq!(fixed_epoch.epoch_index, 11);
assert_eq!(pre_digest.vrf_signature.pre_output, sign.pre_output);
let score_sovereign = score(b"bizinikiwi-babe-vrf");
let score_upstream = score(b"substrate-babe-vrf");
// Threshold for this block: c = (1, 4); authority #9 has weight 1 of 21 total.
let dummy: AuthorityId = Sr25519Keyring::Alice.public().into();
let authorities: Vec<_> = (0..21).map(|_| (dummy.clone(), 1u64)).collect();
let threshold = authorship::calculate_primary_threshold((1, 4), &authorities, 9);
println!("threshold = {threshold}");
println!(
"score bizinikiwi-vrf = {score_sovereign} (< threshold: {})",
score_sovereign < threshold
);
println!(
"score substrate-vrf = {score_upstream} (< threshold: {})",
score_upstream < threshold
);
assert!(
score_sovereign < threshold,
"bizinikiwi-babe-vrf score is NOT below the threshold for a known-Primary live block \
— our node's BABE VRF context diverges from the live network!"
);
}
// Propose and import a new BABE block on top of the given parent.
@@ -505,7 +505,7 @@ fn test_rustix_version_matches_with_wasmtime() {
let our_rustix = metadata
.packages
.iter()
.find(|pkg| pkg.name == "sc-executor-wasmtime")
.find(|pkg| pkg.name == "pezsc-executor-wasmtime")
.unwrap()
.dependencies
.iter()
@@ -515,7 +515,7 @@ fn test_rustix_version_matches_with_wasmtime() {
if wasmtime_rustix.req != our_rustix.req {
panic!(
"our version of rustix ({0}) doesn't match wasmtime's ({1}); \
bump the version in `sc-executor-wasmtime`'s `Cargo.toml' to '{1}' and try again",
bump the version in `pezsc-executor-wasmtime`'s `Cargo.toml' to '{1}' and try again",
our_rustix.req, wasmtime_rustix.req,
);
}
@@ -338,7 +338,7 @@ async fn follow_with_runtime() {
let event: FollowEvent<String> = get_next_event(&mut sub).await;
// it is basically json-encoded bizinikiwi_test_runtime_client::runtime::VERSION
let runtime_str = "{\"specName\":\"test\",\"implName\":\"parity-test\",\"authoringVersion\":1,\
let runtime_str = "{\"specName\":\"test\",\"implName\":\"pezkuwi-test\",\"authoringVersion\":1,\
\"specVersion\":2,\"implVersion\":2,\"apis\":[[\"0xdf6acb689907609b\",5],\
[\"0x37e397fc7c91f5e4\",2],[\"0xd2bc9897eed08f15\",3],[\"0x40fe3ad401f8959a\",6],\
[\"0xbc9d89904f5b923f\",1],[\"0xc6e9a76309f39b09\",2],[\"0xdd718d5cc53262d4\",1],\
+21 -9
View File
@@ -471,20 +471,32 @@ async fn should_return_runtime_version() {
let (api, _child) = new_full(client.clone(), test_executor(), None);
// it is basically json-encoded bizinikiwi_test_runtime_client::runtime::VERSION
let result = "{\"specName\":\"test\",\"implName\":\"parity-test\",\"authoringVersion\":1,\
\"specVersion\":2,\"implVersion\":2,\"apis\":[[\"0xdf6acb689907609b\",5],\
[\"0x37e397fc7c91f5e4\",2],[\"0xd2bc9897eed08f15\",3],[\"0x40fe3ad401f8959a\",6],\
[\"0xbc9d89904f5b923f\",1],[\"0xc6e9a76309f39b09\",2],[\"0xdd718d5cc53262d4\",1],\
[\"0xcbca25e39f142387\",2],[\"0xf78b278be53f454c\",2],[\"0xab3c0572291feb8b\",1],\
[\"0xed99c5acb25eedf5\",3],[\"0xfbc577b9d747efd6\",1]],\"transactionVersion\":1,\"systemVersion\":1,\
let result = "{\"specName\":\"test\",\"implName\":\"pezkuwi-test\",\"authoringVersion\":1,\
\"specVersion\":2,\"implVersion\":2,\"apis\":[[\"0x40fe3ad401f8959a\",6],\
[\"0xcbca25e39f142387\",2],[\"0xdf6acb689907609b\",5],[\"0x37e397fc7c91f5e4\",2],\
[\"0xbc9d89904f5b923f\",1],[\"0xed99c5acb25eedf5\",3],[\"0xab3c0572291feb8b\",1],\
[\"0xf78b278be53f454c\",2],[\"0xc6e9a76309f39b09\",2],[\"0xfbc577b9d747efd6\",1],\
[\"0xd2bc9897eed08f15\",3],[\"0xdd718d5cc53262d4\",1]],\"transactionVersion\":1,\"systemVersion\":1,\
\"stateVersion\":1}";
let runtime_version = api.runtime_version(None.into()).unwrap();
let serialized = serde_json::to_string(&runtime_version).unwrap();
pretty_assertions::assert_eq!(serialized, result);
let deserialized: RuntimeVersion = serde_json::from_str(result).unwrap();
assert_eq!(deserialized, runtime_version);
// The order of the `apis` list in RuntimeVersion is not stable across builds, so compare
// order-independently: parse both sides as JSON, sort the `apis` arrays, then assert the
// whole thing matches. A missing/extra api still fails (the SET must match), only ordering
// is ignored.
let canonicalize = |s: &str| -> serde_json::Value {
let mut v: serde_json::Value = serde_json::from_str(s).unwrap();
if let Some(apis) = v.get_mut("apis").and_then(|a| a.as_array_mut()) {
apis.sort_by(|a, b| a.to_string().cmp(&b.to_string()));
}
v
};
pretty_assertions::assert_eq!(canonicalize(&serialized), canonicalize(result));
// The hardcoded JSON still round-trips into a RuntimeVersion.
let _deserialized: RuntimeVersion = serde_json::from_str(result).unwrap();
}
#[tokio::test]
Loaded 100 of 736 files, more files were not shown because too many files have changed in this diff. Show more