Skip to content

Commit 7e29a2d

Browse files
authored
docs(noir-contracts): document standard-contract re-pin consequences (#24890)
1 parent dfcdea6 commit 7e29a2d

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ When staging files, prefer `git add -u` or name specific files rather than `git
5757
Never bulk-update lockfiles (`Cargo.lock`, `yarn.lock`). Use targeted updates only: `cargo update --precise <version> --package <name>` for Rust, and `yarn up <package>@<version>` in the relevant workspace for TypeScript. Bulk updates drag in unrelated transitive changes that make review impossible and frequently break reproducibility.
5858
</lockfile_discipline>
5959

60+
<standard_contract_repin>
61+
Never run `noir-projects/noir-contracts/bootstrap.sh pin-standard-build` on your own initiative. The pin exists so ordinary source or bytecode changes do NOT move the standard contracts' canonical addresses, and CI does not fail when the bytecode drifts. A re-pin is a deliberate redeploy decision for a human to make: if a change seems to need one, leave the pin, rebuild against it, and ask. See the comment on `pin-standard-build` for why re-pinning is breaking.
62+
</standard_contract_repin>
63+
6064
</git_workflow>
6165

6266
<code_formatting>

noir-projects/noir-contracts/bootstrap.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,13 @@ function format {
267267
}
268268

269269
# Force-builds standard contracts and tar-balls their artifacts into pinned-standard-contracts.tar.gz.
270-
# Run this to (re)pin the standard-contract artifacts, then commit the resulting tarball. Re-run and
271-
# re-commit whenever the canonical standard-contract artifacts are intended to change.
270+
#
271+
# WARNING: re-pinning (running this, then committing the new tarball) moves the standard contracts'
272+
# canonical deterministic addresses and class ids. Rebuilding changes the artifact hash and bytecode
273+
# commitment, which changes the class id and the address derived from it. Those addresses are baked
274+
# into every already-deployed network and published package, so a re-pin breaks compatibility with all
275+
# of them and means the standard contracts must be redeployed at their new addresses on any network
276+
# meant to run the new artifacts. It is only correct as part of a deliberate, coordinated redeploy.
272277
# Mirrors the v4 `pin-build` mechanism that pins protocol contracts.
273278
function pin-standard-build {
274279
rm -f pinned-standard-contracts.tar.gz

0 commit comments

Comments
 (0)