From 8488a1a26f746ab4da6c94661f0db304b9511b59 Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Sun, 23 Feb 2025 16:37:35 +0100 Subject: [PATCH] Reorder '_callValidateUserOp' parameters for consistency --- contracts/core/EntryPoint.sol | 9 +++++++-- reports/gas-checker.txt | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/contracts/core/EntryPoint.sol b/contracts/core/EntryPoint.sol index 56519b66..f3ac9650 100644 --- a/contracts/core/EntryPoint.sol +++ b/contracts/core/EntryPoint.sol @@ -507,7 +507,7 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuardT ? 0 : requiredPrefund - bal; } - validationData = _callValidateUserOp(op, opInfo, missingAccountFunds, opIndex); + validationData = _callValidateUserOp(opIndex, op, opInfo, missingAccountFunds); if (paymaster == address(0)) { DepositInfo storage senderInfo = deposits[sender]; uint256 deposit = senderInfo.deposit; @@ -521,7 +521,12 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuardT // call sender.validateUserOp() // handle wrong output size with FailedOp - function _callValidateUserOp(PackedUserOperation calldata op, UserOpInfo memory opInfo, uint256 missingAccountFunds, uint256 opIndex) + function _callValidateUserOp( + uint256 opIndex, + PackedUserOperation calldata op, + UserOpInfo memory opInfo, + uint256 missingAccountFunds + ) internal virtual returns (uint256 validationData) { uint256 saveFreePtr = getFreePtr(); bytes memory callData = abi.encodeCall(IAccount.validateUserOp, (op, opInfo.userOpHash, missingAccountFunds)); diff --git a/reports/gas-checker.txt b/reports/gas-checker.txt index 5508213a..4bd85374 100644 --- a/reports/gas-checker.txt +++ b/reports/gas-checker.txt @@ -16,32 +16,32 @@ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ ║ simple - diff from previous │ 2 │ │ 41528 │ 12529 ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ simple │ 10 │ 451398 │ │ ║ +║ simple │ 10 │ 451410 │ │ ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ simple - diff from previous │ 11 │ │ 41528 │ 12529 ║ +║ simple - diff from previous │ 11 │ │ 41600 │ 12601 ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ ║ simple paymaster │ 1 │ 83336 │ │ ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ simple paymaster with diff │ 2 │ │ 40172 │ 11173 ║ +║ simple paymaster with diff │ 2 │ │ 40184 │ 11185 ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ simple paymaster │ 10 │ 445191 │ │ ║ +║ simple paymaster │ 10 │ 445167 │ │ ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ simple paymaster with diff │ 11 │ │ 40215 │ 11216 ║ +║ simple paymaster with diff │ 11 │ │ 40251 │ 11252 ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ ║ big tx 5k │ 1 │ 167156 │ │ ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ ║ big tx - diff from previous │ 2 │ │ 130794 │ 16354 ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ big tx 5k │ 10 │ 1344260 │ │ ║ +║ big tx 5k │ 10 │ 1344212 │ │ ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ big tx - diff from previous │ 11 │ │ 130793 │ 16353 ║ +║ big tx - diff from previous │ 11 │ │ 130781 │ 16341 ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ paymaster+postOp │ 1 │ 84716 │ │ ║ +║ paymaster+postOp │ 1 │ 84728 │ │ ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ paymaster+postOp with diff │ 2 │ │ 41600 │ 12601 ║ +║ paymaster+postOp with diff │ 2 │ │ 41588 │ 12589 ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ paymaster+postOp │ 10 │ 459152 │ │ ║ +║ paymaster+postOp │ 10 │ 459176 │ │ ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ paymaster+postOp with diff │ 11 │ │ 41648 │ 12649 ║ +║ paymaster+postOp with diff │ 11 │ │ 41588 │ 12589 ║ ╚════════════════════════════════╧═══════╧═══════════════╧════════════════╧═════════════════════╝