Skip to content

Pin the CI Rust toolchain to a fixed stable version #29

Description

@Meshmulla

Background

The contract CI installs its toolchain with dtolnay/rust-toolchain@stable in every job (Format & lint, Build & test, and the bounded Fuzz job), and there is no rust-toolchain.toml in the repo to pin a version. @stable resolves to whatever the latest stable release happens to be at the moment each CI run executes — which means the toolchain used to build the project silently changes over time, without any commit to the repo.

That is a real, recurring source of "it was green yesterday and red today" breakage. A new stable release can introduce or tighten a Clippy lint (and CI runs clippy -D warnings, so a brand-new warning becomes a hard failure), or a transitive dependency can stop compiling on a newer rustc. This exact class of failure has already bitten this repo and its siblings.

Why this matters

Pinning the toolchain makes builds reproducible and deterministic: the same commit builds the same way today, next month, and on every contributor's machine. Upgrades still happen — but as an intentional, reviewed change (bump the pin, watch CI go green) rather than an invisible surprise that lands on main because the calendar rolled forward.

What needs to be done

  • Add a rust-toolchain.toml at the repo root that pins channel to a specific stable version (for example "1.9x.y"), and declares targets = ["wasm32-unknown-unknown"] and components = ["rustfmt", "clippy"] so every environment provisions the same target and tools automatically.
  • Update each dtolnay/rust-toolchain@stable step in .github/workflows/ci.yml to install that same pinned version (set the action's toolchain: input to the exact version), so CI and local rustup agree and there's a single source of truth.
  • Pick a recent stable version that the current code already builds cleanly against, so that pinning is a no-op for correctness — fmt, clippy -D warnings, build, test, and the wasm release build should all still pass with nothing else changing.

Where to look

  • .github/workflows/ci.yml — the Install Rust stable steps across the Format & lint, Build & test, and Fuzz jobs
  • New file to add: rust-toolchain.toml at the repo root

Acceptance criteria

  • rust-toolchain.toml pins the channel to a specific stable version and declares the wasm target and rustfmt/clippy components
  • Every CI job installs that same pinned version — no remaining floating @stable/stable
  • fmt, clippy, build, test, and the wasm release build all pass on the pinned version
  • CI checks must be green before the PR can be merged

Notes

Choosing a version the code already compiles cleanly on keeps this purely a stability change with no functional impact. Future upgrades are then a deliberate one-line bump.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignenhancementNew feature or requestgood first issueGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions