Skip to content

feat: reset bonding curve to canonical 18-decimal integer protocol #2439

feat: reset bonding curve to canonical 18-decimal integer protocol

feat: reset bonding curve to canonical 18-decimal integer protocol #2439

Workflow file for this run

name: CI
on:
push:
branches: [development, main]
pull_request:
branches: [development, main]
workflow_dispatch:
inputs:
deploy:
description: 'Deploy after build'
required: false
default: 'true'
type: boolean
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_BUILD_JOBS: 1
jobs:
smoke:
name: Build (workspace)
runs-on: ubuntu-latest
steps:
- name: Free disk space
run: |
echo "Disk space before cleanup:"
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
sudo docker system prune --all --force --volumes
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
echo "Disk space after cleanup:"
df -h
- name: Checkout
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev libdbus-1-dev pkg-config
- name: Install Rust
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cache cargo registry and target
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target/release
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Build
run: cargo build --workspace --locked
- name: Build Release Binary (zhtp node)
if: (github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/main')) || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/development')
run: cargo build --release -p zhtp --locked
- name: Upload Release Artifact (zhtp node)
if: (github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/main')) || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/development')
uses: actions/upload-artifact@v4
with:
name: zhtp-node-binary
path: target/release/zhtp
retention-days: 1
- name: Run zhtp-cli Integration Tests
run: cargo test -p zhtp-cli --test integration_tests --locked -- --nocapture
- name: Run zhtp-cli Feature Tests
run: cargo test -p zhtp-cli --test feature_tests --locked
- name: Run zhtp-cli Handler Tests
run: cargo test -p zhtp-cli --test handler_tests --locked
- name: Run DAO-READY Release Gates
run: ./scripts/validate-dao-ready-gates.sh
- name: Clean up disk space after build
if: always()
run: |
echo "Cleaning build artifacts..."
cargo clean
rm -rf target/debug
sudo docker system prune --all --force --volumes
echo "Final disk space:"
df -h
# macOS build and BLE/GATT test coverage (Issue #475)
macos:
name: Build/Test (macOS)
runs-on: macos-14
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cache cargo registry and target
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target/release
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Build workspace
run: cargo build --workspace --locked
- name: Test lib-network (BLE/GATT coverage)
run: cargo test -p lib-network --locked --features ble-mock -- --nocapture
- name: Build zhtp-cli
run: cargo build --release -p zhtp-cli --locked
- name: Run zhtp-cli Integration Tests (macOS)
run: cargo test -p zhtp-cli --test integration_tests --locked -- --nocapture
- name: Run zhtp-cli Feature Tests (macOS)
run: cargo test -p zhtp-cli --test feature_tests --locked
- name: Run zhtp-cli Handler Tests (macOS)
run: cargo test -p zhtp-cli --test handler_tests --locked
type-check:
name: Check for type duplication
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# Using bash prefix (fixes comment #3) and continue-on-error (fixes comment #5)
- name: Check for duplicate types
run: bash .github/scripts/check-type-duplication.sh
continue-on-error: true
# Deploy to production server (main branch)
deploy-production:
name: Deploy to Production Server
needs: smoke
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout (for service file)
uses: actions/checkout@v4
with:
sparse-checkout: deploy
- name: Download Release Artifact
uses: actions/download-artifact@v4
with:
name: zhtp-node-binary
- name: Setup SSH
env:
SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
run: |
mkdir -p ~/.ssh
echo "$SSH_KEY" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
for i in 1 2 3; do
ssh-keyscan -T 10 -H "$DEPLOY_HOST" >> ~/.ssh/known_hosts && break
echo "ssh-keyscan attempt $i failed, retrying..."
sleep 2
done
- name: Deploy Binary and Service
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
run: |
scp -i ~/.ssh/deploy_key ./zhtp "${DEPLOY_USER}@${DEPLOY_HOST}:/opt/zhtp/zhtp.new"
scp -i ~/.ssh/deploy_key ./deploy/zhtp.service "${DEPLOY_USER}@${DEPLOY_HOST}:/tmp/zhtp.service"
ssh -i ~/.ssh/deploy_key "${DEPLOY_USER}@${DEPLOY_HOST}" '
cd /opt/zhtp &&
systemctl stop zhtp 2>/dev/null || true &&
sleep 2 &&
# Clear nonce caches to prevent sled DB corruption on restart
rm -rf /opt/zhtp/data/tls/quic_nonce_cache/* 2>/dev/null || true &&
rm -rf /opt/zhtp/nonce_cache_wifi/* 2>/dev/null || true &&
rm -rf /root/.zhtp/client_nonce_cache/* 2>/dev/null || true &&
if [ -f zhtp ]; then mv zhtp zhtp.old; fi &&
mv zhtp.new zhtp &&
chmod +x zhtp &&
mv /tmp/zhtp.service /etc/systemd/system/zhtp.service &&
systemctl daemon-reload &&
systemctl enable zhtp &&
systemctl start zhtp &&
sleep 5 &&
systemctl is-active zhtp && echo "Deployed to PRODUCTION at $(date)" || echo "WARNING: Service not active!"
'
# deploy-development removed: all nodes are now BFT validator peers,
# deployments are done manually via deploy scripts.