Skip to content

deps: migrate rust workspace to solana 3.0#3830

Open
juan-malbeclabs wants to merge 12 commits into
mainfrom
jo/solana-3.0-bump
Open

deps: migrate rust workspace to solana 3.0#3830
juan-malbeclabs wants to merge 12 commits into
mainfrom
jo/solana-3.0-bump

Conversation

@juan-malbeclabs

Copy link
Copy Markdown
Contributor

Summary of Changes

  • Migrate the entire Rust workspace from solana-sdk 2.3.x to the solana 3.0 line plus the granular split crates (solana-pubkey, solana-instruction, solana-cpi, solana-sdk-ids, solana-system-interface, solana-commitment-config, solana-compute-budget-interface), aligning with the doublezero-solana programs. This unblocks composing offchain RFC-20 CLI module crates (e.g. passport) into the unified doublezero binary, which previously failed because those crates transitively require solana 3.x.
  • Adapt the onchain programs to the 3.0 APIs: AccountInfo::reallocresize, system-program / BPF-upgradeable-loader IDs move to solana-sdk-ids, ProgramError::BorshIoError is now a unit variant, and AccountInfo::new drops its rent_epoch argument. The programs build toolchain moves to Rust 1.91.
  • Adapt the off-chain crates (SDK, serviceability CLI, sentinel, admin, client): the moved commitment_config / compute_budget / system_instruction modules, the now-boxed ClientError.kind, the UiTransactionErrorTransactionError conversion, and Keypair::from_bytesKeypair::try_from.
  • SBF builds now require platform-tools ≥ v1.52 (the 3.0 dependency tree pulls edition2024 crates needing Cargo ≥ 1.85). The Makefile pins --tools-version v1.54 via SBF_TOOLS_VERSION, and CI installs agave v3.0.4.
  • Onchain account layouts are unchanged: regenerated fixtures are byte-identical, so the Go, TypeScript, and Python SDKs are unaffected.

Testing Verification

  • Whole workspace compiles against solana 3.0; off-chain clippy clean with -Dclippy::all -Dwarnings, and program clippy clean with the same flags.
  • ~1250 host tests pass (serviceability 506; geolocation; sdk 149; serviceability-cli 315; cli-core 29; geo-cli 48; sentinel 61; admin 8; client 141).
  • All four programs build to SBF and all SBF program tests pass: serviceability 506, geolocation 105, telemetry 59, record 24 (including the telemetry integration tests that CPI into serviceability).
  • All three fixture generators regenerate byte-identical fixtures, confirming account layouts did not change.
  • doublezero accounts deserializes live devnet, testnet, and mainnet accounts successfully against the migrated SDK.

Note for reviewers: this bump exceeds the ~500-line PR guideline, but the change is almost entirely mechanical API adaptation across the workspace and is most coherent as a single atomic cutover (a partial bump does not compile, since the workspace shares one solana version).

Bump the entire Rust workspace from solana-sdk 2.3.x to the solana 3.0
line plus the granular split crates (solana-pubkey, solana-instruction,
solana-cpi, solana-sdk-ids, solana-system-interface,
solana-commitment-config, solana-compute-budget-interface), aligning with
the doublezero-solana programs.

Onchain programs adapt to the 3.0 APIs (AccountInfo::resize,
solana-sdk-ids for system/loader IDs, ProgramError::BorshIoError unit
variant, AccountInfo::new without rent_epoch) and move to the Rust 1.91
build toolchain. Off-chain crates adapt the moved modules
(commitment_config, compute_budget, system_instruction), the boxed
ClientError.kind, the UiTransactionError conversion, and Keypair::try_from.

SBF builds now require platform-tools >= v1.52; the Makefile pins
--tools-version v1.54 and CI installs agave v3.0.4. Account layouts are
unchanged: regenerated fixtures are byte-identical, so the Go, TypeScript,
and Python SDKs are unaffected.
Bump the e2e base image SOLANA_VERSION to v3.0.4 and pass
--tools-version v1.54 to the program cargo build-sbf steps, matching the
workspace solana 3.0 migration.
… daily release

The record validator test, the local start-test helpers, and the daily
devnet program-release workflow each invoke cargo build-sbf directly. Pin
--tools-version v1.54 (overridable via SBF_TOOLS_VERSION) so they build the
solana 3.0 program dependency tree, which needs Cargo >= 1.85 (the default
platform-tools v1.51 ships Cargo 1.84.x).
The local_validator_test-gated record_tests integration test imported
CommitmentConfig from solana_sdk::commitment_config, which moved to the
solana-commitment-config crate in solana 3.0. This test is only compiled
under --cfg local_validator_test (run_record_test.sh), so it was missed by
the regular cargo test build.
@elitegreg

Copy link
Copy Markdown
Contributor

Findings

1) Low: Program rust-version metadata is now stale vs toolchain bump

  • Files:
    • smartcontract/programs/rust-toolchain.toml:3
    • smartcontract/programs/common/Cargo.toml:5
    • smartcontract/programs/doublezero-record/Cargo.toml:5
    • smartcontract/programs/doublezero-serviceability/Cargo.toml:5
    • smartcontract/programs/doublezero-telemetry/Cargo.toml:5
    • smartcontract/programs/doublezero-geolocation/Cargo.toml:5

The PR bumps the programs toolchain to 1.91 and also documents needing newer Cargo/platform-tools for the Solana 3.0 dependency tree, but program crates still declare rust-version = "1.84.1".

This is mostly metadata/documentation drift, but it can mislead local automation and contributors about the true minimum supported toolchain.

Suggested fix: update these rust-version values (or comments) to match the actual minimum expected for this branch.

@elitegreg elitegreg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except the rust-version issue pointed out above.

WaitForTunnelUp returns as soon as the already-up first tunnel is up, so the
single-shot post-connect doublezero status assertion could race the onchain
propagation of the incrementally-added second multicast group and the daemon's
5s-cached program data. Poll doublezero user list until both clients show both
groups before the post-connect checks, mirroring the modify_roles subtest.
ben-dz added 3 commits June 29, 2026 14:13
Resolve 6 manifest/lock conflicts. Restore reqwest json feature in sentinel and declare solana-commitment-config for client/doublezero after the doublezero-admin retirement landed on main. Off-chain workspace compiles under solana 3.0 and passes make rust-lint; SBF build unverified locally on arm64-linux, CI covers it.
solana 3.0 pulls aws-lc-sys into the CLI via rustls/quinn, which would raise a gnu-linked binary's glibc floor above Ubuntu 22.04. Build the CLI for x86_64-unknown-linux-musl instead: a fully static binary that loads on any Linux regardless of glibc, and ~5% smaller than the dynamic gnu build. Replaces rust-cli-no-aws-lc with rust-cli-static, which builds for musl and asserts the binary is statically linked.
…ilds

The musl switch needs musl-tools and the x86_64-unknown-linux-musl rust target wherever the client goreleaser config is built. release.client.yml already had it; add it to release.pipeline.validation.yml (the release-validation-client check that regressed) and release.daily.yml (devnet client nightly). The CC/linker env comes from the goreleaser config.
@ben-dz ben-dz reopened this Jun 30, 2026
ben-dz added 3 commits June 30, 2026 10:26
x86_64-unknown-linux-musl produces a static-PIE binary that file reports as 'static-pie linked', not 'statically linked'. Accept both so the fully-static musl CLI passes the check.
…on tests

The permission-flag PRs merged from main added authorize tests calling the pre-3.0 8-arg AccountInfo::new (Epoch::default() rent_epoch). Solana 3.0 dropped rent_epoch (7 args); remove it to match the rest of the v3 migration. Fixes the rust-lint lib-test compile break surfaced by the merge.
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.

3 participants