|
1 | | -# Slashmon |
| 1 | +# slashveto.me |
2 | 2 |
|
3 | | -Slashmon watches Aztec slashing and has two deliberately separate parts: |
| 3 | +slashveto.me tracks an Aztec sequencer from the first observed duty miss to an |
| 4 | +L1 slash and ejection: |
4 | 5 |
|
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 backend UI. It can search the complete journal for one |
10 | | - sequencer, manage address watches, and send matched alerts through Telegram |
11 | | - or Web Push. The backend records per-duty inactivity precursors and |
12 | | - registered offenses from one Aztec node, then verifies L1 slashing state. |
| 6 | +```text |
| 7 | +duty miss → node offense → L1 vote → quorum → execution delay |
| 8 | + → executable → executed → stake removed → ejection |
| 9 | +``` |
13 | 10 |
|
14 | | -Node-local offenses are early warnings, not consensus. Slashmon labels them |
15 | | -`pending`. Ethereum observations are labelled `confirmed`. The backend never |
16 | | -turns one node's opinion into L1 truth. |
| 11 | +A path can stop at any step. The product keeps candidate amounts, executed |
| 12 | +rounds, and actual stake deductions separate. L1 votes do not encode an |
| 13 | +offense reason; a displayed reason is always labelled as evidence from the |
| 14 | +attached Aztec node. |
17 | 15 |
|
18 | | -## Repository |
| 16 | +## Surfaces |
| 17 | + |
| 18 | +| Surface | Source | Purpose | |
| 19 | +| --- | --- | --- | |
| 20 | +| **Monitor** | Ethereum RPC queried in the browser | Independent view of canonical contracts, votes, candidates, execution, and slash logs. | |
| 21 | +| **PINGME** | Backend using one Aztec node and Ethereum RPC | Earlier Sentinel/offense evidence, durable cases, and Telegram or Web Push alerts. | |
19 | 22 |
|
20 | | -- `src/` — React/Vite PWA containing Monitor and PINGME |
21 | | -- `collector/` — Node backend, SQLite journal, and notification delivery |
22 | | -- [`docs/architecture.md`](docs/architecture.md) — data flow and trust boundaries |
23 | | -- [`docs/notifications.md`](docs/notifications.md) — notification stages, required context, and links |
24 | | -- [`docs/runbook.md`](docs/runbook.md) — production deployment and operations |
25 | | -- [`docs/privacy.md`](docs/privacy.md) — stored data and provider exposure |
| 23 | +Monitor never calls the backend. PINGME keeps the last known state when one |
| 24 | +source fails and reports that source as stale. Neither surface is an oracle: |
| 25 | +node evidence is one observer's report, while L1 establishes contract state |
| 26 | +without revealing the reason behind a vote. |
| 27 | + |
| 28 | +The primary object is a slashing case: network, contract lineage, sequencer, |
| 29 | +and target epoch with its source observations and state transitions. Linking is |
| 30 | +exact and conservative. An actual slash joins through its execution transaction |
| 31 | +and action order, never by address and approximate time. |
| 32 | + |
| 33 | +## Repository |
26 | 34 |
|
27 | | -The ignored `apiReference.md` and `onchainSources.md` files are research |
28 | | -material. Runtime behavior must live in committed code, ABIs, and tests. |
| 35 | +- `shared/protocol/` contains the pure case projection, tallying, transitions, |
| 36 | + and notification wording shared by frontend and backend. |
| 37 | +- `src/` contains the React PWA and independent browser L1 collector. |
| 38 | +- `collector/` contains the Node backend, SQLite repository, three evidence |
| 39 | + collectors, API, durable outbox, Telegram, and Web Push. |
| 40 | +- `scripts/deploy-backend.sh` installs an immutable backend release under |
| 41 | + systemd. |
| 42 | + |
| 43 | +The backend API is rooted at `/api`. `/live` reports process liveness and |
| 44 | +`/health` reports whether the required evidence sources are current. |
| 45 | + |
| 46 | +| Method | Route | Purpose | |
| 47 | +| --- | --- | --- | |
| 48 | +| `GET` | `/api/config`, `/api/status`, `/api/network` | Capabilities, freshness, protocol state, and public cases | |
| 49 | +| `GET` | `/api/sequencers/:address`, `/api/cases/:id` | Public sequencer and exact-case views | |
| 50 | +| `POST` | `/api/watches` | Create a private watch and return its management token once | |
| 51 | +| `GET/PATCH/DELETE` | `/api/watches/:id` | Bearer-authenticated watch management | |
| 52 | +| `PUT/DELETE` | `/api/watches/:id/channels/web_push` | Web Push enrollment | |
| 53 | +| `POST` | `/api/watches/:id/channels/telegram-link` | One-time Telegram enrollment link | |
| 54 | +| `POST` | `/api/watches/:id/channels/test` | Queue a test alert | |
29 | 55 |
|
30 | 56 | ## Development |
31 | 57 |
|
32 | | -Use Node 24 and the pinned pnpm release: |
| 58 | +Node 24 and the pinned pnpm version are required: |
33 | 59 |
|
34 | 60 | ```bash |
35 | 61 | corepack enable |
36 | | -pnpm install |
| 62 | +pnpm install --frozen-lockfile |
37 | 63 | cp .env.example .env |
38 | 64 | cp collector/.env.example collector/.env |
39 | | -``` |
40 | | - |
41 | | -Run the two processes in separate terminals: |
42 | | - |
43 | | -```bash |
44 | 65 | pnpm dev |
45 | 66 | pnpm dev:backend |
46 | 67 | ``` |
47 | 68 |
|
48 | | -For local cross-origin development, set |
49 | | -`VITE_API_BASE_URL=http://127.0.0.1:8790`; the backend example already allows |
50 | | -`http://localhost:5173`. Alternatively leave `VITE_API_BASE_URL` empty and set |
51 | | -`SLASHMON_DEV_API_PROXY_TARGET` for Vite's same-origin development proxy. |
52 | | - |
53 | | -Run the complete quality gate with: |
| 69 | +Run the release gate with: |
54 | 70 |
|
55 | 71 | ```bash |
56 | 72 | pnpm check |
57 | 73 | ``` |
58 | 74 |
|
59 | | -All `VITE_*` values are public browser configuration. Backend RPC credentials, |
60 | | -Telegram tokens, and VAPID private keys belong only in `collector/.env` or the |
61 | | -production environment file. |
| 75 | +Every `VITE_*` value is public. RPC credentials, Aztec admin credentials, |
| 76 | +Telegram tokens, VAPID private keys, and the SQLite database belong only in the |
| 77 | +backend environment. The ignored `apiReference.md` and `onchainSources.md` are |
| 78 | +local research inputs, not runtime dependencies or published documentation. |
| 79 | + |
| 80 | +## Documentation |
62 | 81 |
|
63 | | -Notification watches use a bearer capability stored by browser origin. Host a |
64 | | -production PINGME installation on a dedicated origin and do not add third-party |
65 | | -scripts. A shared GitHub Pages origin is suitable only for the public Monitor. |
| 82 | +- [Protocol and correctness model](docs/protocol.md) |
| 83 | +- [Notification contract](docs/notifications.md) |
| 84 | +- [Production runbook](docs/runbook.md) |
66 | 85 |
|
67 | | -Production backend deployments use `scripts/deploy-backend.sh`: `--fresh` |
68 | | -resets all state, while `--upgrade` preserves and backs up the current database. |
| 86 | +The protocol model was checked against the active Aztec mainnet deployment and |
| 87 | +[`aztec-packages` commit `def7152a`](https://github.com/AztecProtocol/aztec-packages/tree/def7152aa13dc0f880f24e45ce39442908170878) |
| 88 | +on 2026-07-29. Contracts and parameters are upgradeable; runtime code discovers |
| 89 | +the responsible lineage and reads its values. |
0 commit comments