Repository navigation
feat(kyc-controller): expose ensureLocalUserSecret for reducing startSession execution time by precreating the localUserSecret - #11099
Merged
jiexi merged 7 commits intoOct 29, 2026
Conversation
ensureLocalUserSecret for reducing startSession execution time by precreating the localUserSecret
Co-authored-by: Cursor <cursoragent@cursor.com>
The prepare job calls the compare API, which is currently rate limited, so lint and test never start. Compute the merge base with git in that case, and read the pull request head ref from the event for changelog diff checks. Co-authored-by: Cursor <cursoragent@cursor.com>
Akaryatrh
previously approved these changes
Oct 27, 2026
Contributor
There was a problem hiding this comment.
why are these file changed needed?
Member
Author
There was a problem hiding this comment.
they shouldn't be. I have no idea why Cursor did this. I'll revert
ci: fall back when GitHub API rate limits block merge-base lookup
…ler-early-localUserSecret-generation Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # packages/kyc-controller/CHANGELOG.md # packages/kyc-controller/src/KycController.test.ts
…et-generation Co-authored-by: Cursor <cursoragent@cursor.com>
…okup" This reverts commit 98e8e38.
jiexi
deleted the
jl/KYC-68/kyc-controller-early-localUserSecret-generation
branch
October 29, 2026 18:35
This was referenced Oct 29, 2026
Merged
Naz-Ovh
pushed a commit
to 0x-fork/metamask-core
that referenced
this pull request
Nov 4, 2026
## Explanation Scoped release so clients can pick up MetaMask#11158 and MetaMask#11099. Monorepo release **1378.0.0** because [Release/1377.0.0](MetaMask#11203) is already open. - **`@metamask/kyc-controller` 0.13.0 → 0.14.0** (minor). Both changes are additive, so they stay in one minor. - `KycService.getDataShares` and `KycController.getDataShares` list the vendors a customer's verified identity data has been shared with (MetaMask#11158). Both are messenger actions. No new controller state, and no change to existing methods. - `KycController.ensureLocalUserSecret` creates and stores the UKYC `local_user_secret` when one does not already exist (MetaMask#11099). `startSession` still creates the secret when this method has not been called. The secret is not returned. No workspace package depends on `kyc-controller`, so nothing else is published. Other packages with unreleased changes are deferred. ## References - Ships MetaMask#11158 - Ships MetaMask#11099 - Unblocks MetaMask/metamask-mobile#38381 ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > The diff is version and changelog metadata only; functional changes were merged in earlier PRs and are not modified here. > > **Overview** > This is a **scoped release PR** that bumps the monorepo to **1378.0.0** and publishes **`@metamask/kyc-controller` 0.13.0 → 0.14.0**, with the package changelog cut from `[Unreleased]` into **`[0.14.0]`** (compare links updated accordingly). No application source files change in this diff—only `package.json` versions and `CHANGELOG.md`. > > The **0.14.0** notes document additive KYC work clients can pick up after publish, including **`getDataShares`** on the service and controller (messenger actions, no new persisted state), **`ensureLocalUserSecret`** to create/store the UKYC `local_user_secret` before session start when desired, optional **`currentStep`** on session status (plus related **`finalStatus`** mapping when step is `kyc`), and the associated exports/types called out in the changelog. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit b880f85. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: jiexi <jiexiluan@gmail.com>
Naz-Ovh
pushed a commit
to 0x-fork/metamask-core
that referenced
this pull request
Nov 4, 2026
## Explanation Reverts MetaMask#11205 (`Release 1378.0.0`), which was merged before its predecessor [Release/1377.0.0](MetaMask#11203) had been released. The release numbering assumed 1377 would land first, so this release has to come off `main`. The revert restores: - Root version `1378.0.0` → `1376.0.0` - `@metamask/kyc-controller` `0.14.0` → `0.13.0` - The `ensureLocalUserSecret` (MetaMask#11099), `getDataShares` (MetaMask#11158) and `currentStep` (MetaMask#11094) entries move back under `[Unreleased]` Nothing was published. The `main` run for the merge failed on an unrelated `rate-limit-controller` test, so the `Publish release` job was skipped. No tags were created, and npm still lists `@metamask/kyc-controller` at `0.13.0`. ## References - Reverts MetaMask#11205 ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them Made with [Cursor](https://cursor.com) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Version and changelog-only revert with no code changes; aligns `main` with unpublished release state. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 9311ab8. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Naz-Ovh
pushed a commit
to 0x-fork/metamask-core
that referenced
this pull request
Nov 4, 2026
## Explanation Release **1380.0.0**. This PR bumps `@metamask/kyc-controller` from `0.13.0` to `0.14.0` (minor). The unreleased changelog adds public API: optional `currentStep` on `KycSessionStatus`, `KycController.ensureLocalUserSecret`, and `getDataShares` on both the service and the controller, plus their exported types. It also maps a session that reports `finalStatus: pending` with `currentStep: kyc` back to `finalStatus: new`, which restores the previous meaning of `pending` (only after SumSub is fully submitted). That behavior change is not marked breaking. The root monorepo version is bumped to `1380.0.0`. No other package in this repo depends on `@metamask/kyc-controller`, so no other packages are included. Dev-only commits since `0.13.0` (the `nock` bump and a test import change) are left out of the changelog. ## References - Ships [MetaMask#11094](MetaMask#11094), [MetaMask#11099](MetaMask#11099), and [MetaMask#11158](MetaMask#11158) - Previous merged release: [MetaMask#11210](MetaMask#11210) ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate (N/A: version bump and changelog only) - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate (N/A) - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them (N/A: no breaking changes) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Version and changelog-only release with no new runtime changes in this PR; consumer impact comes from the already-merged kyc-controller APIs and status mapping described in the changelog. > > **Overview** > This PR cuts **release 1380.0.0** for the core monorepo by bumping the root version from `1379.0.0` to **1380.0.0** > > It publishes **`@metamask/kyc-controller` `0.14.0`**, moving the existing Unreleased changelog into a **`[0.14.0]`** section and updating compare links. There is **no application code in the diff**—only version and changelog housekeeping. > > The **0.14.0** notes document what consumers get from earlier merged work: optional **`currentStep`** on **`KycSessionStatus`**, **`ensureLocalUserSecret`**, **`getDataShares`** on the service and controller, related exports, and a **behavior tweak** that maps API **`pending` + `currentStep: kyc`** back to **`finalStatus: new`** so partially submitted flows are not treated like post–SumSub pending. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1727a26. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Signed-off-by: Sébastien Van Eyck <sebastien.vaneyck@consensys.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently 17%
startSession()execution time is from the localUserSecret creation process. This PR exposes a newensureLocalUserSecretmethod which can be called (and not necessarily awaited) earlier in onboarding flow before callingstartSessionto create a new session.Fixes: https://consensyssoftware.atlassian.net/browse/KYC-68
Note
Medium Risk
Touches UKYC cryptographic material and Encrypted User Storage writes, but reuses existing secret creation logic without changing startSession fallback behavior.
Overview
Adds
KycController.ensureLocalUserSecretand theKycController:ensureLocalUserSecretmessenger action so onboarding can create and persist the UKYClocal_user_secretin Encrypted User Storage beforestartSession, moving entropy generation and the storage write off the session-creation path (intended to cutstartSessionlatency).The method is idempotent (no-op when a valid secret already exists), does not return the secret, and leaves controller state unchanged.
startSessionstill uses the samegetOrCreateLocalUserSecretpath if this was never called or failed. Docs onstartSessionnow recommend callingensureLocalUserSecretafter the user commits to onboard.Exports
KycControllerEnsureLocalUserSecretAction, updates the changelog, and adds unit tests (create/store, reuse, concurrent calls,startSessionread-only follow-up, storage errors, messenger wiring).Reviewed by Cursor Bugbot for commit 375ccfd. Bugbot is set up for automated code reviews on this repo. Configure here.