Skip to content

ci: enforce locked installs, security scans, event validation, and st… - #775

Open
Osuochasam wants to merge 1 commit into
Core-Foundry:mainfrom
Osuochasam:fix/event-validation
Open

ci: enforce locked installs, security scans, event validation, and st…#775
Osuochasam wants to merge 1 commit into
Core-Foundry:mainfrom
Osuochasam:fix/event-validation

Conversation

@Osuochasam

Copy link
Copy Markdown
Contributor

Overview
This update introduces comprehensive contract state testing, hardens the CI pipeline with locked dependency installations and security scanning, and adds automated drift detection for contract events.

Key Changes:

Contract State Tests: Added a robust test suite (state_transitions.rs) mapped into lib.rs. It thoroughly validates the contract's state machine, covering initial states, pause/unpause transitions by admins, blocked operations during paused states (verifying 17 read-only APIs), and repeated lifecycle cycles.

Reproducible CI Installations: Eliminated dependency drift in the CI pipeline. JavaScript/TypeScript jobs now strictly use npm ci (with separate cache paths), and Rust jobs use cargo fetch --locked. Both are configured to fail fast and provide actionable output for developers if lockfiles are out of sync.

Automated Vulnerability Scanning: Integrated a non-blocking/blocking security scan job into CI. It runs cargo-audit for Rust and npm audit for JS/TS. Informational and low-severity findings are logged, while critical and high-severity vulnerabilities will block the build. Documented the tooling and suppression policies in a new SECURITY_SCANNING.md file.

Event Documentation Validation: Created a new JSON source of truth (contract_events_docs.json) for contract events and a lightweight TypeScript validation script (check_events.ts). A new CI job automatically parses the Rust codebase to detect any drift between the documented events (names, fields, types, topics) and the actual implementation, preventing undocumented API changes.

Closes #712
Closes #714
Closes #718
Closes #719

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant