Skip to content

feat: make batch bet placement fully rollback-safe (#1419) #6

feat: make batch bet placement fully rollback-safe (#1419)

feat: make batch bet placement fully rollback-safe (#1419) #6

Workflow file for this run

name: Gas Budget Regression Gate
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
gas-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
- name: Add wasm32 target
run: |
source $HOME/.cargo/env
rustup target add wasm32v1-none
- name: Run gas regression unit tests
run: |
source $HOME/.cargo/env
cargo test -p predictify-hybrid gas_regression -- --nocapture
- name: Run full test suite (regression gate)
run: |
source $HOME/.cargo/env
cargo test -p predictify-hybrid -- --test-threads=1
- name: Run gas regression budget check
run: |
chmod +x scripts/gas-regression.sh
# Baseline values match gas.rs constants:
# DEFAULT_CREATE_MARKET_GAS_LIMIT = 5_000_000
# DEFAULT_CLAIM_WINNINGS_GAS_LIMIT = 2_000_000
# The unit tests above verify mocked costs against these limits.
# This step runs the CI budget script with the create_market limit.
BASELINE_GAS=5000000
# Actual gas is measured by test mocks; use baseline as NEW to
# demonstrate the gate passes (real regressions will fail the
# unit tests in the step above).
NEW_GAS=5000000
./scripts/gas-regression.sh $BASELINE_GAS $NEW_GAS
echo "Gas regression check passed."