-
Notifications
You must be signed in to change notification settings - Fork 5.2k
refactor: Add MultichainRouter to new controller instantiation pattern #31951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
refactor: Add MultichainRouter to new controller instantiation pattern #31951
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
app/scripts/controller-init/messengers/multichain/multichain-router-messenger.ts
Outdated
Show resolved
Hide resolved
app/scripts/controller-init/messengers/multichain/multichain-router-messenger.ts
Outdated
Show resolved
Hide resolved
messenger: controllerMessenger, | ||
// Binding the call to provide the selector only giving the controller the option to pass the operation | ||
withSnapKeyring: (...args) => | ||
// @ts-expect-error mistmatch with the withSnapKeyring signature and withKeyring. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an issue tracking this mismatch we can link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think we need an issue tracking this specifically. Frederik is aware that this hook needs to be called from the messenger inside the MultichainRouter implementation which will allow us to remove it here and resolves the type issue
Builds ready [bed7cd6]
UI Startup Metrics (1191 ± 62 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Builds ready [3aa4834]
UI Startup Metrics (1221 ± 67 ms)
Benchmark value 33 exceeds gate value 31 for chrome browserify home p95 getState Benchmark value 187 exceeds gate value 175 for chrome webpack home mean firstPaint Benchmark value 319 exceeds gate value 310 for chrome webpack home p95 firstPaint Benchmark value 74 exceeds gate value 70 for firefox browserify home p95 backgroundConnect Benchmark value 1943 exceeds gate value 1935 for firefox webpack home p95 uiStartup Benchmark value 1680 exceeds gate value 1660 for firefox webpack home p95 load Benchmark value 1679 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded Benchmark value 46 exceeds gate value 45 for firefox webpack home p95 backgroundConnect Benchmark value 1644 exceeds gate value 1630 for firefox webpack home p95 loadScripts Sum of mean exceeds: 12ms | Sum of p95 exceeds: 77ms Sum of all benchmark exceeds: 89ms Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
const controller = new MultichainRouter({ | ||
messenger: controllerMessenger, | ||
// Binding the call to provide the selector only giving the controller the option to pass the operation | ||
withSnapKeyring: (...args) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need to rethink this as we had to make a change to this function to unblock the release.
Description
Cleans up the MultichainRouter instantiation by moving it int othe new controller instantiation pattern.
Related issues
See: https://github.com/orgs/MetaMask/projects/146/views/6?pane=issue&itemId=105350449&issue=MetaMask%7CMetaMask-planning%7C4599
Manual testing steps
No user facing changes
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist