Verification pipeline for submitted schemas - #973
Conversation
modified: packages/pulse-core/src/EventEngine.ts modified: packages/pulse-core/src/index.ts
new file: apps/web/app/api/registry/verdicts/route.ts new file: apps/web/app/api/registry/verify/route.ts new file: apps/web/app/registry/[contractId]/page.tsx new file: apps/web/app/registry/page.tsx new file: apps/web/lib/registry.ts modified: apps/web/package.json new file: packages/abi-registry/src/alertManager.ts modified: packages/abi-registry/src/index.ts new file: packages/abi-registry/src/issueReporter.ts new file: packages/abi-registry/src/specStore.ts new file: packages/abi-registry/src/verdictStore.ts new file: packages/abi-registry/src/verificationJob.ts modified: pnpm-lock.yaml
|
@wonderfulmarv01 is attempting to deploy a commit to the determined's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@wonderfulmarv01 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
determined-001
left a comment
There was a problem hiding this comment.
Thanks — the verification pipeline itself (verificationJob, verdictStore, specStore, issueReporter, alertManager plus the explorer pages) is a real attempt at #917 and the verdict vocabulary matches the issue. Three things block it.
1. This branch carries the unfinished backpressure work from #954.
packages/pulse-core/src/EventEngine.ts (+122) and src/index.ts (+18) are the bounded-queue change from your other PR, not part of #917. It does not compile:
packages/pulse-core/src/EventEngine.ts(211,11): error TS2564: Property 'queueHighWaterMark' has no initializer and is not definitely assigned in the constructor.
packages/pulse-core/src/EventEngine.ts(212,11): error TS2564: Property 'queueLowWaterMark' ...
packages/pulse-core/src/EventEngine.ts(213,11): error TS2564: Property 'queuePolicy' ...
Please drop those two files from this branch and keep that work in #954, where I left the rest of the review (the queue also only wraps the Horizon path, and it drains in the same tick so the high-water mark is unreachable).
2. There is no scheduled job. Criterion 1 asks for "a scheduled job [that] walks every registered spec". What is here is POST /api/registry/verify — a manual trigger. There is no cron: no vercel.json with a crons entry, no scheduled GitHub workflow. Without one, verdicts only refresh when somebody remembers to POST, which is the situation the issue is trying to end. Add the schedule and make the route reject unauthenticated calls (an unauthenticated POST that fans out on-chain fetches is also a free DoS lever).
3. No tests. ~800 lines of new logic — verdict transitions, the verified → mismatch alert path, issue creation, the unverifiable case for pre-SEP-48 contracts — and not a single test file. Criterion 4 (pre-SEP-48 contracts are unverifiable and displayed as attested-only, never as verified) and criterion 5 (a transition from verified to mismatch raises an alert) are exactly the kind of thing that needs a test to be believable.
Two notes while you are in here:
- The checks on this PR were never actually run — they sat in
action_requiredawaiting maintainer approval, so the green you saw was only Vercel. I have approved them, so you should now get real results. - I resolved a conflict in
apps/web/package.jsonlocally while reviewing (your--filter "@orbital-stellar/abi-registry..."addition topredev/prebuildversus main'sdocs:generate-open-datastep — both are needed). You will need to merge currentmainyourself; it also picks up the hosted registry client from #965, which your explorer pages may want to know about.
closes #917
Summary
This PR implements an automated verification pipeline for the hosted ABI registry. While verifySchema.ts already provides the core schema comparison logic, verification was only available as a library function. This change integrates that logic into a scheduled verification workflow, ensuring that every registered ABI is continuously validated against its on-chain contractspec.
The goal is to prevent unverified or outdated schemas from being presented as canonical, improving trust in the hosted registry.
Changes
Added a scheduled verification job that iterates through all registered ABI specifications.
Fetches each contract's on-chain contractspec and compares it against the submitted schema using the existing verifySchema.ts implementation.
Introduced persistent verification verdict storage with timestamps.
Exposed verification status through the hosted API and Registry Explorer.
Added support for the following verification states:
Verified – Submitted schema matches the on-chain specification.
Mismatch – Submitted schema differs from the on-chain specification.
Unverifiable – No embedded contractspec is available (pre-SEP-48 contracts).
Updated the explorer UI to clearly distinguish verified, mismatched, and attested-only specifications.
Automatically creates an issue whenever a schema transitions to a Mismatch state.
Added alerting when a previously verified schema becomes mismatched.