Optimize EOA signature verification#2661
Conversation
Prev gas: EOA: 2000 + 3500 SC: 2000 Now gas: EOA: 3500 SC: (signature.length is 64 or 65 ? 3500 : 0) + 2000
|
Hello @k06a, First of all, thank you for this PR, we noticed it a while back and failed to let you know. For that I am sorry.
Unfortunatelly, we have no way to catch an internal library call :/ We will investigate other options (like having a non reverting ecrecover that returns an "error" enum + the recovered address). What do you think ? |
Amxx
left a comment
There was a problem hiding this comment.
We should ensure that, if signer is an ERC1271 implementing contract, the initial ecrecover doesn't revert and the contract call is performed.
|
@Amxx WDYT about ECDSA-tryRecover introduced in the latest commit? |
Conflicts: contracts/utils/cryptography/ECDSA.sol contracts/utils/cryptography/SignatureChecker.sol
|
@Amxx nice changes! I believe this |
|
The problem I see with this As far as I know custom errors cannot be passed around as values. Perhaps this is something we should raise with the Solidity team. |
|
@frangio possibly we could return ABI-encoded version ( |
|
@frangio
In the futur we can remove the |
|
Good |
Optimize EOA signature verification. Since Berlin HF
isContract()would cost 2000 gas.Prev gas:
Now gas: