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 161.0.0 #4413

Merged
merged 33 commits into from
Jun 12, 2024
Merged

Release 161.0.0 #4413

merged 33 commits into from
Jun 12, 2024

Conversation

ccharly
Copy link
Contributor

@ccharly ccharly commented Jun 12, 2024

Explanation

This release contains the following packages:

  • @metamask/accounts-controller (major)
  • @metamask/assets-controllers (major)
  • @metamask/chain-controller (minor)
  • @metamask/keyring-controller (minor)
  • @metamask/selected-network-controller (patch)
  • @metamask/transaction-controller (major)

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@danroc
Copy link
Contributor

danroc commented Jun 12, 2024

selected-network-controller should be a patch (original PR, cc @jiexi)

@ccharly ccharly changed the title Release/161.0.0 Release 161.0.0 Jun 12, 2024
@ccharly ccharly marked this pull request as ready for review June 12, 2024 12:38
@ccharly ccharly requested a review from a team as a code owner June 12, 2024 12:38
@desi desi requested a review from a team June 12, 2024 14:00
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.

Entry for @metamask/seelected-network-controller LGTM

- **BREAKING:** Newly added account is no longer set as the last selected account ([#4363](https://github.com/MetaMask/core/pull/4363))
- Bump `@metamask/eth-snap-keyring` to `^4.3.1` ([#4405](https://github.com/MetaMask/core/pull/4405))
- Bump `@metamask/keyring-api` to `^8.0.0` ([#4405](https://github.com/MetaMask/core/pull/4405))
- Bump `@metamask/keyring-controller` to `^17.1.0` (`devDependencies`) ([#4413](https://github.com/MetaMask/core/pull/4413))
Copy link
Contributor

@MajorLift MajorLift Jun 12, 2024

Choose a reason for hiding this comment

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

Hmm we generally don't include devDeps bumps in the changelog, but I'm not sure why keyring-controller isn't a dependency.

That might be a holdover from a past state when keyring-controller only supplied types to accounts-controller?

@mcmire Should we recategorize keyring-controller as a dependency for accounts-controller at some point?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm good with doing that in another PR as well.

This isn't the only case I've seen where a package needed to be moved to a different level. So we (Wallet Framework team) should probably go through all packages and audit them to ensure that any controller package that should be in dependencies and/or peerDependencies should be there. In addition I think knowing how to express dependencies on packages that are only for types — and knowing how to express dependencies that are used in conjunction with the messenger — has been a constant source of confusion, we should add documentation somewhere that explains our position.

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right, this should be moved to dependency now. To not block this release, i'll update this in another PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good!

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh weird my comment got added in the wrong place. Well you got the idea :)


- **BREAKING:** Add `messenger` as a constructor option for `AccountTrackerController` ([#4225](https://github.com/MetaMask/core/pull/4225))
- Add `AccountTrackerControllerMessenger` type
- `NftController` now allows `AccountsController:getAccount`, `AccountsController:getSelectedAccount` as messenger actions and subscribes to the `AccountsController:selectedEvmAccountChange` messenger event ([#4221](https://github.com/MetaMask/core/pull/4221))
Copy link
Contributor

@mcmire mcmire Jun 12, 2024

Choose a reason for hiding this comment

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

Saying that the controller allows the actions/events is a bit inaccurate; it would be better to say that the messenger that the controller takes must allow these actions/events. If the consumer isn't doing that currently and upgrades this package, then they will see a type and runtime error when the NftController constructor is run, so that makes this a breaking change:

Suggested change
- `NftController` now allows `AccountsController:getAccount`, `AccountsController:getSelectedAccount` as messenger actions and subscribes to the `AccountsController:selectedEvmAccountChange` messenger event ([#4221](https://github.com/MetaMask/core/pull/4221))
- **BREAKING:** The `NftController` messenger must now allow `AccountsController:getAccount` and `AccountsController:getSelectedAccount` as messenger actions and `AccountsController:selectedEvmAccountChange` as a messenger event ([#4221](https://github.com/MetaMask/core/pull/4221))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initially we had that BREAKING prefix yes, but after discussing with @MajorLift, I understood this was not considered a "real" breaking changes. Anyway, I do agree with your suggestion, so let's re-add it. :)

Copy link
Contributor

@MajorLift MajorLift Jun 12, 2024

Choose a reason for hiding this comment

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

I agree with Elliot's description of the desired behavior, but it doesn't appear that we have type or runtime error guardrails in controller constructor for subtype messengers. Passing in messengers with incomplete or never allowlists into controller constructors seems to work fine.

Runtime errors are thrown, but only when call and subscribe/unsubscribe (or more accurately #isAllowedAction, #isAllowedEvent) is being invoked for the omitted actions/events.

I'll experiment with this a bit more in the test files since I might just be doing something wrong.

Edit: Created a base-controller ticket for this #4414

packages/assets-controllers/CHANGELOG.md Outdated Show resolved Hide resolved
- **BREAKING:** Newly added account is no longer set as the last selected account ([#4363](https://github.com/MetaMask/core/pull/4363))
- Bump `@metamask/eth-snap-keyring` to `^4.3.1` ([#4405](https://github.com/MetaMask/core/pull/4405))
- Bump `@metamask/keyring-api` to `^8.0.0` ([#4405](https://github.com/MetaMask/core/pull/4405))
- Bump `@metamask/keyring-controller` to `^17.1.0` (`devDependencies`) ([#4413](https://github.com/MetaMask/core/pull/4413))
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm good with doing that in another PR as well.

This isn't the only case I've seen where a package needed to be moved to a different level. So we (Wallet Framework team) should probably go through all packages and audit them to ensure that any controller package that should be in dependencies and/or peerDependencies should be there. In addition I think knowing how to express dependencies on packages that are only for types — and knowing how to express dependencies that are used in conjunction with the messenger — has been a constant source of confusion, we should add documentation somewhere that explains our position.

packages/chain-controller/CHANGELOG.md Outdated Show resolved Hide resolved
packages/assets-controllers/CHANGELOG.md Outdated Show resolved Hide resolved
packages/assets-controllers/CHANGELOG.md Outdated Show resolved Hide resolved
packages/transaction-controller/CHANGELOG.md Outdated Show resolved Hide resolved
packages/assets-controllers/CHANGELOG.md Outdated Show resolved Hide resolved
packages/assets-controllers/CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@MajorLift do you have any more thoughts?

@ccharly ccharly merged commit 190f08c into main Jun 12, 2024
113 checks passed
@ccharly ccharly deleted the release/161.0.0 branch June 12, 2024 17:38
@gantunesr
Copy link
Member

Sorry @mcmire and @MajorLift! We missed that last comment (@MajorLift do you have any more thoughts?) before merging

@MajorLift
Copy link
Contributor

@gantunesr No worries, everything looks good to me! :)

- Add `enable` and `disable` methods to `TokenRatesController` ([#4314](https://github.com/MetaMask/core/pull/4314))
- These are used to stop and restart polling.
- Export `ContractExchangeRates` type ([#4314](https://github.com/MetaMask/core/pull/4314))
- Add `AccountTrackerControllerMessenger` type
Copy link
Contributor

@MajorLift MajorLift Jun 12, 2024

Choose a reason for hiding this comment

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

Ah looks like this belongs under line 14.

Leaving this comment as reference to be fixed by a future PR covering AccountTrackerController.

mcmire added a commit that referenced this pull request Jun 12, 2024
## Explanation

This release contains the following packages:

- `@metamask/accounts-controller` (major)
- `@metamask/assets-controllers` (major)
- `@metamask/chain-controller` (minor)
- `@metamask/keyring-controller` (minor)
- `@metamask/selected-network-controller` (patch)
- `@metamask/transaction-controller` (major)

<!--
## References
-->

<!--
Are there any issues that this pull request is tied to? Are there other
links that reviewers should consult to understand these changes better?

For example:

* Fixes #12345
* Related to #67890
-->

<!--
## Changelog

If you're making any consumer-facing changes, list those changes here as
if you were updating a changelog, using the template below as a guide.

(CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or
FIXED. For security-related issues, follow the Security Advisory
process.)

Please take care to name the exact pieces of the API you've added or
changed (e.g. types, interfaces, functions, or methods).

If there are any breaking changes, make sure to offer a solution for
consumers to follow once they upgrade to the changes.

Finally, if you're only making changes to development scripts or tests,
you may replace the template below with "None".

### `@metamask/package-a`

- **<CATEGORY>**: Your change here
- **<CATEGORY>**: Your change here

### `@metamask/package-b`

- **<CATEGORY>**: Your change here
- **<CATEGORY>**: Your change here
-->
## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've highlighted breaking changes using the "BREAKING" category
above as appropriate

---------

Co-authored-by: Jongsun Suh <[email protected]>
Co-authored-by: Elliot Winkler <[email protected]>
@MajorLift MajorLift mentioned this pull request Jul 3, 2024
3 tasks
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.

9 participants