wallet: Make and record an init-messenger pattern decision

未关闭
#8,790 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@grypez 已经在做这个了。

开始于 2026年5月26日。

评估

这个 Issue 还没有评估数据。

描述

team-ocap-kernel
Problem

The extension and mobile clients both create two restricted messengers per controller: a controller messenger (runtime, narrow privileges) and an init messenger (boot-only, broader privileges for one-shot setup steps). The wallet currently uses a single messenger per controller. Whether to adopt the two-messenger pattern is unresolved and undocumented. Without a written decision, every new controller wired into the wallet inherits this ambiguity silently.

Proposed direction

Evaluate the trade-offs and write a short decision document (init-messenger-decision.md) in the wallet package recording the chosen approach and the concrete conditions under which it should be revisited. Link from the package README.

To inform the decision, gather empirical data on which messenger actions are invoked during init() vs. at runtime across the controllers already wired (see sub-issue for tooling). If the init-time and runtime allowlists are effectively the same, the two-messenger pattern adds boilerplate without narrowing any privileges — which favors deferring adoption.

Acceptance
  • A decision is made and written down in packages/wallet/init-messenger-decision.md.
  • The document covers: which pattern is chosen, why, and what conditions would trigger revisiting.
  • packages/wallet/README.md links to the decision document.
Context
  • Extension reference: app/scripts/messenger-client-init/ — getInitMessenger / getMessenger factory pattern.
  • Mobile reference: app/core/Engine/messengers/ — same dual-factory convention.
Subissues
  • #8791
主要语言
TypeScript
星标
422
派生
313
平均合并
1 天 8 小时
30 天内合并 PR
414

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

MetaMask/core 的其他 Issue

查看 MetaMask/core 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。