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/170.0.0 #4498

Merged
merged 18 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @montelaidev, any chance you could release the gas-fee-controller? The fix that I need released is #4446.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/core-monorepo",
"version": "169.0.0",
"version": "170.0.0",
"private": true,
"description": "Monorepo for packages shared between MetaMask clients",
"repository": {
Expand Down
15 changes: 14 additions & 1 deletion packages/accounts-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [17.2.0]

### Added

- Add `accountAdded` and `accountRemoved` events ([#4496](https://github.com/MetaMask/core/pull/4496))
- Export `AccountsControllerListMultichainAccounts`,`AccountsControllerGetSelectedMultichainAccount`,`AccountsControllerGetNextAvailableAccountName}Action` actions ([#4497](https://github.com/MetaMask/core/pull/4497))

### Fixed

- Use `listMultichainAccounts` for non-EVM specific methods ([#4494](https://github.com/MetaMask/core/pull/4494))
- Set `lastSelected` for initial account ([#4494](https://github.com/MetaMask/core/pull/4494))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## [17.2.0]
### Added
- Add `accountAdded` and `accountRemoved` events ([#4496](https://github.com/MetaMask/core/pull/4496))
- Export `AccountsControllerListMultichainAccounts`,`AccountsControllerGetSelectedMultichainAccount`,`AccountsControllerGetNextAvailableAccountName}Action` actions ([#4497](https://github.com/MetaMask/core/pull/4497))
### Fixed
- Use `listMultichainAccounts` for non-EVM specific methods ([#4494](https://github.com/MetaMask/core/pull/4494))
- Set `lastSelected` for initial account ([#4494](https://github.com/MetaMask/core/pull/4494))
## [18.0.0]
### Added
- **BREAKING:** `AccountsControllerMessenger` must allow the new internal events `AccountsController:accountAdded` and `AccountsController:accountRemoved`. ([#4496](https://github.com/MetaMask/core/pull/4496))
- Add and export corresponding event types `AccountsControllerAccountAddedEvent`, `AccountsControllerAccountRemovedEvent`.
- Export action types `AccountsControllerListMultichainAccounts`,`AccountsControllerGetSelectedMultichainAccount`,`AccountsControllerGetNextAvailableAccountName}Action`. ([#4497](https://github.com/MetaMask/core/pull/4497))
### Fixed
- Use `listMultichainAccounts` instead of `listAccounts` for non-EVM specific multichain methods. ([#4494](https://github.com/MetaMask/core/pull/4494))
- For initial account, emit `selectedAccountChange ` and update `lastSelected`. ([#4494](https://github.com/MetaMask/core/pull/4494))

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the Fixed entries could be more user-friendly, and less reliant on knowledge of internal variables, but I'm lacking the understanding to come up with better phrasing. @montelaidev could you maybe provide some context on the user-facing changes here?

Copy link
Contributor

@MajorLift MajorLift Jul 3, 2024

Choose a reason for hiding this comment

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

@mcmire Should we see the addition of new internal actions/events as a breaking change?

My initial reasoning was that the added actions/events now need to be present in the generic arguments of the non-restricted controller-messenger, but I'm not sure about this since unlike Allowed{Actions,Events}, we do export ExampleController{Action,Event}s, enabling the consumer to define a controller-messenger without keeping up with changes to the internal actions/events.

Previous discussion: #4413 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

@MajorLift That's the way I've thought about it too: the reason it's a breaking change is that consumers now needs to allowlist that action or event when initializing the messenger, otherwise an error will be thrown when attempting to call or subscribe to that action or event. The fact that the messenger doesn't throw immediately if a used action or event is omitted from the allowlist is unfortunate, but there will be an error eventually.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the fixed entries, they are only internal changes that fixes a bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new events are internal AccountsController events though. It would be a breaking change if they were external actions/events that the AccountsController require.

Copy link
Contributor

@MajorLift MajorLift Jul 3, 2024

Choose a reason for hiding this comment

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

For restricted messengers, only allowlists for external actions/events need to be supplied, but for unrestricted controller-messengers, consumers still define them by enumerating all actions/events e.g.

new ControllerMessenger<
  | AccountsControllerActions 
  | NetworkControllerActions 
  | NetworkControllerAllowedActions, 
  ...,
>();

The part I'm confused about is whether to call this non-breaking because users have access to the union types that fully enumerate internal actions/events, or to call this breaking because users could choose to use individual action/event type exports, in which case they'd need to keep track of additions to the internal actions/events e.g.

new ControllerMessenger<
//   | TokensControllerGetStateAction
  | TokensControllerAddDetectedTokensAction
  | TokensControllerExampleNewAction,
  ...,
>();

(where tokens-controller only has the getState and addDetectedTokens actions)

Copy link
Contributor

@mcmire mcmire Jul 3, 2024

Choose a reason for hiding this comment

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

Hmm, good point. I am inclined in this case not to treat it as a breaking change. My reasoning is that even if a consumer left out AccountsControllerAccountAddedEvent and AccountsControllerAccountRemovedEvent from the type parameter for the unrestricted controller messenger, the controller itself would still be able to emit the event. Whether the consumer is actually subscribing to the event or not is on the consumer, but I don't believe they'd be required to do that in order to upgrade. Does that reasoning make sense?

Copy link
Contributor

@MajorLift MajorLift Jul 3, 2024

Choose a reason for hiding this comment

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

Hmm I was going to argue that adding these new internal actions/events represents additional requirements for the messenger constructor option, and will cause type errors in downstream controller instantiations, especially where we're deriving multiple restricted messengers from one ControllerMessenger.

However, I've found that restricted messengers with incomplete or even empty internal actions/events lists are being accepted by our controller constructors, as long as they have compatible allowlists for external actions/events. I'll have to create a ticket for addressing this.

I think it's accurate to say, at least for now, that this wouldn't be a breaking change for consumers. Once the controller has been instantiated, I agree that it makes sense to only look at whether the controller can publish the new events, and have the controller be agnostic about whether any given messenger (other than its own messagingSystem) subscribes to those events.

Copy link
Contributor

@MajorLift MajorLift Jul 3, 2024

Choose a reason for hiding this comment

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

I put together a playground repro for this.

Looks like constructor controllers do raise a type error if they're passed a messenger that was defined with an incomplete list of internal actions/events, but fail to raise that error if either the Action or Event type union is completely missing all of the controller's internal actions/events. Interesting...


## [17.1.1]

### Fixed
Expand Down Expand Up @@ -233,7 +245,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release ([#1637](https://github.com/MetaMask/core/pull/1637))

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[17.2.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[17.1.1]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[17.1.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[17.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion packages/accounts-controller/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/accounts-controller",
"version": "17.1.1",
"version": "17.2.0",
"description": "Manages internal accounts",
"keywords": [
"MetaMask",
Expand Down
2 changes: 1 addition & 1 deletion packages/assets-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@ethersproject/contracts": "^5.7.0",
"@ethersproject/providers": "^5.7.0",
"@metamask/abi-utils": "^2.0.2",
"@metamask/accounts-controller": "^17.1.1",
"@metamask/accounts-controller": "^17.2.0",
"@metamask/approval-controller": "^7.0.0",
"@metamask/base-controller": "^6.0.0",
"@metamask/contract-metadata": "^2.4.0",
Expand Down
17 changes: 16 additions & 1 deletion packages/gas-fee-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [18.0.0]

### Added

- **BREAKING:** Added back the constructor options legacyAPIEndpoint and EIP1559APIEndpoint. These URLs are no longer hardcoded within the controller.

### Changed

- Changing `providerConfig` to `selectedNetworkClientId` ([#4356](https://github.com/MetaMask/core/pull/4356))

### Removed

- **BREAKING:** Removed the infuraAPIKey. This was used to construct and send the Authorization header for Infura gas API requests. ([#4446](https://github.com/MetaMask/core/pull/4446))
montelaidev marked this conversation as resolved.
Show resolved Hide resolved

## [17.0.0]

### Changed
Expand Down Expand Up @@ -293,7 +307,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

All changes listed after this point were applied to this package following the monorepo conversion.

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[18.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[17.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[16.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[15.1.2]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion packages/gas-fee-controller/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/gas-fee-controller",
"version": "17.0.0",
"version": "18.0.0",
"description": "Periodically calculates gas fee estimates based on various gas limits as well as other data displayed on transaction confirm screens",
"keywords": [
"MetaMask",
Expand Down
9 changes: 8 additions & 1 deletion packages/transaction-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [34.0.0]

### Changed

- **BREAKING:** Bump dependency and peer dependency `@metamask/gas-fee-controller` to `^18.0.0` ([#4498](https://github.com/MetaMask/core/pull/4498))
montelaidev marked this conversation as resolved.
Show resolved Hide resolved

## [33.0.1]

### Changed
Expand Down Expand Up @@ -903,7 +909,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

All changes listed after this point were applied to this package following the monorepo conversion.

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[34.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[33.0.1]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[33.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[32.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
Expand Down
8 changes: 4 additions & 4 deletions packages/transaction-controller/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/transaction-controller",
"version": "33.0.1",
"version": "34.0.0",
"description": "Stores transactions alongside their periodically updated statuses and manages interactions such as approval and cancellation",
"keywords": [
"MetaMask",
Expand Down Expand Up @@ -47,12 +47,12 @@
"@ethersproject/abi": "^5.7.0",
"@ethersproject/contracts": "^5.7.0",
"@ethersproject/providers": "^5.7.0",
"@metamask/accounts-controller": "^17.1.1",
"@metamask/accounts-controller": "^17.2.0",
"@metamask/approval-controller": "^7.0.0",
"@metamask/base-controller": "^6.0.0",
"@metamask/controller-utils": "^11.0.0",
"@metamask/eth-query": "^4.0.0",
"@metamask/gas-fee-controller": "^17.0.0",
"@metamask/gas-fee-controller": "^18.0.0",
"@metamask/metamask-eth-abis": "^3.1.1",
"@metamask/network-controller": "^19.0.0",
"@metamask/nonce-tracker": "^5.0.0",
Expand Down Expand Up @@ -88,7 +88,7 @@
"@babel/runtime": "^7.23.9",
"@metamask/accounts-controller": "^17.0.0",
"@metamask/approval-controller": "^7.0.0",
"@metamask/gas-fee-controller": "^17.0.0",
"@metamask/gas-fee-controller": "^18.0.0",
"@metamask/network-controller": "^19.0.0"
},
"engines": {
Expand Down
10 changes: 9 additions & 1 deletion packages/user-operation-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [13.0.0]

### Changed

- **BREAKING:** Bump dependency and peer dependency `@metamask/gas-fee-controller` to `^18.0.0` ([#4498](https://github.com/MetaMask/core/pull/4498))
- **BREAKING:** Bump dependency and peer dependency `@metamask/transaction-controller` to `^34.0.0` ([#4498](https://github.com/MetaMask/core/pull/4498))

## [12.0.1]

### Changed
Expand Down Expand Up @@ -169,7 +176,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial Release ([#3749](https://github.com/MetaMask/core/pull/3749))

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[13.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[12.0.1]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[12.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[11.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
Expand Down
10 changes: 5 additions & 5 deletions packages/user-operation-controller/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/user-operation-controller",
"version": "12.0.1",
"version": "13.0.0",
"description": "Creates user operations and manages their life cycle",
"keywords": [
"MetaMask",
Expand Down Expand Up @@ -46,12 +46,12 @@
"@metamask/base-controller": "^6.0.0",
"@metamask/controller-utils": "^11.0.0",
"@metamask/eth-query": "^4.0.0",
"@metamask/gas-fee-controller": "^17.0.0",
"@metamask/gas-fee-controller": "^18.0.0",
"@metamask/keyring-controller": "^17.1.0",
"@metamask/network-controller": "^19.0.0",
"@metamask/polling-controller": "^8.0.0",
"@metamask/rpc-errors": "^6.2.1",
"@metamask/transaction-controller": "^33.0.1",
"@metamask/transaction-controller": "^34.0.0",
"@metamask/utils": "^8.3.0",
"bn.js": "^5.2.1",
"immer": "^9.0.6",
Expand All @@ -71,10 +71,10 @@
},
"peerDependencies": {
"@metamask/approval-controller": "^7.0.0",
"@metamask/gas-fee-controller": "^17.0.0",
"@metamask/gas-fee-controller": "^18.0.0",
"@metamask/keyring-controller": "^17.0.0",
"@metamask/network-controller": "^19.0.0",
"@metamask/transaction-controller": "^33.0.0"
"@metamask/transaction-controller": "^34.0.0"
},
"engines": {
"node": "^18.18 || >=20"
Expand Down
22 changes: 11 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2195,7 +2195,7 @@ __metadata:
languageName: node
linkType: hard

"@metamask/accounts-controller@npm:^17.1.1, @metamask/accounts-controller@workspace:packages/accounts-controller":
"@metamask/accounts-controller@npm:^17.2.0, @metamask/accounts-controller@workspace:packages/accounts-controller":
version: 0.0.0-use.local
resolution: "@metamask/accounts-controller@workspace:packages/accounts-controller"
dependencies:
Expand Down Expand Up @@ -2313,7 +2313,7 @@ __metadata:
"@ethersproject/contracts": "npm:^5.7.0"
"@ethersproject/providers": "npm:^5.7.0"
"@metamask/abi-utils": "npm:^2.0.2"
"@metamask/accounts-controller": "npm:^17.1.1"
"@metamask/accounts-controller": "npm:^17.2.0"
"@metamask/approval-controller": "npm:^7.0.0"
"@metamask/auto-changelog": "npm:^3.4.4"
"@metamask/base-controller": "npm:^6.0.0"
Expand Down Expand Up @@ -2940,7 +2940,7 @@ __metadata:
languageName: node
linkType: hard

"@metamask/gas-fee-controller@npm:^17.0.0, @metamask/gas-fee-controller@workspace:packages/gas-fee-controller":
"@metamask/gas-fee-controller@npm:^18.0.0, @metamask/gas-fee-controller@workspace:packages/gas-fee-controller":
version: 0.0.0-use.local
resolution: "@metamask/gas-fee-controller@workspace:packages/gas-fee-controller"
dependencies:
Expand Down Expand Up @@ -3771,7 +3771,7 @@ __metadata:
languageName: node
linkType: hard

"@metamask/transaction-controller@npm:^33.0.1, @metamask/transaction-controller@workspace:packages/transaction-controller":
"@metamask/transaction-controller@npm:^34.0.0, @metamask/transaction-controller@workspace:packages/transaction-controller":
version: 0.0.0-use.local
resolution: "@metamask/transaction-controller@workspace:packages/transaction-controller"
dependencies:
Expand All @@ -3782,15 +3782,15 @@ __metadata:
"@ethersproject/abi": "npm:^5.7.0"
"@ethersproject/contracts": "npm:^5.7.0"
"@ethersproject/providers": "npm:^5.7.0"
"@metamask/accounts-controller": "npm:^17.1.1"
"@metamask/accounts-controller": "npm:^17.2.0"
"@metamask/approval-controller": "npm:^7.0.0"
"@metamask/auto-changelog": "npm:^3.4.4"
"@metamask/base-controller": "npm:^6.0.0"
"@metamask/controller-utils": "npm:^11.0.0"
"@metamask/eth-json-rpc-provider": "npm:^4.0.0"
"@metamask/eth-query": "npm:^4.0.0"
"@metamask/ethjs-provider-http": "npm:^0.3.0"
"@metamask/gas-fee-controller": "npm:^17.0.0"
"@metamask/gas-fee-controller": "npm:^18.0.0"
"@metamask/keyring-api": "npm:^8.0.0"
"@metamask/metamask-eth-abis": "npm:^3.1.1"
"@metamask/network-controller": "npm:^19.0.0"
Expand Down Expand Up @@ -3819,7 +3819,7 @@ __metadata:
"@babel/runtime": ^7.23.9
"@metamask/accounts-controller": ^17.0.0
"@metamask/approval-controller": ^7.0.0
"@metamask/gas-fee-controller": ^17.0.0
"@metamask/gas-fee-controller": ^18.0.0
"@metamask/network-controller": ^19.0.0
languageName: unknown
linkType: soft
Expand All @@ -3833,12 +3833,12 @@ __metadata:
"@metamask/base-controller": "npm:^6.0.0"
"@metamask/controller-utils": "npm:^11.0.0"
"@metamask/eth-query": "npm:^4.0.0"
"@metamask/gas-fee-controller": "npm:^17.0.0"
"@metamask/gas-fee-controller": "npm:^18.0.0"
"@metamask/keyring-controller": "npm:^17.1.0"
"@metamask/network-controller": "npm:^19.0.0"
"@metamask/polling-controller": "npm:^8.0.0"
"@metamask/rpc-errors": "npm:^6.2.1"
"@metamask/transaction-controller": "npm:^33.0.1"
"@metamask/transaction-controller": "npm:^34.0.0"
"@metamask/utils": "npm:^8.3.0"
"@types/jest": "npm:^27.4.1"
bn.js: "npm:^5.2.1"
Expand All @@ -3854,10 +3854,10 @@ __metadata:
uuid: "npm:^8.3.2"
peerDependencies:
"@metamask/approval-controller": ^7.0.0
"@metamask/gas-fee-controller": ^17.0.0
"@metamask/gas-fee-controller": ^18.0.0
"@metamask/keyring-controller": ^17.0.0
"@metamask/network-controller": ^19.0.0
"@metamask/transaction-controller": ^33.0.0
"@metamask/transaction-controller": ^34.0.0
languageName: unknown
linkType: soft

Expand Down
Loading