Skip to content

refactor(standards): rename PSM references to Guardian#2728

Open
giwaov wants to merge 1 commit into0xMiden:nextfrom
giwaov:fix/rename-psm-to-guardian
Open

refactor(standards): rename PSM references to Guardian#2728
giwaov wants to merge 1 commit into0xMiden:nextfrom
giwaov:fix/rename-psm-to-guardian

Conversation

@giwaov
Copy link
Copy Markdown

@giwaov giwaov commented Apr 4, 2026

Summary

Replace all PSM (Private State Manager) references with Guardian across the codebase.

Changes

File renames

  • psm.masm -> guardian.masm
  • multisig_psm.masm -> multisig_guardian.masm
  • multisig_psm.rs -> multisig_guardian.rs
  • Test file multisig_psm.rs -> multisig_guardian.rs

Type renames

  • AuthMultisigPsm -> AuthMultisigGuardian
  • AuthMultisigPsmConfig -> AuthMultisigGuardianConfig
  • PsmConfig -> GuardianConfig

MASM renames

  • Module path miden::standards::auth::psm -> miden::standards::auth::guardian
  • Component path miden::standards::components::auth::multisig_psm -> miden::standards::components::auth::multisig_guardian
  • All PSM-prefixed constants (PSM_MAP_KEY, PSM_PUBLIC_KEYS_SLOT, etc.) -> Guardian equivalents
  • All PSM-prefixed procedure names and comments

Other

  • Storage slot names updated: miden::standards::auth::psm::pub_key -> miden::standards::auth::guardian::pub_key (and scheme)
  • Updated CHANGELOG, comments, test names, and variable names
  • All 13 affected files updated consistently

Verification

  • cargo check -p miden-standards passes
  • cargo check -p miden-testing --tests passes
  • cargo clippy -p miden-standards -p miden-testing -- -D warnings passes
  • git grep -rni psm returns zero results in source files

Closes #2665

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR performs a repo-wide terminology refactor, replacing “PSM (Private State Manager)” with “Guardian” across the Miden standards and testing crates, including Rust APIs and MASM modules/components.

Changes:

  • Renames the multisig+PSM authentication component and related types/configs to multisig+Guardian equivalents.
  • Replaces the MASM psm module with a guardian module and updates the multisig-guardian component wrapper to call it.
  • Updates miden-testing helpers/tests and public interfaces to use the new Guardian names.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/miden-testing/tests/auth/multisig_guardian.rs Updates multisig tests to use AuthMultisigGuardian* and Guardian-specific tx scripts/signatures.
crates/miden-testing/tests/auth/mod.rs Switches test module import from multisig_psm to multisig_guardian.
crates/miden-testing/src/mock_chain/auth.rs Renames mock-chain auth variant and wiring from PSM to Guardian types/config.
crates/miden-standards/src/account/interface/extension.rs Updates component-to-library procedure digest exposure for the Guardian multisig component.
crates/miden-standards/src/account/interface/component.rs Renames interface enum variant + storage-slot extraction calls to Guardian.
crates/miden-standards/src/account/components/mod.rs Renames shipped library loader and standard component enum variant to Guardian.
crates/miden-standards/src/account/auth/multisig/mod.rs Updates multisig docs to refer to Guardian in the “private account” caution note.
crates/miden-standards/src/account/auth/multisig_guardian.rs Introduces/renames the Rust multisig-guardian component + storage slot names and metadata.
crates/miden-standards/src/account/auth/mod.rs Re-exports Guardian multisig types instead of PSM multisig types.
crates/miden-standards/asm/standards/auth/psm.masm Removes the old PSM MASM auth module.
crates/miden-standards/asm/standards/auth/guardian.masm Adds the new Guardian MASM auth module (update key + conditional signature verification).
crates/miden-standards/asm/standards/auth/multisig.masm Updates comment to reference Guardian as an example optional check.
crates/miden-standards/asm/account_components/auth/multisig_guardian.masm Updates component wrapper to use ...::guardian and renames auth proc/exported procedures.
CHANGELOG.md Updates changelog wording from PSM to Guardian for the referenced feature addition.
Comments suppressed due to low confidence (5)

crates/miden-standards/src/account/auth/multisig_guardian.rs:83

  • GuardianConfig still uses "Private state manager public keys" in the storage schema description. This looks like a leftover from the rename and will surface in metadata/schema introspection; update the description string to refer to Guardian instead.
    crates/miden-standards/src/account/auth/multisig_guardian.rs:110
  • Comments in GuardianConfig::into_component_parts still refer to "Private state manager" for the public key / scheme slots. These should be updated to "guardian" to avoid misleading future maintainers.
    crates/miden-standards/src/account/auth/multisig_guardian.rs:35
  • This change renames the storage slot names from miden::standards::auth::psm::* to miden::standards::auth::guardian::*. Because StorageSlotName is part of the persisted account storage layout, this will make existing accounts created with the old PSM component unable to find their configured key/scheme unless a migration/alias is provided. If backward compatibility is required, consider keeping the underlying slot names stable (still ...::psm::...) while renaming only the Rust/MASM module/type names, or add a migration path/document this as a breaking change.
    crates/miden-standards/src/account/auth/multisig_guardian.rs:186
  • Doc comment grammar: "With Guardian is configured" is ungrammatical/unclear. Reword to something like "When a Guardian is configured" / "When the Guardian signer is configured" to make the behavior description clear.
    crates/miden-standards/src/account/auth/multisig_guardian.rs:119
  • slot_metadata includes Self::auth_scheme_slot_schema(), but that schema currently still describes the slot as "Private state manager scheme IDs". Please update the description string in auth_scheme_slot_schema() to refer to Guardian scheme IDs instead, to keep metadata consistent with the rename.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

/// It enforces a threshold of approver signatures for every transaction, with optional
/// per-procedure threshold overrides. Non-uniform thresholds (especially a threshold of one)
/// should be used with caution for private multisig accounts, without Private State Manager (PSM),
/// should be used with caution for private multisig accounts, without Guardian,
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc comment reads awkwardly after the rename: "without Guardian,". Consider clarifying this as "without a guardian signer" (or similar), so it’s clear this refers to the additional guardian-signature check rather than the component itself.

Suggested change
/// should be used with caution for private multisig accounts, without Guardian,
/// should be used with caution for private multisig accounts: without a guardian signer,

Copilot uses AI. Check for mistakes.
@giwaov giwaov force-pushed the fix/rename-psm-to-guardian branch from 7473e36 to 60d75c7 Compare April 5, 2026 08:47
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.

Rename PSM references to Guardian

2 participants