Skip to content
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

Release 93.0.0 #2063

Merged
merged 20 commits into from
Nov 22, 2023
Merged

Release 93.0.0 #2063

merged 20 commits into from
Nov 22, 2023

Conversation

mcmire
Copy link
Contributor

@mcmire mcmire commented Nov 17, 2023

This release primarily features backward-incompatible type fixes and changes to the messenger types in base-controller. As a result, all of the controllers are being bumped.

@mcmire mcmire force-pushed the release/93.0.0 branch 2 times, most recently from b0f6b67 to 68f861c Compare November 17, 2023 21:59
@@ -30,7 +30,7 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@metamask/base-controller": "^3.2.3",
"@metamask/base-controller": "^4.0.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is here as it was added automatically, but this package is not being released yet, as there are other pending items to complete in order to publish this package.

@Gudahtt
Copy link
Member

Gudahtt commented Nov 21, 2023

Anything else we need to include in this before it's ready?

@mcmire
Copy link
Contributor Author

mcmire commented Nov 21, 2023

@MajorLift Did you want to get #2051 in this release? it will be a breaking change, so we might want to group it together with the other breaking changes to base-controller.

@MajorLift
Copy link
Contributor

@mcmire Yes #2051 is ready for review! Tests are all passing on local.

Comment on lines +11 to +18
- Add new handler to `permissionRpcMethods.handlers` for `wallet_revokePermissions` RPC method ([#1889](https://github.com/MetaMask/core/pull/1889))

### Changed
- **BREAKING:** Bump `@metamask/base-controller` to ^4.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
- This is breaking because the type of the `messenger` has backward-incompatible changes. See the changelog for this package for more.
- **BREAKING:** Update `PermittedRpcMethodHooks` type so it must support signature for `wallet_revokePermission` hook ([#1889](https://github.com/MetaMask/core/pull/1889))
- Bump `@metamask/approval-controller` to ^5.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
- Bump `@metamask/controller-utils` to ^6.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM! @shanejonas wdyt?

@mcmire
Copy link
Contributor Author

mcmire commented Nov 21, 2023

Update: We're also looking to pull in #2078.

matthewwalsh0 and others added 7 commits November 22, 2023 10:19
Re-add initApprovals method to allow client to finish initialisation before creating approvals.
Remove unnecessary gas property update during initialisation since transactions are not added to the state until gas properties are updated.
Normalise the gas fee values provided to speedUpTransaction and stopTransaction to support the extension arguments.
Update the transaction after the afterSign hook to persist any updated properties.
Report success to the result callback after publish is skipped to unblock the UI during the MMI flows.
Set the value parameter to 0x0 if not specified.
Limit properties updated by updateCustodianTransaction so it can initially be used for hash and status updates only, with more general MMI updates continuing to use updateTransaction.
Align nonce logic with mobile.
Update post transaction balance of swaps transactions after internal transactions.
…2078)

## Motivation

The controller-messenger pattern implemented by `BaseControllerV2` is
intended to be used by all of our controllers. Currently, the default
`BaseController` name points to the older base controller
implementation, which needs to be deprecated and only used for temporary
backwards compatibility while all controllers are brought up-to-date.

## Explanation

In this commit, we export `BaseControllerV2` as the default
`BaseController`, and add a `@deprecated` tsdoc tag to the old
`BaseController` class as well as export it under the new name
`BaseControllerV1` to discourage future usage.

This aligns with the `PollingController` naming scheme, where the
up-to-date version is the default, and outdated mixins are named with
qualifiers (`PollingControllerOnly`, `PollingControllerV1`).

## Impact

Existing controller classes in core that extend from the old base
controller are not affected — they now simply extend from
`BaseControllerV1` instead of `BaseController`.

External packages will need to update any instances of `extends
BaseController` to `extends BaseControllerV1` and `extends
BaseControllerV2` to `extends BaseController`, along with accompanying
changes to import statements.

---------

Co-authored-by: Elliot Winkler <[email protected]>
…ot initialized with internal actions/events in allow lists (#2051)

## Explanation

- `RestrictedControllerMessenger` constructor and
`ControllerMessenger.getRestricted()` method now raise a type error if
an internal action is passed into `allowedActions`, or an internal event
into `allowedEvents`.
	- ` Type 'string' is not assignable to type 'never'.`
- `Type '"SomeController:internalAction"' is not assignable to type
'"OtherController:externalAction1" |
"OtherController:externalAction2"'.`
- Fixes breaking tests in downstream controllers in core repo.

## Impact

- The `allowed{Actions,Events}` arrays in
`ControllerMessenger.getRestricted()` now align with the
`Allowed{Actions,Events}` generic params of
`RestrictedControllerMessenger`: Both only enumerate external
actions/events.
- This commit disallows `allowed{Actions,Events}` arrays that contain an
incomplete list of internal actions/events.
- A partial list doesn't provide any useful information as all internal
actions/events will be available to the messenger regardless of whether
any of them are allowlisted.
- A partial list also gives the confusing impression that some internal
actions/events can be *disallowed* through omission, which is not true
as of #2050.

---------

Co-authored-by: Elliot Winkler <[email protected]>
@mcmire mcmire marked this pull request as ready for review November 22, 2023 17:50
@mcmire mcmire requested review from a team as code owners November 22, 2023 17:50
Comment on lines +11 to +24
- **BREAKING**: `TokenRatesControllerState` now has required `contractExchangeRatesByChainId` property which an object keyed by `chainId` and `nativeCurrency` ([#2015](https://github.com/MetaMask/core/pull/2015))
- **BREAKING**: `TokenRatesController` constructor params now requires `getNetworkClientById` ([#2015](https://github.com/MetaMask/core/pull/2015))
- Add types `CurrencyRateControllerEvents` and `CurrencyRateControllerActions` ([#2029](https://github.com/MetaMask/core/pull/2029))
- Add polling-related methods to TokenRatesController ([#2015](https://github.com/MetaMask/core/pull/2015))
- `startPollingByNetworkClientId`
- `stopPollingByPollingToken`
- `stopAllPolling`
- `_executePoll`
- Add `updateExchangeRatesByChainId` method to TokenRatesController ([#2015](https://github.com/MetaMask/core/pull/2015))
- This is a lower-level version of `updateExchangeRates` that takes chain ID, native currency, and token addresses.
- `TokenRatesController` constructor params now accepts optional `interval` and `threshold` ([#2015](https://github.com/MetaMask/core/pull/2015))
- `TokenRatesController.fetchExchangeRate()` now accepts an optional `tokenAddresses` as the last parameter ([#2015](https://github.com/MetaMask/core/pull/2015))
- `TokenRatesController.getChainSlug()` now accepts an optional `chainId` parameter ([#2015](https://github.com/MetaMask/core/pull/2015))
- `TokenRatesController.fetchAndMapExchangeRates()` now accepts an optional `tokenAddresses` as the last parameter ([#2015](https://github.com/MetaMask/core/pull/2015))
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks right to me. @jiexi can you confirm?

Comment on lines -33 to +43
"@metamask/base-controller": "^3.2.3",
"@metamask/controller-utils": "^5.0.2",
"@metamask/base-controller": "^4.0.0",
"@metamask/controller-utils": "^6.0.0",
"@metamask/json-rpc-engine": "^7.3.0",
"@metamask/network-controller": "^16.0.0",
"@metamask/network-controller": "^17.0.0",
"@metamask/rpc-errors": "^6.1.0",
"@metamask/selected-network-controller": "^3.1.2",
"@metamask/selected-network-controller": "^4.0.0",
"@metamask/swappable-obj-proxy": "^2.1.0",
"@metamask/utils": "^8.2.0"
},
"devDependencies": {
"@metamask/approval-controller": "^4.1.0",
"@metamask/approval-controller": "^5.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

@BelfordZ any concerns with these bumps?

shanejonas
shanejonas previously approved these changes Nov 22, 2023
matthewwalsh0
matthewwalsh0 previously approved these changes Nov 22, 2023
adonesky1
adonesky1 previously approved these changes Nov 22, 2023
Copy link
Contributor

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

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

LGTM

@mcmire mcmire merged commit f1c3042 into main Nov 22, 2023
128 checks passed
@mcmire mcmire deleted the release/93.0.0 branch November 22, 2023 19:41
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.

8 participants