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
-
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
validateSignerAndRequest
function 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
hashData
function and then signed using the wallet. The signed message is then passed to thevalidateSignerAndRequest
function along with the hashData parameters and the signature. ThevalidateSignerAndRequest
function of the contract then verifies the signer on-chain using theverifyDigest
function 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