Skip to content

chore: update contract migrations after 3.14 release - #4081

Merged
gilcu3 merged 2 commits into
mainfrom
4080-contract-migration-cleanup-after-3140-release
Aug 6, 2026
Merged

chore: update contract migrations after 3.14 release#4081
gilcu3 merged 2 commits into
mainfrom
4080-contract-migration-cleanup-after-3140-release

Conversation

@gilcu3

@gilcu3 gilcu3 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Closes #4080

@gilcu3 gilcu3 linked an issue Aug 6, 2026 that may be closed by this pull request
@gilcu3
gilcu3 marked this pull request as ready for review August 6, 2026 08:39
@claude

claude Bot commented Aug 6, 2026

Copy link
Copy Markdown

Pull request overview

Routine post-release migration cleanup: the 3.13.0 state shadow is replaced by a 3.14.0 one, and the archived "production" contract binary rolls forward to signer-3_14_0.wasm. Because nothing in MpcContract's borsh layout has changed since the 3.14.0 release cut (#4060 merged 2026-08-05 09:47Z; no PR touching crates/contract/src has landed since), the new shadow can reuse the live types verbatim and the migration becomes an identity conversion. The launcher-expiry and legacy-mock stamping steps that shipped in 3.14.0 are dropped along with the old module, which also removes the last TODO(#3978) reference.

Changes:

  • Adds crates/contract-history/archive/signer-3_14_0.wasm (1 187 525 B) and version_3_14_0(); repoints current_mainnet()/current_testnet() at it.
  • Deletes v3_13_0_state.rs (incl. OldConfig/OldTeeState/OldAllowedLauncherImage shadows, stamp_expiry_on_legacy_mocks, and their unit tests); adds v3_14_0_state.rs as a field-for-field identity shadow; migrate() now reads the 3.14.0 shadow.
  • Drops the now-unused migration constructor AllowedLauncherImages::from_entries.
  • Trims 3.13.0-specific comments from the sandbox upgrade test.

Reviewed changes

Per-file summary
File Description
crates/contract-history/archive/signer-3_14_0.wasm New archived production binary (sha256 c64ecba1…7422). The ~322 KB drop vs 3.13.0 is consistent with #3714 dropping dcap-qvl.
crates/contract-history/src/lib.rs Adds version_3_14_0(); current_mainnet()/current_testnet() now return it.
crates/contract/src/lib.rs pub mod v3_14_0_state; migrate() reads the 3.14.0 shadow and logs against it.
crates/contract/src/tee/proposal.rs Removes AllowedLauncherImages::from_entries (only caller was the deleted migration; verified no remaining references).
crates/contract/src/v3_13_0_state.rs Deleted — shadow types, stamp_expiry_on_legacy_mocks, and three unit tests.
crates/contract/src/v3_14_0_state.rs New shadow: 14 fields in the same order/types as crate::MpcContract (lib.rs:167-191), identity From impl guarded on Running.
crates/contract/tests/sandbox/upgrade_to_current_contract.rs Comment-only: de-versions the launcher-hash setup/assert comments.

Verified locally: shadow field list and order match crate::MpcContract exactly; every import in the new module is used; AllowedLauncherImage::new, with_expiry_capped_at, current_time_seconds, and the test helpers used by the deleted tests all retain other callers, so no dead code is left behind. Cargo test: contract (which runs -p mpc-contract, including sandbox::upgrade_to_current_contract) is green on this PR, so the 3.14.0 → HEAD upgrade path — with a non-empty launcher entries vec — is exercised.

Findings

Blocking (must fix before merge):

  • crates/contract-history/src/lib.rs:1-7 — Confirm 3.14.0 is actually the code deployed at v1.signer and v1.signer-prod.testnet before merging. current_mainnet()/current_testnet() are asserted against the on-chain code hash by mainnet_contract_should_be_up_to_date/testnet_contract_should_be_up_to_date (lib.rs:83-99), but that workflow only triggers on push: main, tags, schedule and dispatch (.github/workflows/external-services-tests.yml:8-14), so no check on this PR covers the claim. The timing is what makes it worth pausing on: the release landed 2026-08-05 and this PR is dated 2026-08-06, whereas the analogous 3.13.0 cleanup (chore(contract): cleanup migrations after 3.13.0 release #3771) landed 16 days after that release. If either network is still on 3.13.0, then (a) the external-services job goes red on main right after merge, and (b) deleting v3_13_0_state removes the only path off 3.13.0 — a network upgrading straight from 3.13.0 to the next release would fail both branches in migrate() and hit env::panic_str at crates/contract/src/lib.rs:2139, reverting the deploy until the shadow is restored. If deployment on both networks is confirmed done, this is a non-issue and the rest of the PR looks correct.

Non-blocking (nits, follow-ups, suggestions):

  • docs/design/auto-remove-launcher-hashes-design.md:124-128 — The ## Migration section still describes the migration this PR deletes ("existing entries get expires_at = migration time + TTL … The 3.13.0 migration also stamps an expiry on legacy MockAttestation::Valid entries"). Per CLAUDE.md §Documentation alignment, mark it as historical in the same PR, e.g. "Shipped in 3.14.0; the migration code was removed in chore: update contract migrations after 3.14 release #4081."
  • crates/contract/src/tee/proposal.rs:376-377 — The tie example on latest_expiry_index ("e.g. right after a migration stamps every entry with the same expires_at") now refers to code that no longer exists. Ties are still reachable (two hashes voted in within the same block, since expiry_from_now derives from Timestamp::now()), so just re-point the example.
  • crates/contract/src/v3_14_0_state.rs:32 — "see this module's history for examples" won't resolve: the examples live in the deleted v3_13_0_state.rs, and the add+delete pair is far below git's rename-similarity threshold (432 → 75 lines), so git log --follow on this path shows nothing. Reference the deleted file or this PR instead.
  • PR body — TODO(#3978) was the only reference to issue Remove the legacy-mock expiry-stamping migration once it is superseded #3978 ("Remove the legacy-mock expiry-stamping migration once it is superseded"), which is still open and is exactly what this PR does. Consider adding Closes #3978 alongside Closes #4080.

⚠️ Issues found

anodar
anodar previously approved these changes Aug 6, 2026

@anodar anodar 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.

Thanks!

@gilcu3
gilcu3 added this pull request to the merge queue Aug 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Aug 6, 2026
@gilcu3
gilcu3 dismissed stale reviews from haiyuechen-nearone and anodar via 1c94f31 August 6, 2026 11:48
@gilcu3
gilcu3 enabled auto-merge August 6, 2026 11:48
@gilcu3
gilcu3 added this pull request to the merge queue Aug 6, 2026
Merged via the queue into main with commit 38d9984 Aug 6, 2026
15 checks passed
@gilcu3
gilcu3 deleted the 4080-contract-migration-cleanup-after-3140-release branch August 6, 2026 12:11
barakeinav1 added a commit that referenced this pull request Aug 6, 2026
#4081 replaced `v3_13_0_state.rs` with `v3_14_0_state.rs` after the 3.14.0
release, so the grants-map initialisation moves to the new shadow state: state
deployed at 3.14.0 still needs the empty map.

Also, per review: `DEFAULT_ATTESTATION_STORAGE_FEE_MILLINEAR` was sitting inside
the "Gas Defaults (in TeraGas)" block, which it is not — moved below it and cut
to one line. `AttestationGrantsV1` loses the suffix, matching the last several
keys added (the file's own note says renaming is safe).
kevindeforth pushed a commit that referenced this pull request Aug 18, 2026
kevindeforth pushed a commit that referenced this pull request Aug 19, 2026
kevindeforth pushed a commit that referenced this pull request Aug 19, 2026
kevindeforth pushed a commit that referenced this pull request Aug 19, 2026
kevindeforth pushed a commit that referenced this pull request Aug 19, 2026
kevindeforth added a commit that referenced this pull request Aug 19, 2026
Co-authored-by: Reynaldo Gil Pons <gilcu3@gmail.com>
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.

Contract migration cleanup after 3.14.0 release

3 participants