Repository navigation
Compile solana - #204
Compile solana#204midenotch wants to merge 2 commits into
Conversation
|
@midenotch 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! 🚀 |
truthixify
left a comment
There was a problem hiding this comment.
This branch includes the still-failing Rust quickstart stack, so the required snippet job fails. The Solana workspace itself is never invoked by snippets.yml: the commit adds only the workspace files, despite the PR description claiming cargo check and fmt steps. It also uses placeholder program IDs and contains no comparison against generated IDs or account-layout artifacts required by issue #190. Rebase to isolate this PR, add required workspace check/format tests, and validate IDs and layouts against the canonical generated artifacts.
475f4c7 to
cd5664d
Compare
truthixify
left a comment
There was a problem hiding this comment.
The new compiled fixture makes a false security claim. snippets/solana-contracts/programs/wraith-names/src/lib.rs:33-36 says the full production program verifies a secp256k1 signature proving ownership of meta_address, but the pinned canonical wraith-names program only validates the name and stores the supplied 64 bytes; it performs no such signature verification. The checker passes because it compares instruction signatures/account layouts, not bodies. Remove the claim or implement/verify the real invariant, and describe the checker as structural rather than implying the fixture matches production logic. Local cargo check, fmt, and check:solana-contracts otherwise pass.
cd5664d to
7845aee
Compare
truthixify
left a comment
There was a problem hiding this comment.
The false security claim remains on current head 7845aee. snippets/solana-contracts/programs/wraith-names/src/lib.rs:33-36 still says production verifies a secp256k1 ownership signature, while the canonical program pinned by this PR does no such verification and stores the supplied meta-address after name validation.
The online checker, offline checker, Cargo workspace check, and formatting all pass locally because compareModels validates signatures and layouts, not instruction bodies or prose claims. Remove the claim or implement and verify the actual invariant, and describe this fixture/checker as structural rather than as validation of production behavior. This head also conflicts with develop and has no CI result.
7845aee to
c9d7897
Compare
fixed |
There was a problem hiding this comment.
Security blocker from remote-only review: scripts/check-solana-contracts.ts:436-440 extracts text from the installed @wraith-protocol/sdk bundle and executes it with new Function. This turns a dependency-controlled npm artifact into code executed by the required docs CI job. Do not dynamically evaluate the bundle. Read a structured exported artifact, parse the relevant syntax without execution (for example with an AST), or compare against a checked-in/generated JSON manifest. Add a malicious-expression fixture proving the checker never executes bundle text.
Summary
Compile the Solana contract guide snippets against a reference Anchor workspace,
and check the program IDs and account layouts against the canonical program
sources and the chain-generated deployment record.
Rebased onto
develop; contains only the Solana work (the Rust quickstartstack lives in #203).
Related Issue
Closes #190
Type of Change
Changes Made
snippets/solana-contracts/— an Anchor 0.32 workspace with three programcrates (
wraith-announcer,wraith-sender,wraith-names) mirroring theshape of the canonical programs. Each crate carries the real deployed devnet
program ID in
declare_id!.contracts/solana.mdx—no-checkremoved from all Rust fences. The onlyremaining
no-checkis the bare PDAseeds = …attribute fragment, whichis allowlisted with a reason.
scripts/check-solana-contracts.ts— compares the guide and the workspaceagainst the canonical program sources and the deployment record:
item is covered by the guide;
declare_id!matches the pinned SDK'sgetDeployment("solana")manifestand the chain-generated
deployments/solana/solana-devnet.json;error codes match the canonical program sources;
*_DISCsighash constants.snippets.yml): Rust toolchain pinned to 1.89 (the dependency floor foranchor-lang 0.32) with rustfmt, plus
cargo check --workspace --locked,cargo fmt --check --all, andpnpm run check:solana-contracts.Scope of these checks: they are structural — they compare published API
shape and program IDs. They do not execute or deploy the programs and do not
verify runtime on-chain behaviour. The workspace is a documentation fixture;
instruction bodies are abbreviated or omitted.
Corrected claims: the
wraith-namesfixture no longer claims thatproduction verifies a secp256k1 ownership signature. The canonical program
validates the name format, stores the supplied meta-address as-is, and binds
record ownership to the registrant's Solana wallet. The guide now states this
explicitly.
Testing
cargo check --workspace --lockedandcargo fmt --check --all— passpnpm run check:solana-contracts— 19 fences, 3 programs compared againstguide, workspace, SDK manifest, canonical programs, deployment record
pnpm run check:snippets-extended— no regressions (Rust fences on this pageare excluded from bare
rustcand reported asCrate-checked)Checklist