Skip to content

Decouple the Solana Rust SDK from the program and enable crate releases - #19

Merged
edo-chan merged 3 commits into
mainfrom
codex/independent-solana-rust
Oct 30, 2026
Merged

edo-chan merged 3 commits into
mainfrom
codex/independent-solana-rust

Conversation

@edo-chan

@edo-chan edo-chan commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

The Rust SDK currently pulls the on-chain swig program into every consumer and cannot be published to crates.io. This change gives swig-interface its own program ID, instruction discriminants, fixed instruction headers, and authority-proof constants. The program remains a pinned test-only dependency so compatibility is checked against the same wallet revision already recorded in solana/source.json.

Instruction builders and account ordering remain unchanged. The public swig_interface::swig program re-export is removed for the 3.0.0 release; consumers can use PROGRAM_ID, program_id(), and instruction_data instead. Existing state and compact-instruction crates remain pinned Git dependencies during development, with exact registry version fallbacks for publication.

Adds .github/workflows/publish-solana-rust.yml: pull requests and relevant pushes to main run formatting, Clippy, ABI/runtime tests, and archive/consumer checks. After successful verification on main, the workflow publishes swig-interface then swig-sdk using crates.io trusted publishing. No release tag or GitHub Release is required to trigger publishing.

Publishing uses the version committed in the workspace Cargo.toml. Each new release needs a version bump with matching internal dependency requirements and lockfile; already-published versions are skipped, so a source-only merge without a version bump does not create a new crate version. Concurrent runs use GitHub's native queue instead of replacing a pending publication (up to 100 waiting runs).

Validation:

  • Rust workspace runtime suite and all three ABI parity tests pass, with five existing skips.

  • ABI checks compare all 23 fixed headers byte-for-byte, all 26 discriminants, program ID, and proof constants against pinned wallet revision c5edad67f82958f7fb282634ad91c752602e76ca.

  • cargo clippy --workspace --all-targets --locked and formatting checks pass; existing warnings remain.

  • Both crate archives package and compile, and an external consumer builds from the extracted archives using local prerequisite crate candidates. Production dependency trees exclude swig and Shank.

  • Packaging also passes against a clean checkout of the exact pinned wallet revision.

  • bun run test passes for the Solana TypeScript SDK.

  • Actionlint 1.7.12 passes with a narrow ignore only for its unsupported concurrency.queue key, which is documented by GitHub; all other lint checks remain enabled.

  • GitHub Rust verification and all other PR checks pass on 861eb9f0da4761651dc7403874559c9f8f2eeafe; independent review found no remaining blocker.

Release prerequisites: publish the helper/state crates using the standalone wallet publishing PR #243. This SDK uses auth-lock state APIs from wallet #226, which are absent from current wallet main; its registry dependency must resolve to a version containing those APIs. If swig-state 3.0.0 is first published from current main, release the auth-lock state under an unused version and update this SDK's Git pin, exact registry requirements, and lockfile before publishing. New crate names (including swig-interface) require their initial owner-authenticated publication before configuring trusted publishing. Configure this workflow for both SDK crates. Archive checks use local prerequisite candidates and do not claim those versions are already on crates.io. No crate uploads are part of this PR.

@edo-chan
edo-chan marked this pull request as ready for review October 29, 2026 21:51
@edo-chan
edo-chan marked this pull request as draft October 29, 2026 21:54
@edo-chan
edo-chan marked this pull request as ready for review October 29, 2026 22:06
@edo-chan
edo-chan merged commit fff3fbe into main Oct 30, 2026
7 checks passed
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