Skip to content

SCAN-2: no single-nullifier request in the frontend; deploy check and log audit - #10

Merged
dendisuhubdy merged 1 commit into
mainfrom
feat/i16-scan2-no-nullifier-lookup
Nov 18, 2026
Merged

dendisuhubdy merged 1 commit into
mainfrom
feat/i16-scan2-no-nullifier-lookup

Conversation

@dendisuhubdy

Copy link
Copy Markdown
Member

Tracks randprotocol/monorepo#16

The history page already matches nullifiers in the browser (66bc1a7, 2dea39b, 0df5bc9 on main). The issue was reopened because no deployment is recorded and the access logs were never purged. This PR closes what was still open in code and makes the two owner steps checkable.

Code

  • frontend/src/lib/api.ts: the unused getNullifier(nf) (GET /nullifiers/:nf) is removed, so nothing in the frontend can name one nullifier in a request.
  • frontend/tests/spent.test.mjs: two new guards. No source file may reference a single-nullifier lookup or build a /nullifiers/<value> path, and exactly one nullifier request exists (the paged set, whose only inputs are the server's cursor and a constant limit). The history scan may call only getEnvelopePage and getNullifierPage. Re-adding getNullifier makes the first guard fail (tried locally).
  • docs/api.md: GET /nullifiers/:nf stays in the public API; the table now says not to call it with a nullifier of your own wallet.

Owner follow-up, made executable

  • deploy/scan2-verify.sh [--record] <base-url>: read-only. Passes only when POST /api/v1/nullifiers/lookup answers 404/405, GET /api/v1/nullifiers?limit=1 serves {nullifiers, next}, and no /_next/static chunk referenced by the served /en/viewing contains a nullifier lookup. --record prints a dated line for the issue.
  • deploy/scan2-log-audit.sh: run on the explorer host. Dry run by default: counts lines holding a lookup or a /nullifiers/<64 hex> URL in journald (randscan-api, randscan-frontend, caddy) and in plain log files, and never prints a matching line. --purge --before YYYY-MM-DD rotates and vacuums the journal up to that day and removes the matching lines from plain files.
  • deploy/README.md: the two steps.
  • CI: new deploy-scripts job (shellcheck, then both offline tests).

Not done here (owner)

  • Deploy randscan main to the explorer host, run scan2-verify.sh --record, post the line on the issue.
  • Run scan2-log-audit.sh on the host and purge if it finds anything. Neither script has been run against the live explorer.

🤖 Generated with Claude Code

…eck and a log audit for the owner's follow-up

The history page already matches nullifiers in the browser (66bc1a7). What was left:

- frontend/src/lib/api.ts still exported getNullifier(nf) (GET /nullifiers/:nf), unused. It is
  removed, and frontend/tests/spent.test.mjs now fails if any source file can name one nullifier
  in a request, or if the history scan calls anything but the two uniform downloads.
- docs/api.md warns API users not to call GET /nullifiers/:nf with a nullifier of their own.
- deploy/scan2-verify.sh: read-only check of a deployed explorer (lookup route gone, paged set
  served, no lookup in the served history page's chunks); --record prints the dated line the
  issue asks for.
- deploy/scan2-log-audit.sh: on the explorer host, counts log lines that hold a lookup or a
  /nullifiers/<hex> URL (dry run, never prints them); --purge --before <day> removes them.
- CI: a deploy-scripts job (shellcheck + both offline tests).

Tracks randprotocol/monorepo#16

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dendisuhubdy
dendisuhubdy merged commit a367c1c into main Nov 18, 2026
8 checks passed
@dendisuhubdy
dendisuhubdy deleted the feat/i16-scan2-no-nullifier-lookup branch November 18, 2026 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant