|
1 | | -# Aztec Slashing Monitor |
| 1 | +# Slashmon |
2 | 2 |
|
3 | | -This is a tool by and for the [Slash Veto Council](https://github.com/aztec-slash-veto/council/) and the Aztec community. It shows slashing rounds before they execute, including the targeted validators, amounts, veto status, and precomputed payload address. |
| 3 | +Slashmon watches Aztec slashing and has two deliberately separate parts: |
4 | 4 |
|
5 | | -The monitor discovers the canonical Rollup, Slasher, and SlashingProposer from Aztec's stable Registry contract. It checks that the contracts point back to each other and follows Registry upgrades automatically. |
| 5 | +- **Monitor** is a browser-only view of public Ethereum state. It resolves the |
| 6 | + canonical Aztec contracts and checks slashing rounds directly through public |
| 7 | + L1 RPCs. Its on-page details panel can select a browser-local RPC and inspect |
| 8 | + the resolved deployment metadata. |
| 9 | +- **PINGME** is the alerting UI for the backend. The backend journals early |
| 10 | + offenses from one Aztec node, verifies L1 slashing state, and sends matched |
| 11 | + alerts through Telegram or Web Push. |
6 | 12 |
|
7 | | -See [V5_UPGRADE_REVIEW.md](V5_UPGRADE_REVIEW.md) for the contract/source review, cutover details, and monitor impact. |
| 13 | +Node-local offenses are early warnings, not consensus. Slashmon labels them |
| 14 | +`pending`. Ethereum observations are labelled `confirmed`. The backend never |
| 15 | +turns one node's opinion into L1 truth. |
8 | 16 |
|
9 | | -To run it locally: |
| 17 | +## Repository |
10 | 18 |
|
11 | | -- Use Node 24. |
12 | | -- Copy [.env.example](.env.example) to `.env` and optionally replace the public RPC endpoints. |
13 | | -- Run `pnpm install` and `pnpm dev`. |
| 19 | +- `src/` — React/Vite PWA containing Monitor and PINGME |
| 20 | +- `collector/` — Node backend, SQLite journal, and notification delivery |
| 21 | +- [`docs/architecture.md`](docs/architecture.md) — data flow and trust boundaries |
| 22 | +- [`docs/runbook.md`](docs/runbook.md) — production deployment and operations |
| 23 | +- [`docs/privacy.md`](docs/privacy.md) — stored data and provider exposure |
14 | 24 |
|
15 | | -Mainnet is the default. Add `?network=testnet` to the URL for Sepolia testnet. |
| 25 | +The ignored `apiReference.md` and `onchainSources.md` files are research |
| 26 | +material. Runtime behavior must live in committed code, ABIs, and tests. |
| 27 | + |
| 28 | +## Development |
| 29 | + |
| 30 | +Use Node 24 and the pinned pnpm release: |
| 31 | + |
| 32 | +```bash |
| 33 | +corepack enable |
| 34 | +pnpm install |
| 35 | +cp .env.example .env |
| 36 | +cp collector/.env.example collector/.env |
| 37 | +``` |
| 38 | + |
| 39 | +Run the two processes in separate terminals: |
| 40 | + |
| 41 | +```bash |
| 42 | +pnpm dev |
| 43 | +pnpm dev:backend |
| 44 | +``` |
| 45 | + |
| 46 | +For local cross-origin development, set |
| 47 | +`VITE_API_BASE_URL=http://127.0.0.1:8790`; the backend example already allows |
| 48 | +`http://localhost:5173`. Alternatively leave `VITE_API_BASE_URL` empty and set |
| 49 | +`SLASHMON_DEV_API_PROXY_TARGET` for Vite's same-origin development proxy. |
| 50 | + |
| 51 | +Run the complete quality gate with: |
| 52 | + |
| 53 | +```bash |
| 54 | +pnpm check |
| 55 | +``` |
| 56 | + |
| 57 | +All `VITE_*` values are public browser configuration. Backend RPC credentials, |
| 58 | +Telegram tokens, and VAPID private keys belong only in `collector/.env` or the |
| 59 | +production environment file. |
| 60 | + |
| 61 | +Notification watches use a bearer capability stored by browser origin. Host a |
| 62 | +production PINGME installation on a dedicated origin and do not add third-party |
| 63 | +scripts. A shared GitHub Pages origin is suitable only for the public Monitor. |
| 64 | + |
| 65 | +The destructive one-time backend switch is documented in the runbook and runs |
| 66 | +as `scripts/switch-backend.sh --fresh`. |
0 commit comments