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

cherry-pick(v12.1.1): Bump @metamask/eth-json-rpc-middleware to ^14.0.0 (#26143) #26626

Merged
merged 12 commits into from
Aug 30, 2024

Conversation

MajorLift
Copy link
Contributor

@MajorLift MajorLift commented Aug 22, 2024

Description

Cherry-pick of #26143 for v12.1.0-rc v12.1.1-rc.

This is a very different PR from the original, as I had to remove diffs to a significant amount of code that has not yet been introduced to the release candidate.

The diffs that were excluded here will need to be reapplied to a future release. I'm also keeping an eye out for new cherry-picks that may introduce changes requiring me to restore certain diffs.

Aligning @metamask/eth-block-tracker to ^11.0.1 is deferred, as it's blocked by #26150, which is not included in this release candidate. The @metamask/transaction-controller major version bump from ^34.0.0 to ^35.1.1 is also removed for now.

See below for new changelog.

Changelog

Added

  • Add and export PPOMMiddlewareRequest type for JsonRpcRequest types
    that include the securityAlertResponse property.
    • securityAlertResponse is defined as both optional and nullable.
  • Add PPOMRequest type for eth-sendTransaction requests.

Changed

  • BREAKING: Bump @metamask/eth-json-rpc-middleware from ^12.1.1
    to ^14.0.0.
  • Bump @trezor/connect-web from 9.2.2 to 9.3.0.

Fixed

  • BREAKING: Narrow Params generic parameter of
    createPPOMMiddleware function from JsonRpcParams to (string | { to: string })[].
  • Add Params generic parameter to handleSnapRequest function, which
    is constrained by Record<string, unknown> and defaults to JsonRpcParams.
    • handleSnapRequest can now be typed correctly with any params
      object.

Security

  • BREAKING: Typed signature validation only replaces 0X prefix
    with 0x, and contract address normalization is removed for decimal and
    octal values.
    • Threat actors have been manipulating eth_signTypedData_v4 fields to
      cause failures in blockaid's detectors.
    • Extension crashes with an error when performing Malicious permit with
      a non-0x prefixed integer address.
    • This fixes an issue where the key value row or petname component
      disappears if a signed address is prefixed by "0X" instead of "0x".

Manual testing steps

Screenshots/Recordings

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

This comment was marked as resolved.

@metamaskbot metamaskbot added INVALID-PR-TEMPLATE PR's body doesn't match template team-wallet-framework labels Aug 22, 2024
@MajorLift

This comment was marked as outdated.

@MajorLift

This comment was marked as outdated.

@MajorLift

This comment was marked as outdated.

@MajorLift

This comment was marked as outdated.

@metamaskbot

This comment was marked as outdated.

@metamaskbot

This comment was marked as outdated.

@MajorLift

This comment was marked as outdated.

@metamaskbot

This comment was marked as outdated.

@MajorLift MajorLift force-pushed the chore/cherry-pick-26143 branch from c4f5329 to 29d7f50 Compare August 22, 2024 19:00
@MajorLift

This comment was marked as outdated.

@MajorLift MajorLift force-pushed the chore/cherry-pick-26143 branch from 29d7f50 to 6498b33 Compare August 22, 2024 19:40
@metamaskbot

This comment was marked as outdated.

@MajorLift

This comment was marked as outdated.

@metamaskbot

This comment was marked as outdated.

@MajorLift MajorLift force-pushed the chore/cherry-pick-26143 branch from 77ae327 to d6d7ca3 Compare August 22, 2024 20:29
@MajorLift MajorLift marked this pull request as ready for review August 22, 2024 20:47
@MajorLift MajorLift requested review from a team as code owners August 22, 2024 20:47
@MajorLift MajorLift force-pushed the chore/cherry-pick-26143 branch from d6d7ca3 to 44264fa Compare August 22, 2024 20:51
@Gudahtt Gudahtt added the DO-NOT-MERGE Pull requests that should not be merged label Aug 22, 2024
@Gudahtt
Copy link
Member

Gudahtt commented Aug 22, 2024

We'll be targeting this for v12.1.1 instead, so I've temporarily labelled this as DO-NOT-MERGE until that RC is ready to target.

@metamaskbot
Copy link
Collaborator

Builds ready [44264fa]
Page Load Metrics (251 ± 259 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint76128103168
domContentLoaded115825136
load502108251539259
domInteractive115825136

Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.84%. Comparing base (0ef30b9) to head (433c309).
Report is 1 commits behind head on Version-v12.1.1.

Additional details and impacted files
@@               Coverage Diff                @@
##           Version-v12.1.1   #26626   +/-   ##
================================================
  Coverage            69.84%   69.84%           
================================================
  Files                 1371     1371           
  Lines                48791    48795    +4     
  Branches             13453    13455    +2     
================================================
+ Hits                 34074    34078    +4     
  Misses               14717    14717           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

yarn.lock Outdated Show resolved Hide resolved
@MajorLift

This comment was marked as outdated.

@MajorLift MajorLift force-pushed the chore/cherry-pick-26143 branch from f0d58d1 to 694db65 Compare August 23, 2024 17:57
@MajorLift MajorLift force-pushed the chore/cherry-pick-26143 branch from 267aa11 to b59c933 Compare August 30, 2024 15:44
@MajorLift
Copy link
Contributor Author

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated

@@ -171,19 +176,28 @@ export const getInitialSendStateWithExistingTxState = (draftTxState) => ({
});

export function createMockInternalAccount({
Copy link
Contributor Author

@MajorLift MajorLift Aug 30, 2024

Choose a reason for hiding this comment

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

I had to partially cherry-pick a commit in develop (#25980) that converts test/jest/mocks.js into TypeScript, because the params types of createMockInternalAccount were being incompletely inferred from the JavaScript code, causing conflicting type errors downstream. Supplying the correct type information in TypeScript was the only solution.

@metamaskbot
Copy link
Collaborator

Builds ready [9df53e5]
Page Load Metrics (67 ± 21 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint62341975728
domContentLoaded95624147
load41248674421
domInteractive95624147

yarn.lock Show resolved Hide resolved
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

Mostly looks good! But I think we can trim down these lock file changes further

@MajorLift
Copy link
Contributor Author

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated

@Gudahtt Gudahtt dismissed their stale review August 30, 2024 17:20

Requested change has been made

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@metamaskbot
Copy link
Collaborator

Builds ready [433c309]
Page Load Metrics (243 ± 256 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint77147104189
domContentLoaded105322126
load451875243533256
domInteractive105322126

@metamaskbot
Copy link
Collaborator

Builds ready [433c309]
Page Load Metrics (243 ± 256 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint77147104189
domContentLoaded105322126
load451875243533256
domInteractive105322126

@MajorLift MajorLift merged commit abe7da4 into Version-v12.1.1 Aug 30, 2024
66 checks passed
@MajorLift MajorLift deleted the chore/cherry-pick-26143 branch August 30, 2024 17:57
@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2024
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Aug 30, 2024
@metamaskbot metamaskbot added the release-12.2.0 Issue or pull request that will be included in release 12.2.0 label Sep 3, 2024
@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-12.2.0 on PR, as PR was cherry-picked in branch 12.2.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template release-12.2.0 Issue or pull request that will be included in release 12.2.0 team-wallet-framework
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants