You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 7, 2024. It is now read-only.
This PR updates @metamask/eth-sig-util package to ^6, which includes a change on the normalize function that affects how empty strings and 0 inputs are treated, and since @metamask/eth-keyring-controller normalizes data passed to signPersonalMessage since v11, I think this change should be breaking also for @metamask/eth-keyring-controller.
Changes
BREAKING: signPersonalMessage now normalizes msgParams.data in a different way for 0 and empty strings inputs.
0 will be normalized to 0x00 and empty strings to 0x
Though... is this breaking? I can see that it's called a lot with the address parameter, but that's intended to be an address. I'm not sure any of these methods worked in the first place if an empty string or zero was passed in. And certainly MetaMask would never pass in either of those, we don't let RPC calls get to the keyring until after verifying the address.
I guess for it's uses on addresses, it's breaking only due to a lack of expressive types/validation prior to this, but not in a way that impacts us.
The only exception to that is for the personal sign method. In that case, we use this normalize function for the data as well. Again the expectation seems clear that it's meant to be a hex string, but this might affect "empty" personal sign signatures potentially.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR updates
@metamask/eth-sig-utilpackage to^6, which includes a change on thenormalizefunction that affects how empty strings and0inputs are treated, and since@metamask/eth-keyring-controllernormalizes data passed tosignPersonalMessagesince v11, I think this change should be breaking also for@metamask/eth-keyring-controller.Changes
signPersonalMessagenow normalizesmsgParams.datain a different way for0and empty strings inputs.0will be normalized to0x00and empty strings to0xReferences
Checklist