Skip to content

fix(cluster-tool): verify the Solana .so at deploy - #80

Open
valthon wants to merge 1 commit into
masterfrom
fix/verify-deployed-solana-program-binary
Open

valthon wants to merge 1 commit into
masterfrom
fix/verify-deployed-solana-program-binary

Conversation

@valthon

@valthon valthon commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Verify every Solana genesis binary against the strict-build manifest immediately before validator startup. A stale .so left in gitignored target/deploy after a checkout or rebase now fails with a build remediation error instead of being deployed.

The check covers liqsol_core, liqsol_token, transfer_hook, and validator_leaderboard:

  • Validate manifest schema version 1, provenance, and the requested program entries at runtime. Missing or malformed fields and unsupported versions fail before deployment.
  • Check each binary's byte length and SHA256 against one manifest snapshot. Write verified bytes to a private directory and deploy those copies, so a concurrent rebuild cannot replace the bytes between verification and load.
  • Resolve the recorded source stamp to a full commit ID and compare dirty status separately. Different abbreviations and long-describe tag inventories do not invalidate the same commit.
  • Generated start.sh scripts perform the same validation and snapshotting at execution time. Rendering requires no local build artifacts. Execution requires Node, Git, and the wire-solana checkout, but no installed tools-ts package or additional Node dependencies.

Dirty builds are allowed with a warning: a describe stamp cannot distinguish two different dirty trees at the same commit. A bare-tag stamp also requires that tag to resolve on the deployment host. The manifest producer is already on wire-solana next.

One focused commit on master, a2d75509. The final implementation exposes the production byte-verification path directly; test-only manifest readers and mutable-path assertion helpers are excluded.

Validation on a2d75509:

  • Restored raw source: pnpm install, pnpm build, pnpm install, pnpm run build, full pnpm run lint, changed-file Prettier and diff checks passed. A final raw workspace build passed after removing the temporary test workaround.
  • Raw focused verifier suite: 27/27 passed, with open-handle detection. The malformed-manifest matrix covers 24 variants through managed verification and both clean/dirty executed start scripts.
  • Full pnpm run test:ci with only Register source-map-support only in the debugging server CLI #132’s barrel-import removal applied temporarily: 456 Jest suites / 4,491 tests passed, plus every package test:unit lane. The temporary change was restored byte-for-byte and is excluded from this PR.
  • UNVERIFIED locally: complete raw-head Jest lane. That attempt was interrupted after observing a synchronous jsdom XHR child. No base comparison or base attribution is claimed here.
  • The published commit tree matches the restored tested tree. History and whitespace checks passed; original authorship is preserved.
  • Exact-head hosted CI on a2d75509 passed: Build and test and Jest results completed successfully on the published raw head, with no temporary Register source-map-support only in the debugging server CLI #132 workaround.

The malformed-manifest regression matrix exercises the production verifier and executed generated scripts, including clean and dirty provenance. Coverage also checks every genesis program, stale siblings, source-commit mismatches, differing Git display settings, replacement of shared outputs after verification, and fixture isolation from signing/hooks configuration.

UNVERIFIED: live validator or settlement flow on this head. Executed-script tests use a validator stub and verify the bytes supplied to it.

Earlier-head validation on 98a8b8b9:

@valthon
valthon force-pushed the fix/verify-deployed-solana-program-binary branch from b2e1396 to 5e0e8be Compare August 21, 2026 23:38
@valthon valthon changed the title fix(harness): verify the Solana program binary before deploying it fix(cluster-tool): verify the Solana .so at deploy Aug 22, 2026
@valthon
valthon force-pushed the fix/verify-deployed-solana-program-binary branch from 5e0e8be to e599663 Compare August 25, 2026 23:37
@valthon
valthon force-pushed the fix/verify-deployed-solana-program-binary branch 2 times, most recently from 5977b37 to 4409816 Compare October 9, 2026 10:52
@valthon
valthon changed the base branch from master to fix/sysio-670-consumers October 9, 2026 10:52
@valthon
valthon added this pull request to stack #118 October 9, 2026 10:52
@valthon
valthon force-pushed the fix/verify-deployed-solana-program-binary branch from 4409816 to c3d4a7a Compare October 10, 2026 23:18
Base automatically changed from fix/sysio-670-consumers to master October 12, 2026 18:31
@valthon
valthon force-pushed the fix/verify-deployed-solana-program-binary branch 2 times, most recently from dbf6eba to 3f99189 Compare October 15, 2026 00:37
@valthon
valthon force-pushed the fix/verify-deployed-solana-program-binary branch from 3f99189 to 98a8b8b Compare October 20, 2026 18:59
Reject stale Solana artifacts before validator startup by checking each
of the four genesis binaries against wire-solana's strict-build manifest.
Validate the manifest format before trusting its hashes and provenance;
report malformed or unsupported manifests with the build command needed
to replace them.

Compare full commit identity and dirty status rather than git describe
presentation. Snapshot the verified bytes per launch so a concurrent
rebuild cannot replace a binary between verification and deployment.
Embed the same dependency-free verifier in generated start scripts so
relaunches on another host enforce the same checks.

Exercise managed launches and executed start scripts with malformed
manifests, stale siblings, changed checkouts and replaced shared outputs.
Dirty builds remain usable with a warning because a describe stamp cannot
distinguish different dirty source trees at the same commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019LgGtRheR6Hac9WHX739y3
@valthon
valthon force-pushed the fix/verify-deployed-solana-program-binary branch from 98a8b8b to a2d7550 Compare October 21, 2026 22:02

This branch has not been deployed

No deployments
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