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
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.
Background
The contract CI installs its toolchain with
dtolnay/rust-toolchain@stablein every job (Format & lint, Build & test, and the bounded Fuzz job), and there is norust-toolchain.tomlin the repo to pin a version.@stableresolves 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
mainbecause the calendar rolled forward.What needs to be done
rust-toolchain.tomlat the repo root that pinschannelto a specific stable version (for example"1.9x.y"), and declarestargets = ["wasm32-unknown-unknown"]andcomponents = ["rustfmt", "clippy"]so every environment provisions the same target and tools automatically.dtolnay/rust-toolchain@stablestep in.github/workflows/ci.ymlto install that same pinned version (set the action'stoolchain:input to the exact version), so CI and localrustupagree and there's a single source of truth.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— theInstall Rust stablesteps across the Format & lint, Build & test, and Fuzz jobsrust-toolchain.tomlat the repo rootAcceptance criteria
rust-toolchain.tomlpins the channel to a specific stable version and declares the wasm target and rustfmt/clippy components@stable/stableNotes
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.