Skip to content

feat(config-registry-controller): add state struct for validation in @metamask/wallet - #11671

Open
mikesposito wants to merge 3 commits into
mainfrom
me/config-registry-controller-state-struct
Open

mikesposito wants to merge 3 commits into
mainfrom
me/config-registry-controller-state-struct

Conversation

@mikesposito

@mikesposito mikesposito commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Adding state schema for config-registry-controller to @metamask/wallet


Note

Low Risk
Additive schema and typing with unit tests; runtime controller behavior unchanged aside from stricter type alignment for persisted state shape.

Overview
Introduces a Superstruct-backed ConfigRegistryControllerStateStruct so @metamask/wallet can validate persisted controller state on startup, matching the static readonly struct pattern used elsewhere (e.g. NetworkController).

ConfigRegistryControllerState is now inferred from that struct instead of a hand-written type, with network keys validated via CaipChainIdStruct and RegistryNetworkConfigSchema. Events config gets a shared RegistryEventsConfigStruct reused by both controller state and the events-config API response schema.

Tests cover accepting valid persisted state and rejecting corrupt payloads. The changelog documents the addition.

Reviewed by Cursor Bugbot for commit 88189dd. Bugbot is set up for automated code reviews on this repo. Configure here.

@mikesposito
mikesposito requested review from a team as code owners November 19, 2026 17:14
@mikesposito
mikesposito deployed to default-branch November 19, 2026 17:14 — with GitHub Actions Active
@mikesposito
mikesposito requested a review from a team as a code owner November 19, 2026 17:14
@github-actions

Copy link
Copy Markdown
Contributor

🛑 Files requiring codeowner review

To merge this PR, you'll need to get approvals from the following owner groups.
For files with multiple owners, approval from one owner is sufficient.

@MetaMask/emerging-opportunities or @MetaMask/networks (4 files)
  • packages/config-registry-controller/CHANGELOG.md
  • packages/config-registry-controller/src/config-registry-api-service/types.ts
  • packages/config-registry-controller/src/ConfigRegistryController.test.ts
  • packages/config-registry-controller/src/ConfigRegistryController.ts

ℹ️ Files co-owned by @MetaMask/core-platform (expand for more)

[!NOTE]
For convenience in maintaining this repo, @MetaMask/core-platform co-owns
the following files. It is not required to seek approval from
@MetaMask/core-platform to change these files. This section is purely
informational.

  • packages/config-registry-controller/CHANGELOG.md

@mikesposito mikesposito changed the title feat(config-registry-controller): add state struct for validation in @metamask/wallet feat(config-registry-controller): add state struct for validation in @metamask/wallet Nov 19, 2026

This branch was successfully deployed

1 active (outdated) deployment
default-branch — 042e58b6 Deployed Nov 19, 2026 by mikesposito via Determine whether this PR is a release PR #7403
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.

1 participant