Skip to content

[#551] Guard commitment NFT storage migrations - #561

Merged
1nonlypiece merged 1 commit into
Commitlabs-Org:masterfrom
Baskarayelu:feat/issue-551-migration-guards
Aug 27, 2026
Merged

1nonlypiece merged 1 commit into
Commitlabs-Org:masterfrom
Baskarayelu:feat/issue-551-migration-guards

Conversation

@Baskarayelu

Copy link
Copy Markdown
Contributor

Summary

  • record the current schema version for fresh commitment NFT deployments
  • reject unsupported and mismatched source versions before migration writes
  • require the legacy admin, counter, and token-index schema before proceeding
  • preserve the v1 instance-storage token index when moving to persistent storage
  • initialize only the missing reentrancy guard and write the v2 marker last
  • add representative old-layout fixtures covering migration, authorization, idempotency, and partial state
  • document storage keys, version meanings, write ordering, and operational recovery

Issue coverage

  • Unsupported storage versions fail before mutation
  • Existing commitments and balances retain their meaning after migration
  • Migration is authorized and idempotent
  • Tests cover old fixtures, partial state, repeated migration, and unsupported version data
  • Existing package checks remain green
  • Design, tradeoffs, test evidence, and limitations are documented

Validation

  • cargo +1.88.0 test -p commitment_nft — 20 passed
  • rustfmt --edition 2021 --config skip_children=true --check contracts/commitment_nft/src/lib.rs
  • git diff --check
  • Diff: 508 additions, 7 deletions

Note: the repository’s legacy feature-gated src/tests.rs contains a pre-existing parse error that prevents recursive cargo fmt; the changed files were checked without traversing that unrelated module.

Closes #551

@1nonlypiece
1nonlypiece merged commit 1b6ff8a into Commitlabs-Org:master Aug 27, 2026
0 of 2 checks passed
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.

[Quality] Validate upgrade migrations against live storage schemas

2 participants