EIP191 signature verification fails on-chain for a signer for different datasets. ecrecover fails to provide same signer address #4910
Unanswered
jayeshbairagi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Contract:
GasLimit calculations script:
For the above contract and GasLimit calculations script, the first run is successful while the second run is failing with the GasLimit error: "Error estimating gas for validateSignerAndRequest: Error: execution reverted: "Req::InvalidSignature".
As seen in the above contract and script, the
validateSignerAndRequestfunction is used to validate the signer.The difference between the two runs is the first 2 parameters of the contract call. For both the cases hash is calculated using the
hashDatafunction and then signed using the wallet. The signed message is then passed to thevalidateSignerAndRequestfunction along with the hashData parameters and the signature. ThevalidateSignerAndRequestfunction of the contract then verifies the signer on-chain using theverifyDigestfunction and returns the signer address.But, the second run fails with the GasLimit error:
"Error estimating gas for validateSignerAndRequest: Error: execution reverted: "Req::InvalidSignature".How can I fix this issue? What is missing? Since the hash calculation and signing process are the same, signed data is just another hash that should be validated if signed by the valid keys for all instances, what is causing the second run to fail?
Beta Was this translation helpful? Give feedback.
All reactions