Skip to content

feat(engine)!: quadratic gas premium for large template publishing #9295

feat(engine)!: quadratic gas premium for large template publishing

feat(engine)!: quadratic gas premium for large template publishing #9295

Workflow file for this run

---
name: CI
'on':
workflow_dispatch:
push:
branches:
- development
- main
- ci-*
pull_request:
types:
- opened
- reopened
- synchronize
merge_group:
concurrency:
# https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') || github.ref != 'refs/heads/development' }}
env:
nightly_toolchain: nightly-2025-12-05
stable_toolchain: stable
CARGO_HTTP_MULTIPLEXING: false
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
TARI_TARGET_NETWORK: localnet
TARI_NETWORK: localnet
# https://github.com/rust-lang/rustup/issues/2949#issuecomment-2584968659
RUSTUP_PERMIT_COPY_RENAME: true
PROTOC: protoc
TERM: unknown
jobs:
fmt:
name: fmt
runs-on: [ ubuntu-latest ]
steps:
- name: checkout
uses: actions/checkout@v7.0.0
- name: toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: ${{ env.nightly_toolchain }}
components: rustfmt
- name: cargo format
run: cargo +${{ env.nightly_toolchain }} fmt --all -- --check
prettier:
name: prettier
runs-on: [ ubuntu-latest ]
steps:
- name: checkout
uses: actions/checkout@v7.0.0
- name: install
run: |
npm install -g prettier@3.2.4
- name: prettier
run: |
prettier --check "./applications/{tari_validator_node/web_ui,tari_indexer/web_ui,tari_ootle_walletd/web_ui}/src/*.{ts,tsx,json}"
web_ui_build:
name: web ui build
runs-on: [ ubuntu-latest ]
steps:
- name: checkout
uses: actions/checkout@v7.0.0
- name: install pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- name: setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .nvmrc
cache: 'pnpm'
- name: install workspace dependencies
run: pnpm install --frozen-lockfile
# Guard: a frozen install must not mutate tracked files. pnpm 11 appends an
# `allowBuilds:` scaffold to pnpm-workspace.yaml for any build-script dependency
# that lacks an explicit allow/deny, which silently dirties the working tree and
# made `pnpm publish` abort on release with ERR_PNPM_GIT_UNCLEAN. The release
# workflow only runs on a tag push, so this fails loudly in PR CI instead. To fix
# a failure here, declare the new dependency in pnpm-workspace.yaml (allowBuilds).
- name: assert frozen install left the tree clean
run: |
if ! git diff --exit-code; then
echo "::error::pnpm install modified tracked files (diff above) — declare new build-script deps in pnpm-workspace.yaml (allowBuilds)."
exit 1
fi
# Builds every workspace web UI (walletd, indexer, validator node, db_inspector)
# together with the bindings/clients they depend on, in topological order.
# Ignored dependency build scripts (esbuild/@swc/core/@parcel/watcher) ship
# prebuilt binaries and aren't needed to compile the UIs.
- name: build workspace web UIs
run: pnpm --recursive run build
# The swarm daemon web UI is a standalone npm project, not part of the pnpm workspace.
- name: build swarm daemon web UI
working-directory: applications/tari_swarm_daemon/webui
run: |
npm ci
npm run build
clippy:
name: clippy
runs-on: [ ubuntu-latest ]
steps:
- name: checkout
uses: actions/checkout@v7.0.0
- name: toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.stable_toolchain }}
components: clippy
- uses: ./.github/actions/rust-cache
- name: ubuntu dependencies
run: |
sudo apt-get update
sudo bash scripts/install_ubuntu_dependencies.sh
- uses: rui314/setup-mold@v1
- name: wasm target install
run: rustup target add wasm32-unknown-unknown
- name: Install cargo-lints
run: cargo install cargo-lints
- name: Clippy check (with lints)
run: cargo lints clippy --all-targets --all-features
- name: target dir size
if: always()
run: du -sh target/ 2>/dev/null || true
machete:
# Checks for unused dependencies.
name: machete
runs-on: [ ubuntu-latest ]
steps:
- name: checkout
uses: actions/checkout@v7.0.0
- name: toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.stable_toolchain }}
components: clippy, rustfmt
- uses: ./.github/actions/rust-cache
- name: ubuntu dependencies
run: |
sudo apt-get update
sudo bash scripts/install_ubuntu_dependencies.sh
- name: cargo machete
run: |
cargo install cargo-machete
cargo machete
- name: target dir size
if: always()
run: du -sh target/ 2>/dev/null || true
licenses:
name: file licenses
runs-on: [ ubuntu-latest ]
steps:
- name: checkout
uses: actions/checkout@v7.0.0
- name: install ripgrep
# https://github.com/BurntSushi/ripgrep/releases
env:
ripgrep_version: 14.1.0
run: |
#wget https://github.com/BurntSushi/ripgrep/releases/download/14.1.0/ripgrep_14.1.0-1_amd64.deb.sha256
wget https://github.com/BurntSushi/ripgrep/releases/download/${{ env.ripgrep_version }}/ripgrep_${{ env.ripgrep_version }}-1_amd64.deb
sudo dpkg -i ripgrep_${{ env.ripgrep_version }}-1_amd64.deb
rg --version || exit 1
- name: run the license check
run: ./scripts/file_license_check.sh
test-shards:
name: test (${{ matrix.partition }})
runs-on: [ ubuntu-latest ]
strategy:
matrix:
partition: ["1/3", "2/3", "3/3"]
steps:
- name: checkout
uses: actions/checkout@v7.0.0
- name: toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.stable_toolchain }}
- uses: ./.github/actions/rust-cache
with:
save-if: ${{ matrix.partition == '1/3' }}
- name: ubuntu dependencies
run: |
sudo apt-get update
sudo bash scripts/install_ubuntu_dependencies.sh
- uses: rui314/setup-mold@v1
- name: wasm target install
run: rustup target add wasm32-unknown-unknown
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- name: cargo test
run: cargo nextest run --all-features --cargo-profile ci-build --profile ci --partition hash:${{ matrix.partition }}
- name: target dir size
if: always()
run: du -sh target/ 2>/dev/null || true
- name: upload artifact
uses: actions/upload-artifact@v7 # upload test results as artifact
if: success() || failure()
with:
name: test-results-${{ strategy.job-index }}
path: ${{ github.workspace }}/target/nextest/ci/junit.xml
# Required status check aggregator — satisfies the branch protection rule named "test"
# without requiring branch protection rule changes.
test:
name: test
if: always()
needs: [ test-shards ]
runs-on: [ ubuntu-latest ]
steps:
- name: check shard results
run: |
if [[ "${{ needs.test-shards.result }}" != "success" ]]; then
echo "One or more test shards failed or were cancelled"
exit 1
fi
# Required status check placeholder — satisfies the "check stable" branch protection
# rule. The full workspace is already compiled by the test shards on stable.
check-stable:
name: check stable
if: always()
needs: [ test-shards ]
runs-on: [ ubuntu-latest ]
steps:
- name: check shard results
run: |
if [[ "${{ needs.test-shards.result }}" != "success" ]]; then
echo "Compilation check failed (test shards did not pass)"
exit 1
fi
integration-test:
name: integration test
runs-on: [ ubuntu-latest ]
steps:
- name: checkout
uses: actions/checkout@v7.0.0
- name: toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.stable_toolchain }}
- uses: ./.github/actions/rust-cache
- name: ubuntu dependencies
run: |
sudo apt-get update
sudo bash scripts/install_ubuntu_dependencies.sh
- uses: rui314/setup-mold@v1
- name: wasm target install
run: rustup target add wasm32-unknown-unknown
- name: cargo test cucumber
run: cargo test --profile ci-build --package integration_tests --test cucumber
- name: target dir size
if: always()
run: du -sh target/ 2>/dev/null || true
- name: upload test result artifact
uses: actions/upload-artifact@v7 # upload test results as artifact
if: success() || failure()
with:
name: cucumber-test-results
path: ${{ github.workspace }}/integration_tests/cucumber-output-junit.xml
- name: Upload cucumber log artifacts
uses: actions/upload-artifact@v7
if: success() || failure()
with:
name: cucumber-log-artifacts
path: ${{ github.workspace }}/integration_tests/tests/temp/cucumber_*/*.log
# needed for test results
event_file:
runs-on: [ ubuntu-latest ]
steps:
- name: Upload
uses: actions/upload-artifact@v7
with:
name: Event File
path: ${{ github.event_path }}