feat(ts): re-implement verifiedBuild using OtterSec registry#4522
feat(ts): re-implement verifiedBuild using OtterSec registry#4522eteen12 wants to merge 2 commits into
Conversation
|
@eteen12 is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR re-introduces
Confidence Score: 3/5The TypeScript change re-introduces a useful feature but has a gap between its documented and actual behavior for error cases that should be closed before merging. The ts/packages/anchor/src/utils/registry.ts needs a try-catch around the fetch call, and the VerifiedBuild type fields should be cross-checked against the live API response. Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant verifiedBuild
participant OtterSecAPI as verify.osec.io
Caller->>verifiedBuild: verifiedBuild(programId)
verifiedBuild->>OtterSecAPI: "GET /status/{programId}"
alt HTTP error (4xx/5xx)
OtterSecAPI-->>verifiedBuild: !resp.ok
verifiedBuild-->>Caller: null
else Network / parse failure
OtterSecAPI-->>verifiedBuild: throws Error
verifiedBuild-->>Caller: unhandled exception (no try-catch)
else 200 OK, is_verified: false
OtterSecAPI-->>verifiedBuild: "{ is_verified: false, ... }"
verifiedBuild-->>Caller: null
else 200 OK, is_verified: true
OtterSecAPI-->>verifiedBuild: "{ is_verified: true, ... }"
verifiedBuild-->>Caller: VerifiedBuild object
end
Reviews (1): Last reviewed commit: "feat(ts): re-implement verifiedBuild usi..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
Reintroduces TypeScript verified-build lookup by querying the OtterSec verification registry, and adjusts Rust IDL-build parsing behavior to avoid hard failures when syn v1 cannot parse newer Rust syntax.
Changes:
- ts: Add
verifiedBuild(programId)that fetches verification status fromhttps://verify.osec.io/status/{programId}and introduces aVerifiedBuildresponse type. - lang: Restore “silent fail” behavior when
CrateContext::parsefails during IDL type generation (to avoid breaking--features idl-buildon newer Rust syntax). - docs: Add changelog entries for the above TS feature and Rust fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ts/packages/anchor/src/utils/registry.ts | Adds OtterSec-backed verifiedBuild + VerifiedBuild type. |
| lang/syn/src/idl/defined.rs | Changes crate parsing cache to fall back instead of erroring when parsing fails. |
| CHANGELOG.md | Documents the TS registry feature and the Rust IDL-build fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replaces the defunct apr.dev API with verify.osec.io. Exports a
VerifiedBuild type matching the /status/{programId} response shape.
Closes solana-foundation#4435
bcea758 to
c9eeb88
Compare
Closes #4435
Problem
verifiedBuildwas removed in #4425 because it pointed atapi.apr.dev, which is defunct.Changes
verifiedBuild(programId)ints/packages/anchor/src/utils/registry.tsusing the OtterSec registry (https://verify.osec.io/status/{programId})VerifiedBuildtype matching the/status/{programId}response shapenullwhen the program is not verified or the request failsAPI comparison
apr.dev)verify.osec.io)is_verifiedflag (registry re-checks every 24h)verifiedBuild(connection, programId, limit?)verifiedBuild(programId)Connectionneeded