-
Notifications
You must be signed in to change notification settings - Fork 722
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
Fix: 1271 sig validation chainId validation #5428
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious why this is needed in the first place ? Shouldn't we process the verification even if we don't have a namespace ?
const parsedChain = parseChainId(chainId); | ||
if (!parsedChain.namespace || !parsedChain.reference) { | ||
throw new Error( | ||
`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${chainId}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should it be in CAIP-2 format since EIP-1271 signature is specific to EVM ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blockchain api rejects the request if it isnt. Probably we can update there it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this be a breaking change if someone provides a custom RPC url and is sending the non compliant CAIP-2 chain ID ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it shouldn't. These params are opinionated for our rpc api. Direct node urls do not use them
const parsedChain = parseChainId(chainId); | ||
if (!parsedChain.namespace || !parsedChain.reference) { | ||
throw new Error( | ||
`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${chainId}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this be a breaking change if someone provides a custom RPC url and is sending the non compliant CAIP-2 chain ID ?
Description
Fixed a bug where we were not passing CAIP2 formatted
chainId
for 1271 signature validationType of change
How has this been tested?
tests
Checklist
Additional Information (Optional)
Please include any additional information that may be useful for the reviewer.