Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 32 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ jobs:
- name: Run deterministic replay parity suite (Issue #369)
run: cargo test -p xelma-replay --locked -- --nocapture

- name: Run emergency claims-only drill test
run: cargo test --package xelma-contract --lib tests::drill --locked -- --nocapture

- name: Run adversarial CI-critical scenarios only
run: cargo test --package xelma-contract --lib test_critical_ --locked -- --nocapture

Expand Down Expand Up @@ -588,10 +585,38 @@ jobs:
echo "OK: WASM size is within budget."
fi

emergency-drill-gate:
name: Emergency Drill Gate
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32v1-none

- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Execute Emergency Drill (Pause -> Claims -> Resume)
run: cargo test --package xelma-contract --lib tests::drill --locked -- --nocapture

ci-success:
name: CI Success
runs-on: ubuntu-latest
needs: [rust-test, contract-build, bindings-test, bindings-build, bindings-vitest, e2e-smoke, parity-check, coverage, format-check, license-header-check, security-audit, wasm-size-gate]
needs: [rust-test, contract-build, bindings-test, bindings-build, bindings-vitest, e2e-smoke, parity-check, coverage, format-check, license-header-check, security-audit, wasm-size-gate, emergency-drill-gate]
if: always()
steps:
- name: Check all jobs status
Expand All @@ -607,7 +632,8 @@ jobs:
[ "${{ needs.format-check.result }}" != "success" ] || \
[ "${{ needs.license-header-check.result }}" != "success" ] || \
[ "${{ needs.security-audit.result }}" != "success" ] || \
[ "${{ needs.wasm-size-gate.result }}" != "success" ]; then
[ "${{ needs.wasm-size-gate.result }}" != "success" ] || \
[ "${{ needs.emergency-drill-gate.result }}" != "success" ]; then
echo "One or more CI jobs failed"
echo "Rust Tests: ${{ needs.rust-test.result }}"
echo "Contract Build: ${{ needs.contract-build.result }}"
Expand All @@ -621,6 +647,7 @@ jobs:
echo "SPDX Headers: ${{ needs.license-header-check.result }}"
echo "Security Audit: ${{ needs.security-audit.result }}"
echo "WASM Size Gate: ${{ needs.wasm-size-gate.result }}"
echo "Emergency Drill Gate: ${{ needs.emergency-drill-gate.result }}"
exit 1
fi
echo "All CI checks passed"
14 changes: 14 additions & 0 deletions docs/EMERGENCY_DRILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,17 @@ cargo test --all-targets
- [ ] Verify `get_protocol_status()` returns `Active` (mode 0).
- [ ] Execute smoke test round (`create_round`, `place_bet`, `resolve_round`).
- [ ] Notify community and publish incident post-mortem.

---

## 5. Release Checklist Gate

To ensure emergency operational capabilities are verified before every release, include the following checklist in the release pull request or notes:

```markdown
### Emergency Drill Gate
- [ ] Required CI Job **Emergency Drill Gate** passed successfully.
- [ ] Automated drill verified `Normal -> ClaimsOnly -> FullyPaused -> Normal` transitions.
- [ ] `claim_winnings` confirmed functional during `ClaimsOnly` mode.
- [ ] Operations successfully resumed after `unpause_contract`.
```