Allow _validateSignature to be non-view (#114)

* Allow _validateSignature to be non-view
This commit is contained in:
soham
2022-10-23 18:38:49 +00:00
committed by GitHub
parent 699ecca177
commit 347cfd99a7
3 changed files with 15 additions and 15 deletions

View File

@@ -57,7 +57,7 @@ abstract contract BaseWallet is IWallet {
* (also hashes the entrypoint and chain-id)
* @param aggregator the current aggregator. can be ignored by wallets that don't use aggregators
*/
function _validateSignature(UserOperation calldata userOp, bytes32 requestId, address aggregator) internal virtual view;
function _validateSignature(UserOperation calldata userOp, bytes32 requestId, address aggregator) internal virtual;
/**
* validate the current nonce matches the UserOperation nonce.

View File

@@ -114,7 +114,7 @@ contract SimpleWallet is BaseWallet {
}
/// implement template method of BaseWallet
function _validateSignature(UserOperation calldata userOp, bytes32 requestId, address) internal view virtual override {
function _validateSignature(UserOperation calldata userOp, bytes32 requestId, address) internal virtual override {
bytes32 hash = requestId.toEthSignedMessageHash();
require(owner == hash.recover(userOp.signature), "wallet: wrong signature");
}

View File

@@ -2,34 +2,34 @@
the destination is "wallet.nonce()", which is known to be "hot" address used by this wallet
it little higher than EOA call: its an exec from entrypoint (or wallet owner) into wallet contract, verifying msg.sender and exec to target)
- gas estimate "simple" - 27795
- gas estimate "big tx 5k" - 122772
- gas estimate "big tx 5k" - 122784
╔════════════════════════════════╤═══════╤═══════════════╤════════════════╤═════════════════════╗
║ handleOps description │ count │ total gasUsed │ per UserOp gas │ per UserOp overhead ║
║ │ │ │ (delta for │ (compared to ║
║ │ │ │ one UserOp) │ wallet.exec()) ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple │ 1 │ 72856 │ │ ║
║ simple │ 1 │ 72844 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple - diff from previous │ 2 │ │ 40846 │ 13051 ║
║ simple - diff from previous │ 2 │ │ 40814 │ 13019
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple │ 10 │ 440486 │ │ ║
║ simple │ 10 │ 440546 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple - diff from previous │ 11 │ │ 40977 │ 13182
║ simple - diff from previous │ 11 │ │ 40853 │ 13058
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple paymaster │ 1 │ 72856 │ │ ║
║ simple paymaster │ 1 │ 72824 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple paymaster with diff │ 2 │ │ 40806 │ 13011
║ simple paymaster with diff │ 2 │ │ 40838 │ 13043
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple paymaster │ 10 │ 440466 │ │ ║
║ simple paymaster │ 10 │ 440446 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple paymaster with diff │ 11 │ │ 41061 │ 13266
║ simple paymaster with diff │ 11 │ │ 41109 │ 13314
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ big tx 5k │ 1 │ 172470 │ │ ║
║ big tx 5k │ 1 │ 172494 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ big tx - diff from previous │ 2 │ │ 140082 │ 17310
║ big tx - diff from previous │ 2 │ │ 140106 │ 17322
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ big tx 5k │ 10 │ 1438886 │ │ ║
║ big tx 5k │ 10 │ 1438918 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ big tx - diff from previous │ 11 │ │ 141578 │ 18806
║ big tx - diff from previous │ 11 │ │ 141554 │ 18770
╚════════════════════════════════╧═══════╧═══════════════╧════════════════╧═════════════════════╝