Skip to content

refactor(sdk): derive storage slot names from package and struct#1035

Merged
bitwalker merged 2 commits intonextfrom
i1009-storage-slot-name-format
Mar 26, 2026
Merged

refactor(sdk): derive storage slot names from package and struct#1035
bitwalker merged 2 commits intonextfrom
i1009-storage-slot-name-format

Conversation

@greenhat
Copy link
Copy Markdown
Contributor

Close #1009

This PR is stacked on #995 and should be merged after it.

This PR updates component storage slot naming to remove the fixed miden::component prefix and derive slot names from the component package,
component struct, and field name instead of the previous package-only format.

The macro now:

  • generates slot names in the stable format
    <component-package-or-name>::<component-struct>::<field-name>
  • strips any package version suffix before deriving the slot name so the on-chain storage ABI
    remains stable across package version bumps
  • adds unit coverage for the new slot-name derivation logic

The PR also updates integration tests and mockchain helpers to use the new derived slot names for
the counter contract, auth component, and storage example metadata expectations.

Replace the fixed  prefix with  so component storage keeps meaningful namespaces while preserving a stable slot-name ABI. Update the integration metadata and mockchain expectations to match the new derived names.
@greenhat greenhat marked this pull request as ready for review March 26, 2026 15:34
@greenhat greenhat requested a review from bitwalker March 26, 2026 15:35
Base automatically changed from pr/migrate-to-v0.21.1 to next March 26, 2026 16:59
@bitwalker bitwalker merged commit 373c634 into next Mar 26, 2026
12 checks passed
@bitwalker bitwalker deleted the i1009-storage-slot-name-format branch March 26, 2026 17:17
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.

Consider generating recommended storage slot name format

2 participants